removed debug output
authorDavid Anderson <dvander@alliedmods.net>
Sun Mar 16 22:32:03 2008 +0000 (2008-03-16)
changeset 1934d96a3537067c
parent 1933 53f8016e651c
child 1935 76891077963c
removed debug output
fixed an antiflood bug posted on the forums
core/ChatTriggers.cpp
plugins/antiflood.sp
     1.1 --- a/core/ChatTriggers.cpp	Fri Mar 14 06:11:01 2008 +0000
     1.2 +++ b/core/ChatTriggers.cpp	Sun Mar 16 22:32:03 2008 +0000
     1.3 @@ -185,12 +185,21 @@
     1.4  {
     1.5  	CCommand command;
     1.6  #endif
     1.7 -	int client = g_ConCmds.GetCommandClient();
     1.8 +	int client;
     1.9 +	CPlayer *pPlayer;
    1.10 +	
    1.11 +	client = g_ConCmds.GetCommandClient();
    1.12  	m_bIsChatTrigger = false;
    1.13  	m_bWasFloodedMessage = false;
    1.14  
    1.15  	/* The server console cannot do this */
    1.16 -	if (client == 0)
    1.17 +	if (client == 0 || (pPlayer = g_Players.GetPlayerByIndex(client)) == NULL)
    1.18 +	{
    1.19 +		RETURN_META(MRES_IGNORED);
    1.20 +	}
    1.21 +
    1.22 +	/* We guarantee the client is connected */
    1.23 +	if (!pPlayer->IsConnected())
    1.24  	{
    1.25  		RETURN_META(MRES_IGNORED);
    1.26  	}
     2.1 --- a/plugins/antiflood.sp	Fri Mar 14 06:11:01 2008 +0000
     2.2 +++ b/plugins/antiflood.sp	Sun Mar 16 22:32:03 2008 +0000
     2.3 @@ -72,8 +72,6 @@
     2.4  		return false;
     2.5  	}
     2.6  	
     2.7 -	PrintToServer("OCFC: %f %f %d", g_LastTime[client], GetGameTime(), g_FloodTokens[client]);
     2.8 -	
     2.9  	if (g_LastTime[client] > GetGameTime())
    2.10  	{
    2.11  		/* If player has 3 or more flood tokens, block their message */
    2.12 @@ -97,8 +95,6 @@
    2.13  	new Float:curTime = GetGameTime();
    2.14  	new Float:newTime = curTime + max_chat;
    2.15  	
    2.16 -	PrintToServer("OCFR: %f, %f", g_LastTime[client], GetGameTime());
    2.17 -	
    2.18  	if (g_LastTime[client] > curTime)
    2.19  	{
    2.20  		/* If the last message was blocked, update their time limit */