why does the plugin loop through all clients every 5 seconds and subtract 32 from their RequestCount?
Spoiler
PHP Code:
int RequestCount[MAXPLAYERS+1] = {0, ...};
public OnPluginStart()
{
CreateTimer(5.0, DecrementThread, _, TIMER_REPEAT);
}
public Action:DecrementThread(Handle:timer, any:unused)
{
for (new client = 0; client <= MaxClients; client++)
{
RequestCount[client] -= 32;
if(RequestCount[client] < 0)
RequestCount[client] = 0;
}
return Plugin_Continue;
}
edit: I'm guessing it's to account for false-positive scenarios in case there's a game mode that happens to send a large amount of files:
Quote:
"I'm unaware if any game mode will utilize the request file function after a player conects (for example sprays) but i believe it's handled differently (server sends files rather than client requesting file)."
|