Some fixes to DoS code.

This commit is contained in:
Dabb 2000-08-14 13:02:17 +00:00
parent 23d81824dc
commit 66e08b1e0f

View file

@ -67,7 +67,7 @@ client_t *host_client; // current client
// fixme: these default values need to be tweaked after more testing
double netdosexpire[DOSFLOODCMDS] = {1,1,2,0.9,1,5};
double netdosvalues[DOSFLOODCMDS] = {12,1,3,2,1,1};
double netdosvalues[DOSFLOODCMDS] = {12,1,3,1,1,1};
cvar_t *sv_netdosprotect; // tone down DoS from quake servers
@ -448,6 +448,8 @@ int CheckForFlood(flood_enum_t cmdtype)
i = oldest;
floodstatus[cmdtype][i].adr = net_from;
floodstatus[cmdtype][i].firstseen = currenttime;
floodstatus[cmdtype][i].cmdcount=0;
floodstatus[cmdtype][i].floodcount = 0;
}
floodstatus[cmdtype][i].issued = currenttime;
floodstatus[cmdtype][i].cmdcount += 1;
@ -469,9 +471,8 @@ void SVC_Status (void)
int ping;
int top, bottom;
if (CheckForFlood(FLOOD_STATUS)) return;
if (!sv_allow_status->value) return;
if (CheckForFlood(FLOOD_STATUS)) return;
Cmd_TokenizeString ("status");
SV_BeginRedirect (RD_PACKET);
@ -538,7 +539,7 @@ void SVC_Log (void)
int seq;
char data[MAX_DATAGRAM+64];
if (sv_allow_log->value) return;
if (!sv_allow_log->value) return;
if (CheckForFlood(FLOOD_LOG)) return;
if (Cmd_Argc() == 2)
@ -600,7 +601,6 @@ void SVC_GetChallenge (void)
int oldest;
int oldestTime;
// if (CheckForFlood(FLOOD_CHALLENGE)) return;
oldest = 0;
oldestTime = 0x7fffffff;