diff options
| author | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
| commit | 3fe0bc52541d8cdf4fa992d9b8b3101cde5848f0 (patch) | |
| tree | be5871dc19f69f4555d9ffa7c57e5d964b8e60e0 /src/game/Level3.cpp | |
| parent | 7ea2510980d4b1c96f0341e9c8b9d5784862dc72 (diff) | |
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
Diffstat (limited to 'src/game/Level3.cpp')
| -rw-r--r-- | src/game/Level3.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 540bd0d8586..854ccc7e67a 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -55,6 +55,7 @@ #include "AuctionHouseBot.h" #include "CreatureEventAIMgr.h" #include "DBCEnums.h" +#include "TimeMgr.h" bool ChatHandler::HandleAHBotOptionsCommand(const char *args) { @@ -4614,7 +4615,7 @@ bool ChatHandler::HandleNpcInfoCommand(const char* /*args*/) uint32 Entry = target->GetEntry(); CreatureInfo const* cInfo = target->GetCreatureInfo(); - int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL); + int32 curRespawnDelay = target->GetRespawnTimeEx()-sGameTime.GetGameTime(); if(curRespawnDelay < 0) curRespawnDelay = 0; std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay,true); @@ -5974,7 +5975,7 @@ bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname) time_t unbandate = time_t(fields[3].GetUInt64()); bool active = false; - if(fields[2].GetBool() && (fields[1].GetUInt64() == (uint64)0 ||unbandate >= time(NULL)) ) + if(fields[2].GetBool() && (fields[1].GetUInt64() == (uint64)0 ||unbandate >= sGameTime.GetGameTime()) ) active = true; bool permanent = (fields[1].GetUInt64() == (uint64)0); std::string bantime = permanent?GetTrinityString(LANG_BANINFO_INFINITE):secsToTimeString(fields[1].GetUInt64(), true); @@ -6824,7 +6825,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) { InstanceSave *save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime()); PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } @@ -6840,7 +6841,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/) for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr) { InstanceSave *save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime()); PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } } @@ -6869,7 +6870,7 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args) if(itr->first != player->GetMapId()) { InstanceSave *save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL)); + std::string timeleft = GetTimeString(save->GetResetTime() - sGameTime.GetGameTime()); PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str()); player->UnbindInstance(itr, Difficulty(i)); counter++; |
