core/smn_banning.cpp
changeset 1576 f36378b2d71f
parent 1426 02e4b4a871ba
child 1832 1f97873475e8
     1.1 --- a/core/smn_banning.cpp	Mon Oct 15 18:51:11 2007 +0000
     1.2 +++ b/core/smn_banning.cpp	Mon Oct 15 18:51:56 2007 +0000
     1.3 @@ -34,8 +34,6 @@
     1.4  #include "HalfLife2.h"
     1.5  #include "PlayerManager.h"
     1.6  #include "ForwardSys.h"
     1.7 -#include <inetchannel.h>
     1.8 -#include <iclient.h>
     1.9  
    1.10  #define BANFLAG_AUTO	(1<<0)	/**< Auto-detects whether to ban by steamid or IP */
    1.11  #define BANFLAG_IP   	(1<<1)	/**< Always ban by IP address */
    1.12 @@ -265,9 +263,6 @@
    1.13  	ban_flags = params[3];
    1.14  	ban_source = params[7];
    1.15  
    1.16 -    INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(params[1]));
    1.17 -    IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
    1.18 -
    1.19  	/* Check how we should ban the player */
    1.20  	if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO)
    1.21  	{
    1.22 @@ -347,7 +342,7 @@
    1.23  			/* Kick, then ban */
    1.24  			if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
    1.25  			{
    1.26 -   		 		pClient->Disconnect("%s", kick_message);
    1.27 +   		 		pPlayer->Kick(kick_message);
    1.28  			}
    1.29  			engine->ServerCommand(command);
    1.30  	
    1.31 @@ -371,7 +366,7 @@
    1.32  			/* Kick, then ban */
    1.33  			if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
    1.34  			{
    1.35 -   		 		pClient->Disconnect("%s", kick_message);
    1.36 +   		 		pPlayer->Kick(kick_message);
    1.37  			}
    1.38  			engine->ServerCommand(command);
    1.39  
    1.40 @@ -384,7 +379,7 @@
    1.41  	}
    1.42  	else if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
    1.43  	{
    1.44 -		pClient->Disconnect("%s", kick_message);	
    1.45 +		pPlayer->Kick(kick_message);	
    1.46  	}
    1.47  
    1.48