Skip to content

Commit

Permalink
finished the simplistic command packet limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
fdChasm committed Jun 2, 2010
1 parent ec8606a commit a7554a8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/fpsgame/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,19 +1593,12 @@ namespace server

void incrementrecentpacketcount(clientinfo *ci)
{
//int recentpacketcount;
//enet_uint32 lastpackettime;
//string msg;

if (ci->lastpackettime - curtime < 3)
{
ci->recentpacketcount++;
//formatstring(msg)("a packet within 1000 millis of last. current count %d", ci->recentpacketcount );
//sendservmsg(msg);
if (ci->recentpacketcount > 20)
{
//disconnect_client(ci->clientnum, DISC_KICK);
//instead of kicking the player from here lets add a ban to the db
SbPy::triggerEventInt("server_kick", ci->clientnum);
ci->recentpacketcount = ci->recentpacketcount - 1000;
}
Expand All @@ -1616,8 +1609,6 @@ namespace server
ci->lastpackettime = curtime;

}
//curtime

}

void parsepacket(int sender, int chan, packetbuf &p) // has to parse exactly each byte of the packet
Expand Down

0 comments on commit a7554a8

Please sign in to comment.