removed debug output
fixed an antiflood bug posted on the forums --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401940
This commit is contained in:
parent
76f1c10409
commit
2583e7e69e
@ -185,12 +185,21 @@ void ChatTriggers::OnSayCommand_Pre()
|
|||||||
{
|
{
|
||||||
CCommand command;
|
CCommand command;
|
||||||
#endif
|
#endif
|
||||||
int client = g_ConCmds.GetCommandClient();
|
int client;
|
||||||
|
CPlayer *pPlayer;
|
||||||
|
|
||||||
|
client = g_ConCmds.GetCommandClient();
|
||||||
m_bIsChatTrigger = false;
|
m_bIsChatTrigger = false;
|
||||||
m_bWasFloodedMessage = false;
|
m_bWasFloodedMessage = false;
|
||||||
|
|
||||||
/* The server console cannot do this */
|
/* The server console cannot do this */
|
||||||
if (client == 0)
|
if (client == 0 || (pPlayer = g_Players.GetPlayerByIndex(client)) == NULL)
|
||||||
|
{
|
||||||
|
RETURN_META(MRES_IGNORED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We guarantee the client is connected */
|
||||||
|
if (!pPlayer->IsConnected())
|
||||||
{
|
{
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,6 @@ public bool:OnClientFloodCheck(client)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintToServer("OCFC: %f %f %d", g_LastTime[client], GetGameTime(), g_FloodTokens[client]);
|
|
||||||
|
|
||||||
if (g_LastTime[client] > GetGameTime())
|
if (g_LastTime[client] > GetGameTime())
|
||||||
{
|
{
|
||||||
/* If player has 3 or more flood tokens, block their message */
|
/* If player has 3 or more flood tokens, block their message */
|
||||||
@ -97,8 +95,6 @@ public OnClientFloodResult(client, bool:blocked)
|
|||||||
new Float:curTime = GetGameTime();
|
new Float:curTime = GetGameTime();
|
||||||
new Float:newTime = curTime + max_chat;
|
new Float:newTime = curTime + max_chat;
|
||||||
|
|
||||||
PrintToServer("OCFR: %f, %f", g_LastTime[client], GetGameTime());
|
|
||||||
|
|
||||||
if (g_LastTime[client] > curTime)
|
if (g_LastTime[client] > curTime)
|
||||||
{
|
{
|
||||||
/* If the last message was blocked, update their time limit */
|
/* If the last message was blocked, update their time limit */
|
||||||
|
Loading…
Reference in New Issue
Block a user