mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11398] Get rid of 2 useless timers and drop a problematic diff in session update
Signed-off-by: Neo2003 <Neo.2003@Hotmail.fr)>
This commit is contained in:
parent
66598c8815
commit
82367bbdea
6 changed files with 17 additions and 31 deletions
|
|
@ -443,7 +443,7 @@ void Map::Update(const uint32 &t_diff)
|
|||
WorldSession * pSession = plr->GetSession();
|
||||
MapSessionFilter updater(pSession);
|
||||
|
||||
pSession->Update(t_diff, updater);
|
||||
pSession->Update(updater);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1305,8 +1305,6 @@ void World::SetInitialWorldSettings()
|
|||
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime) VALUES('%u', " UI64FMTD ", '%s', 0)",
|
||||
realmID, uint64(m_startTime), isoDate);
|
||||
|
||||
m_timers[WUPDATE_OBJECTS].SetInterval(0);
|
||||
m_timers[WUPDATE_SESSIONS].SetInterval(0);
|
||||
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(getConfig(CONFIG_UINT32_UPTIME_UPDATE)*MINUTE*IN_MILLISECONDS);
|
||||
|
|
@ -1456,13 +1454,8 @@ void World::Update(uint32 diff)
|
|||
sAuctionMgr.Update();
|
||||
}
|
||||
|
||||
/// <li> Handle session updates when the timer has passed
|
||||
if (m_timers[WUPDATE_SESSIONS].Passed())
|
||||
{
|
||||
m_timers[WUPDATE_SESSIONS].Reset();
|
||||
|
||||
UpdateSessions(diff);
|
||||
}
|
||||
/// <li> Handle session updates
|
||||
UpdateSessions(diff);
|
||||
|
||||
/// <li> Handle weather updates when the timer has passed
|
||||
if (m_timers[WUPDATE_WEATHERS].Passed())
|
||||
|
|
@ -1494,14 +1487,9 @@ void World::Update(uint32 diff)
|
|||
}
|
||||
|
||||
/// <li> Handle all other objects
|
||||
if (m_timers[WUPDATE_OBJECTS].Passed())
|
||||
{
|
||||
m_timers[WUPDATE_OBJECTS].Reset();
|
||||
///- Update objects when the timer has passed (maps, transport, creatures,...)
|
||||
sMapMgr.Update(diff); // As interval = 0
|
||||
|
||||
sBattleGroundMgr.Update(diff);
|
||||
}
|
||||
///- Update objects (maps, transport, creatures,...)
|
||||
sMapMgr.Update(diff);
|
||||
sBattleGroundMgr.Update(diff);
|
||||
|
||||
///- Delete all characters which have been deleted X days before
|
||||
if (m_timers[WUPDATE_DELETECHARS].Passed())
|
||||
|
|
@ -1917,7 +1905,7 @@ void World::UpdateSessions( uint32 diff )
|
|||
WorldSession * pSession = itr->second;
|
||||
WorldSessionFilter updater(pSession);
|
||||
|
||||
if(!pSession->Update(diff, updater)) // As interval = 0
|
||||
if(!pSession->Update(updater))
|
||||
{
|
||||
RemoveQueuedSession(pSession);
|
||||
m_sessions.erase(itr);
|
||||
|
|
|
|||
|
|
@ -71,15 +71,13 @@ enum ShutdownExitCode
|
|||
/// Timers for different object refresh rates
|
||||
enum WorldTimers
|
||||
{
|
||||
WUPDATE_OBJECTS = 0,
|
||||
WUPDATE_SESSIONS = 1,
|
||||
WUPDATE_AUCTIONS = 2,
|
||||
WUPDATE_WEATHERS = 3,
|
||||
WUPDATE_UPTIME = 4,
|
||||
WUPDATE_CORPSES = 5,
|
||||
WUPDATE_EVENTS = 6,
|
||||
WUPDATE_DELETECHARS = 7,
|
||||
WUPDATE_COUNT = 8
|
||||
WUPDATE_AUCTIONS = 0,
|
||||
WUPDATE_WEATHERS = 1,
|
||||
WUPDATE_UPTIME = 2,
|
||||
WUPDATE_CORPSES = 3,
|
||||
WUPDATE_EVENTS = 4,
|
||||
WUPDATE_DELETECHARS = 5,
|
||||
WUPDATE_COUNT = 6
|
||||
};
|
||||
|
||||
/// Configuration elements
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ void WorldSession::LogUnprocessedTail(WorldPacket *packet)
|
|||
}
|
||||
|
||||
/// Update the WorldSession (triggered by World update)
|
||||
bool WorldSession::Update(uint32 diff, PacketFilter& updater)
|
||||
bool WorldSession::Update(PacketFilter& updater)
|
||||
{
|
||||
///- Retrieve packets from the receive queue and call the appropriate handlers
|
||||
/// not process packets if socket already closed
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
|
||||
void QueuePacket(WorldPacket* new_packet);
|
||||
|
||||
bool Update(uint32 diff, PacketFilter& updater);
|
||||
bool Update(PacketFilter& updater);
|
||||
|
||||
/// Handle the authentication waiting queue (to be completed)
|
||||
void SendAuthWaitQue(uint32 position);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11397"
|
||||
#define REVISION_NR "11398"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue