canadianjeff, well, you have lags randomly, but you still unsure who or what caused it?
If that's a hardware issue:
1) you must have some control panel to be able to check:
- CPU loading
- memory loading
- network channel (not always)
If on VPS, you have much more options, at least try ping some public service
2) enter
net_graph 4 in console, you can estimate CPU / network loading per entity types.
3) try to change the map to exclude entities overflow issue.
4) Check handles leaking. Instruction is in
Section 11.
5) Try command
sm plugins unload_all - (may crash your server) - it will forcibly unload all your plugins.
6) Check addons/sourcemod/logs for error*.log
If that's human-related:
1) There is a function:
Quote:
float GetGameFrameTime()
Returns the time the Game took processing the last frame.
|
You could check it by some repeatable timer against some pre-defined constant and catch the moment, when the server begins to lag to start logging who is on the server at the moment for giving a ban.
2) As asherkin said, that could be commands spamming.
I'm sure somewhere should be a solution for this. But, if not, I think you could intercept messages and force a minimum delay between commands, something like:
PHP Code:
#include <sourcemod>
float g_fPressTime[MAXPLAYERS+1];
public Action OnClientCommand(int client, int args)
{
if( GetEngineTime() - g_fPressTime[client] > 0.5 )
{
g_fPressTime[client] = GetEngineTime();
return Plugin_Continue;
}
return Plugin_Handled;
}
This may cause some problems, so better to prepare the whitelist of commands, and block only those unrecognized.
Also, check console.log for some unusual (too repeatable) commands from players.
3) Change rcon password if that's too short/simple.
4) Install all know fixes against bad performance / exploits known which published in this topic:
[TUT] SourcePawn Scripting - Tips, Basics to Advanced (Section 6. Server Fixes).
Good luck!
__________________