summaryrefslogtreecommitdiff
path: root/src/net_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_server.c')
-rw-r--r--src/net_server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net_server.c b/src/net_server.c
index e8ecb4f..52dca17 100644
--- a/src/net_server.c
+++ b/src/net_server.c
@@ -127,7 +127,7 @@ void server_start_game(int* clients, const uint8_t clientcount, const player_lis
uint8_t* buf;
uint8_t usercount = players->count;
uint32_t pos;
- uint32_t buflen = 3 + usercount; // type + packetlen + usercount + (usercount * len)
+ uint32_t buflen = 3 + 2*usercount; // type + packetlen + usercount + (usercount * player_id) + (usercount * len)
//for(int i=0; i<usercount; i++)
// buflen += strlen(players->names[i]);
@@ -145,7 +145,9 @@ void server_start_game(int* clients, const uint8_t clientcount, const player_lis
// copy usernames with length to buffer
for(int i=0; i<usercount; i++)
{
- /*uint8_t len = strlen(players->names[i]);
+ /*
+ buf[pos++] = i; // player_id
+ uint8_t len = strlen(players->names[i]);
buf[pos++] = len;
memcpy(buf+pos, players->names[i], len);
pos += len;*/