mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Updated Server Query Protocol (markdown)
1 parent
d0d0b5e845
commit
c67ffb925b
1 file changed
+2
-2
+2
-2
@@ -33,8 +33,8 @@ The checksum function used is a variant of CRC16:
|
|||||||
```
|
```
|
||||||
u16 x;
|
u16 x;
|
||||||
u16 crc = 0xFFFF;
|
u16 crc = 0xFFFF;
|
||||||
for (u32 i = 0; i < buf.wp; ++i) {
|
for (u32 i = 0; i < numbytes; ++i) {
|
||||||
x = crc >> 8 ^ buf.data[i];
|
x = crc >> 8 ^ bytes[i];
|
||||||
x ^= x >> 4;
|
x ^= x >> 4;
|
||||||
crc += (crc << 8) ^ (x << 12) ^ (x << 5) ^ x;
|
crc += (crc << 8) ^ (x << 12) ^ (x << 5) ^ x;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user