Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.

Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton.
2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs.

--HG--
branch : trunk
This commit is contained in:
n0n4m3 committed 2009-12-23 08:04:10 +01:00
1 parent 7ea2510980
commit 3fe0bc5254
51 files changed
+352 -364

No files matched your search

+5 -5
View File
@@ -42,7 +42,7 @@
#include "GlobalEvents.h"
#include "OutdoorPvPWG.h"
#include "OutdoorPvPMgr.h"
#include "TimeMgr.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureGroups.h"
@@ -79,7 +79,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(HasLowerSecurity (target,target_guid,true))
return false;
time_t mutetime = time(NULL) + notspeaktime*60;
time_t mutetime = sGameTime.GetGameTime() + notspeaktime*60;
if (target)
target->GetSession()->m_muteTime = mutetime;
@@ -536,7 +536,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
if(target)
{
int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
int32 curRespawnDelay = target->GetRespawnTimeEx()-sGameTime.GetGameTime();
if(curRespawnDelay < 0)
curRespawnDelay = 0;
@@ -3502,8 +3502,8 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
std::string endTimeStr = TimeToTimestampStr(eventData.end);
uint32 delay = gameeventmgr.NextCheck(event_id);
time_t nextTime = time(NULL)+delay;
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-";
time_t nextTime = sGameTime.GetGameTime()+delay;
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(sGameTime.GetGameTime()+delay) : "-";
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);