Properly deregister WorldSocket connections in case of reaching socket timeout time.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-04-23 12:56:16 +02:00
parent b142ae155e
commit c4e4486903
4 changed files with 38 additions and 25 deletions
+6 -2
View File
@@ -49,7 +49,7 @@ LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mu
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)),
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
m_latency(0), m_TutorialsChanged(false)
m_latency(0), m_TutorialsChanged(false), m_timeOutTime(0)
{
if (sock)
{
@@ -180,7 +180,7 @@ bool WorldSession::Update(uint32 /*diff*/)
LookupOpcodeName(packet->GetOpcode()),
packet->GetOpcode());
#endif*/
if (packet->GetOpcode() >= NUM_MSG_TYPES)
{
sLog.outError("SESSION: received non-existed opcode %s (0x%.4X)",
@@ -287,6 +287,10 @@ 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