mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
Revert "feat(core): Ensure that all actions are compared to fixed point in time (#1236) (#1458)" (#1471)
This reverts commit 51b8773528.
This commit is contained in:
@@ -17,7 +17,6 @@ EndScriptData */
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
class ban_commandscript : public CommandScript
|
||||
@@ -246,7 +245,7 @@ public:
|
||||
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= GameTime::GetGameTime()))
|
||||
if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt64() == uint64(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
@@ -294,7 +293,7 @@ public:
|
||||
Field* fields = result->Fetch();
|
||||
time_t unbanDate = time_t(fields[3].GetUInt32());
|
||||
bool active = false;
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= GameTime::GetGameTime()))
|
||||
if (fields[2].GetUInt8() && (!fields[1].GetUInt32() || unbanDate >= time(nullptr)))
|
||||
active = true;
|
||||
bool permanent = (fields[1].GetUInt32() == uint32(0));
|
||||
std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true);
|
||||
|
||||
@@ -15,7 +15,6 @@ EndScriptData */
|
||||
#include "GameEventMgr.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
class event_commandscript : public CommandScript
|
||||
@@ -105,8 +104,8 @@ public:
|
||||
std::string endTimeStr = TimeToTimestampStr(eventData.end);
|
||||
|
||||
uint32 delay = sGameEventMgr->NextCheck(eventId);
|
||||
time_t nextTime = GameTime::GetGameTime() + delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(GameTime::GetGameTime() + delay) : "-";
|
||||
time_t nextTime = time(nullptr) + delay;
|
||||
std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(nullptr) + delay) : "-";
|
||||
|
||||
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE, true);
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true);
|
||||
|
||||
@@ -19,7 +19,6 @@ EndScriptData */
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Transport.h"
|
||||
#include "GameObject.h"
|
||||
@@ -311,7 +310,7 @@ public:
|
||||
|
||||
if (target)
|
||||
{
|
||||
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - GameTime::GetGameTime());
|
||||
int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(nullptr));
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ EndScriptData */
|
||||
#include "InstanceScript.h"
|
||||
#include "MapManager.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "Language.h"
|
||||
|
||||
class instance_commandscript : public CommandScript
|
||||
@@ -72,7 +71,7 @@ public:
|
||||
{
|
||||
InstanceSave* save = itr->second.save;
|
||||
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
|
||||
uint32 ttr = (resetTime >= GameTime::GetGameTime() ? resetTime - GameTime::GetGameTime() : 0);
|
||||
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
|
||||
std::string timeleft = GetTimeString(ttr);
|
||||
handler->PSendSysMessage("map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
|
||||
counter++;
|
||||
@@ -116,7 +115,7 @@ public:
|
||||
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
|
||||
{
|
||||
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
|
||||
uint32 ttr = (resetTime >= GameTime::GetGameTime() ? resetTime - GameTime::GetGameTime() : 0);
|
||||
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
|
||||
std::string timeleft = GetTimeString(ttr);
|
||||
handler->PSendSysMessage("unbinding map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
|
||||
sInstanceSaveMgr->PlayerUnbindInstance(player->GetGUIDLow(), itr->first, Difficulty(i), true, player);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "WeatherMgr.h"
|
||||
#include "ace/INET_Addr.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "Pet.h"
|
||||
#include "LFG.h"
|
||||
#include "GroupMgr.h"
|
||||
@@ -1998,11 +1997,11 @@ public:
|
||||
|
||||
// Output III. LANG_PINFO_BANNED if ban exists and is applied
|
||||
if (banTime >= 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime(), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(nullptr), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str());
|
||||
|
||||
// Output IV. LANG_PINFO_MUTED if mute is applied
|
||||
if (muteTime > 0)
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - GameTime::GetGameTime(), true).c_str(), muteBy.c_str());
|
||||
handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - time(nullptr), true).c_str(), muteBy.c_str());
|
||||
|
||||
// Output V. LANG_PINFO_ACC_ACCOUNT
|
||||
handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName.c_str(), accId, security);
|
||||
@@ -2241,7 +2240,7 @@ public:
|
||||
if (target)
|
||||
{
|
||||
// Target is online, mute will be in effect right away.
|
||||
int64 muteTime = GameTime::GetGameTime() + notSpeakTime * MINUTE;
|
||||
int64 muteTime = time(nullptr) + notSpeakTime * MINUTE;
|
||||
target->GetSession()->m_muteTime = muteTime;
|
||||
stmt->setInt64(0, muteTime);
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str());
|
||||
|
||||
@@ -20,7 +20,6 @@ EndScriptData */
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
#include "CreatureAI.h"
|
||||
#include "Player.h"
|
||||
#include "GameTime.h"
|
||||
#include "Pet.h"
|
||||
|
||||
struct NpcFlagText
|
||||
@@ -720,7 +719,7 @@ public:
|
||||
uint32 nativeid = target->GetNativeDisplayId();
|
||||
uint32 Entry = target->GetEntry();
|
||||
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-GameTime::GetGameTime();
|
||||
int64 curRespawnDelay = target->GetRespawnTimeEx()-time(nullptr);
|
||||
if (curRespawnDelay < 0)
|
||||
curRespawnDelay = 0;
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
|
||||
@@ -15,8 +15,6 @@ EndScriptData */
|
||||
#include "Config.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "GameTime.h"
|
||||
#include "UpdateTime.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GitRevision.h"
|
||||
@@ -98,8 +96,8 @@ public:
|
||||
uint32 activeSessionCount = sWorld->GetActiveSessionCount();
|
||||
uint32 queuedSessionCount = sWorld->GetQueuedSessionCount();
|
||||
uint32 connPeak = sWorld->GetMaxActiveSessionCount();
|
||||
std::string uptime = secsToTimeString(GameTime::GetUptime());
|
||||
uint32 updateTime = sWorldUpdateTime.GetLastUpdateTime();
|
||||
std::string uptime = secsToTimeString(sWorld->GetUptime()).append(".");
|
||||
uint32 updateTime = sWorld->GetUpdateTime();
|
||||
uint32 avgUpdateTime = avgDiffTracker.getAverage();
|
||||
|
||||
handler->PSendSysMessage("%s", GitRevision::GetFullVersion());
|
||||
@@ -357,7 +355,7 @@ public:
|
||||
if (newTime < 0)
|
||||
return false;
|
||||
|
||||
sWorldUpdateTime.SetRecordUpdateTimeInterval(newTime);
|
||||
sWorld->SetRecordDiffInterval(newTime);
|
||||
printf("Record diff every %u ms\n", newTime);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user