Permalink
Browse files

Printing general string packet

  • Loading branch information...
1 parent 9de6fd4 commit 25a06ccf496a7b1f5e982d58963df24867ee85f0 @MOZGIII MOZGIII committed May 19, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/client/callbacks.c
View
@@ -22,7 +22,16 @@
void cb_remote_default(int ptype, int plen, void *payload) {
on packet(PACKET_GAME_ATTACH) {
+
output("Server wanted us to attach to game %d!\n", ntohl(((packet_game_attach*)(payload))->gameid));
+
+ } packet(PACKET_GENERAL_STRING) {
+
+ // Force string end
+ ((char *)payload)[plen - 1] = '\0';
+ output("%s\n", (char *)payload);
+ print_prompt();
+
} else {
output("Unknown packet!\n");
packet_debug(ptype, plen, payload);

0 comments on commit 25a06cc

Please sign in to comment.