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
+17
View File
@@ -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