support for protocol 810

* change in protocol/network classes to make compatible with older protocols
* use filestream for reading dat
* add many ifdefs for multi-protocol support
This commit is contained in:
Eduardo Bart
2012-05-11 15:02:57 -03:00
parent e1fad92110
commit 5a47e9d8a9
19 changed files with 329 additions and 192 deletions

View File

@@ -326,6 +326,22 @@ inline float randomRange<float>(float min, float max) {
return min + (max - min)*dis(gen);
}
inline uint32 getAdlerChecksum(uint8* buffer, uint16 size) {
register uint32 a = 1, b = 0, tlen;
while(size > 0) {
tlen = size > 5552 ? 5552 : size;
size -= tlen;
do {
a += *buffer++;
b += a;
} while (--tlen);
a %= 65521;
b %= 65521;
}
return (b << 16) | a;
}
}
// shortcut for Fw::dump