mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(core): allow to debug KickPlayer() (#1549)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user