moved IClient stuff around so OB changes are easier to manage

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401582
This commit is contained in:
David Anderson 2007-10-15 18:51:56 +00:00
parent 6e03cb39a1
commit fe0a6fb475
3 changed files with 7 additions and 14 deletions

View File

@ -38,13 +38,13 @@
#include "MenuStyle_Radio.h"
#include "sm_stringutil.h"
#include "CoreConfig.h"
#include <inetchannel.h>
#include <iclient.h>
#include "TimerSys.h"
#include "Translator.h"
#include "Logger.h"
#include "ChatTriggers.h"
#include "HalfLife2.h"
#include <inetchannel.h>
#include <iclient.h>
PlayerManager g_Players;
bool g_OnMapStarted = false;
@ -1001,6 +1001,7 @@ void CPlayer::DumpAdmin(bool deleting)
void CPlayer::Kick(const char *str)
{
MarkAsBeingKicked();
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(m_iIndex));
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
pClient->Disconnect("%s", str);

View File

@ -34,8 +34,6 @@
#include "HalfLife2.h"
#include "PlayerManager.h"
#include "ForwardSys.h"
#include <inetchannel.h>
#include <iclient.h>
#define BANFLAG_AUTO (1<<0) /**< Auto-detects whether to ban by steamid or IP */
#define BANFLAG_IP (1<<1) /**< Always ban by IP address */
@ -265,9 +263,6 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
ban_flags = params[3];
ban_source = params[7];
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(params[1]));
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
/* Check how we should ban the player */
if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO)
{
@ -347,7 +342,7 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
/* Kick, then ban */
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
{
pClient->Disconnect("%s", kick_message);
pPlayer->Kick(kick_message);
}
engine->ServerCommand(command);
@ -371,7 +366,7 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
/* Kick, then ban */
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
{
pClient->Disconnect("%s", kick_message);
pPlayer->Kick(kick_message);
}
engine->ServerCommand(command);
@ -384,7 +379,7 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
}
else if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
{
pClient->Disconnect("%s", kick_message);
pPlayer->Kick(kick_message);
}

View File

@ -1013,9 +1013,6 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
return 1;
}
INetChannel *pNetChan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(client));
IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler());
g_SourceMod.SetGlobalTarget(client);
char buffer[256];
@ -1026,7 +1023,7 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params)
return 0;
}
pClient->Disconnect("%s", buffer);
pPlayer->Kick(buffer);
return 1;
}