From 6ad4d4c8d2804e404cb4babcbf74788e6d727430 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 5 May 2010 22:56:02 +0200 Subject: Make sure that socket reference is removed on closing WorldSession server sided before ReactorRunnable does in the reactor event loop. --HG-- branch : trunk --- src/game/WorldSession.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 3724d58b63d..f76140fe085 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -275,10 +275,14 @@ bool WorldSession::Update(uint32 /*diff*/) delete packet; } + ///- If necessary, kick the player from the character select screen + if (IsConnectionIdle()) + m_Socket->CloseSocket(); + ///- Cleanup socket pointer if need - if (m_Socket && m_Socket->IsClosed ()) + if (m_Socket && m_Socket->IsClosed()) { - m_Socket->RemoveReference (); + m_Socket->RemoveReference(); m_Socket = NULL; } @@ -287,10 +291,6 @@ bool WorldSession::Update(uint32 /*diff*/) if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading)) LogoutPlayer(true); - ///- If necessary, kick the player from the character select screen - if (IsConnectionIdle()) - return false; - if (!m_Socket) return false; //Will remove this session from the world session map -- cgit v1.2.3