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
2009-12-23 08:04:10 +01:00
parent 7ea2510980
commit 3fe0bc5254
51 changed files with 352 additions and 364 deletions

View File

@@ -39,6 +39,7 @@
#include "ScriptCalls.h"
#include "SpellAuras.h"
#include "Util.h"
#include "TimeMgr.h"
bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)
{
@@ -166,7 +167,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if (!_player->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
std::string timeStr = secsToTimeString(m_muteTime - sGameTime.GetGameTime());
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
return;
}
@@ -627,7 +628,7 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
if (!GetPlayer()->CanSpeak())
{
std::string timeStr = secsToTimeString(m_muteTime - time(NULL));
std::string timeStr = secsToTimeString(m_muteTime - sGameTime.GetGameTime());
SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str());
return;
}