diff options
Diffstat (limited to 'src/master/messages.c')
-rw-r--r-- | src/master/messages.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/master/messages.c b/src/master/messages.c index b30bc334..90fb223c 100644 --- a/src/master/messages.c +++ b/src/master/messages.c @@ -544,9 +544,16 @@ void HandleMessage (const char* msg, size_t length, HandleGetMotd (msg + strlen (C2M_GETMOTD), address); } - // If it's a game statistic + // If it's a game statistic else if( !strncmp( S2M_GAMESTAT, msg, strlen ( S2M_GAMESTAT ) ) ) - { - HandleGameStat( msg + strlen( S2M_GAMESTAT ), address ); + { + server = Sv_GetByAddr(address, qfalse); + if (server == NULL) + return; + if( crt_time - server->lastGameStat > MIN_GAMESTAT_DELAY ) + HandleGameStat( msg + strlen( S2M_GAMESTAT ), address ); + else + MsgPrint( MSG_NORMAL, "%s flooding GAMESTAT messages\n", peer_address ); + server->lastGameStat = crt_time; } } |