summaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2011-01-15 00:08:52 +0100
committerReiner Herrmann <reiner@reiner-h.de>2011-01-15 00:08:52 +0100
commit51672dbfc64892250c1514a4258504e99fef8d6a (patch)
tree309c1d1bf0541c4be0c73154a99825a9f2f76e36 /src/net.c
parent5f7ecaecdbd81cb0d40fb5da7f7035b0b8331538 (diff)
use already available msg_type enum..
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net.c b/src/net.c
index 0eea8a9..0567179 100644
--- a/src/net.c
+++ b/src/net.c
@@ -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;
}