feat(core): allow to debug KickPlayer() (#1549)

This commit is contained in:
Francesco Borzì
2019-03-05 22:58:40 +01:00
committed by GitHub
parent e7ace60e59
commit 0758677578
19 changed files with 44 additions and 39 deletions

View File

@@ -144,7 +144,7 @@ WorldSession::~WorldSession()
/// - If have unclosed socket, close it
if (m_Socket)
{
m_Socket->CloseSocket();
m_Socket->CloseSocket("WorldSession destructor");
m_Socket->RemoveReference();
m_Socket = NULL;
}
@@ -236,7 +236,7 @@ void WorldSession::SendPacket(WorldPacket const* packet)
#endif
if (m_Socket->SendPacket(*packet) == -1)
m_Socket->CloseSocket();
m_Socket->CloseSocket("m_Socket->SendPacket(*packet) == -1");
}
/// Add an incoming packet to the queue
@@ -255,7 +255,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
/// If necessary, kick the player because the client didn't send anything for too long
/// (or they've been idling in character select)
if (sWorld->getBoolConfig(CONFIG_CLOSE_IDLE_CONNECTIONS) && IsConnectionIdle())
m_Socket->CloseSocket();
m_Socket->CloseSocket("Client didn't send anything for too long");
}
HandleTeleportTimeout(updater.ProcessLogout());
@@ -611,10 +611,10 @@ void WorldSession::LogoutPlayer(bool save)
}
/// Kick a player out of the World
void WorldSession::KickPlayer(bool setKicked)
void WorldSession::KickPlayer(std::string const& reason, bool setKicked)
{
if (m_Socket)
m_Socket->CloseSocket();
m_Socket->CloseSocket(reason);
if (setKicked)
SetKicked(true); // pussywizard: the session won't be left ingame for 60 seconds and to also kick offline session