diff options
Diffstat (limited to 'src/net.c')
| -rw-r--r-- | src/net.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -118,7 +118,7 @@ void client_hello(int sock, const char* username) buf = malloc(namelen+2); // type + len + username - buf[0] = CLIENT_HELLO; + buf[0] = msg_type_hello; buf[1] = namelen; memcpy(buf+2, username, namelen); @@ -187,7 +187,7 @@ void server_start_game(int* clients, const uint8_t clientcount, const char* user buflen += strlen(usernames[i]); buf = malloc(buflen); - buf[pos++] = SERVER_START_GAME; + buf[pos++] = msg_type_start_game; buf[pos++] = clientcount; // copy usernames with length to buffer for(int i=0; i<usercount; i++) @@ -217,7 +217,7 @@ char* server_recv_hello(int sock) recv(sock, buf, 13, 0); - assert(buf[0] == CLIENT_HELLO); + assert(buf[0] == msg_type_hello); namelen = buf[1]; name = malloc(namelen+1); @@ -247,7 +247,7 @@ void* server_recv(int sock, uint8_t wanted) switch(type) { - case CLIENT_HELLO: + case msg_type_hello: result = server_recv_hello(sock); break; } |
