feat(Core/Time): Implement saparated manager for game time (#8630)

This commit is contained in:
Kargatum
2022-01-24 17:55:00 +07:00
committed by GitHub
parent 12da792a90
commit 8b7df23f06
129 changed files with 1147 additions and 817 deletions

View File

@@ -17,6 +17,7 @@
#include "BattlegroundSpamProtect.h"
#include "Battleground.h"
#include "GameTime.h"
#include "ObjectGuid.h"
#include "Player.h"
#include "World.h"
@@ -27,7 +28,7 @@ namespace
void AddTime(ObjectGuid guid)
{
_players.insert_or_assign(guid, sWorld->GetGameTime());
_players.insert_or_assign(guid, GameTime::GetGameTime().count());
}
uint32 GetTime(ObjectGuid guid)
@@ -44,7 +45,7 @@ namespace
bool IsCorrectDelay(ObjectGuid guid)
{
// Skip if spam time < 30 secs (default)
return sWorld->GetGameTime() - GetTime(guid) >= sWorld->getIntConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY);
return GameTime::GetGameTime().count() - GetTime(guid) >= sWorld->getIntConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY);
}
}