diff options
author | Machiavelli <none@none> | 2010-04-23 12:56:16 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2010-04-23 12:56:16 +0200 |
commit | c4e4486903a57bca1bcfb438c75e4ee7a806b67c (patch) | |
tree | 905081caadad164ebb87fc14f2d586737d7388da /src/game/WorldSession.h | |
parent | b142ae155e88677a82669df383f3d54e651b1898 (diff) |
Properly deregister WorldSocket connections in case of reaching socket timeout time.
--HG--
branch : trunk
Diffstat (limited to 'src/game/WorldSession.h')
-rw-r--r-- | src/game/WorldSession.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 423a51aec03..84c16e0ebc9 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -29,6 +29,7 @@ #include "SharedDefines.h" #include "AddonMgr.h" #include "QueryResult.h" +#include "World.h" struct ItemPrototype; struct AuctionEntry; @@ -283,6 +284,22 @@ class WorldSession uint32 GetLatency() const { return m_latency; } void SetLatency(uint32 latency) { m_latency = latency; } uint32 getDialogStatus(Player *pPlayer, Object* questgiver, uint32 defstatus); + + time_t m_timeOutTime; + void UpdateTimeOutTime(bool b) + { + if (b) + m_timeOutTime = time(NULL) + sWorld.getConfig(CONFIG_SOCKET_TIMEOUTTIME) / IN_MILISECONDS; + else + m_timeOutTime = 0; + } + bool IsConnectionIdle() const + { + if (m_timeOutTime && m_timeOutTime <= time(NULL)) + return true; + return false; + } + public: // opcodes handlers |