diff options
Diffstat (limited to 'games/cube/files/patch-server.cpp')
-rw-r--r-- | games/cube/files/patch-server.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/games/cube/files/patch-server.cpp b/games/cube/files/patch-server.cpp index 316b8130d2d..777abd25b69 100644 --- a/games/cube/files/patch-server.cpp +++ b/games/cube/files/patch-server.cpp @@ -1,5 +1,5 @@ ---- server.cpp.orig Tue Feb 6 01:26:35 2007 -+++ server.cpp Tue Feb 6 01:27:06 2007 +--- server.cpp.orig 2007-08-03 15:52:35.000000000 +0200 ++++ server.cpp 2007-08-03 15:58:58.000000000 +0200 @@ -104,7 +104,7 @@ void disconnect_client(int n, char *reason) { @@ -9,8 +9,24 @@ clients[n].type = ST_EMPTY; send2(true, -1, SV_CDIS, n); }; -@@ -408,6 +408,9 @@ - send2(true, -1, SV_CDIS, (int)event.peer->data); +@@ -397,17 +397,20 @@ + } + case ENET_EVENT_TYPE_RECEIVE: + brec += event.packet->dataLength; +- process(event.packet, (int)event.peer->data); ++ process(event.packet, (intptr_t)event.peer->data); + if(event.packet->referenceCount==0) enet_packet_destroy(event.packet); + break; + + case ENET_EVENT_TYPE_DISCONNECT: +- if((int)event.peer->data<0) break; +- printf("disconnected client (%s)\n", clients[(int)event.peer->data].hostname); +- clients[(int)event.peer->data].type = ST_EMPTY; +- send2(true, -1, SV_CDIS, (int)event.peer->data); ++ if((intptr_t)event.peer->data<0) break; ++ printf("disconnected client (%s)\n", clients[(intptr_t)event.peer->data].hostname); ++ clients[(intptr_t)event.peer->data].type = ST_EMPTY; ++ send2(true, -1, SV_CDIS, (intptr_t)event.peer->data); event.peer->data = (void *)-1; break; + |