diff options
Diffstat (limited to 'include/packet.c')
-rw-r--r-- | include/packet.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/packet.c b/include/packet.c new file mode 100644 index 0000000..db20a12 --- /dev/null +++ b/include/packet.c @@ -0,0 +1,12 @@ +#include "packet.h" + +unsigned int system_packet_checksum(struct kv_system_packet *packet) { + return (packet->user_id << 8) ^ + (packet->operation_id | (177013 << 10)); +} + +int __user_cmp(const void* a, const void* b) { + struct user *_a = (struct user*)a, + *_b = (struct user*)b; + return _a->id - _b->id; +} |