diff options
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 |