mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
[10718] Partly revert "[10687] UInt32 timer class copies instead using time_t timers for mstime cases."
This reverts commit 967877fefd91e00895f9790dc006b532b94d41b7 in part MapManager/World timers. Main reason: unclear source cases wrong mstime diff generation at WorldRunnable level at *nix systems. So need have existed in past hacks that skip its.
This commit is contained in:
parent
3b0e926788
commit
c9dacb9940
5 changed files with 12 additions and 7 deletions
|
|
@ -246,10 +246,10 @@ MapManager::Update(uint32 diff)
|
|||
return;
|
||||
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
iter->second->Update(i_timer.GetCurrent());
|
||||
iter->second->Update((uint32)i_timer.GetCurrent());
|
||||
|
||||
for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter)
|
||||
(*iter)->Update(i_timer.GetCurrent());
|
||||
(*iter)->Update((uint32)i_timer.GetCurrent());
|
||||
|
||||
i_timer.SetCurrent(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton<MapManager, MaNGOS::
|
|||
typedef MaNGOS::ClassLevelLockable<MapManager, ACE_Thread_Mutex>::Lock Guard;
|
||||
uint32 i_gridCleanUpDelay;
|
||||
MapMapType i_maps;
|
||||
ShortIntervalTimer i_timer;
|
||||
IntervalTimer i_timer;
|
||||
};
|
||||
|
||||
#define sMapMgr MapManager::Instance()
|
||||
|
|
|
|||
|
|
@ -1287,7 +1287,7 @@ void World::SetInitialWorldSettings()
|
|||
//one second is 1000 -(tested on win system)
|
||||
mail_timer = uint32((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
|
||||
//1440
|
||||
mail_timer_expires = (DAY * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval();
|
||||
mail_timer_expires = uint32( (DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
||||
DEBUG_LOG("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
|
||||
|
||||
///- Initialize static helper structures
|
||||
|
|
@ -1385,7 +1385,12 @@ void World::Update(uint32 diff)
|
|||
{
|
||||
///- Update the different timers
|
||||
for(int i = 0; i < WUPDATE_COUNT; ++i)
|
||||
{
|
||||
if (m_timers[i].GetCurrent()>=0)
|
||||
m_timers[i].Update(diff);
|
||||
else
|
||||
m_timers[i].SetCurrent(0);
|
||||
}
|
||||
|
||||
///- Update the game time and check for shutdown time
|
||||
_UpdateGameTime();
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ class World
|
|||
|
||||
time_t m_startTime;
|
||||
time_t m_gameTime;
|
||||
ShortIntervalTimer m_timers[WUPDATE_COUNT];
|
||||
IntervalTimer m_timers[WUPDATE_COUNT];
|
||||
uint32 mail_timer;
|
||||
uint32 mail_timer_expires;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10717"
|
||||
#define REVISION_NR "10718"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue