From bb98d9289d3911c976b939ca77808b3aac03541b Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 5 Jun 2008 20:43:10 +0000 Subject: [PATCH] net data validation git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2151 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/server.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/src/server.cpp b/source/src/server.cpp index 160b2e43..537e73d6 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1685,6 +1685,7 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 case SV_PRIMARYWEAP: { int nextprimary = getint(p); + if(nextprimary<0 && nextprimary>=NUMGUNS) break; cl->state.nextprimary = nextprimary; break; } @@ -1735,7 +1736,7 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 else event.millis = cl->gameoffset + event.id; \ } seteventmillis(shot.shot); - shot.shot.gun = getint(p); + shot.shot.gun = getint(p); loopk(3) shot.shot.from[k] = getint(p)/DMF; loopk(3) shot.shot.to[k] = getint(p)/DMF; int hits = getint(p); @@ -1924,8 +1925,6 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 } vi->owner = sender; vi->callmillis = servmillis; - //if(callvote(vi)) { QUEUE_MSG; sendf(sender, 1, "ri", SV_CALLVOTESUC); } - //else delete vi; if(callvote(vi)) { QUEUE_MSG; } else delete vi; break;