From 79037e9381c25451705c964c830cdebd85877127 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 3 Nov 2012 04:00:06 +0000 Subject: [PATCH] - added some debug code for network protocol --- source/glest_game/network/network_protocol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/glest_game/network/network_protocol.cpp b/source/glest_game/network/network_protocol.cpp index 673e8d57..25d08ba7 100644 --- a/source/glest_game/network/network_protocol.cpp +++ b/source/glest_game/network/network_protocol.cpp @@ -266,6 +266,8 @@ unsigned int pack(unsigned char *buf, const char *format, ...) { size += 1; c = (signed char)va_arg(ap, int); // promoted *buf++ = c; + + printf("pack int8 = %d [%X] c = %d [%X] \n",*(buf-1),*(buf-1),c,c); break; case 'C': // 8-bit unsigned @@ -424,7 +426,7 @@ unsigned int unpack(unsigned char *buf, const char *format, ...) { *c = *buf++; size += 1; - printf("unpack int8 = %d [%X] c = %d [%X] c2 = %d [%X]\n",*(buf-1),*(buf-1),*c,(-1 - (unsigned char)(0xffu - *(buf-1)))); + printf("unpack int8 = %d [%X] c = %d [%X] c2 = %d [%X]\n",*(buf-1),*(buf-1),*c,*c, (-1 - (unsigned char)(0xffu - *(buf-1))),(-1 - (unsigned char)(0xffu - *(buf-1)))); break; case 'C': // 8-bit unsigned