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:
Nefertumm
2019-02-15 15:14:49 -03:00
committed by GitHub
parent 23e7ae6a2f
commit c15206fc15
108 changed files with 509 additions and 933 deletions

View File

@@ -8,7 +8,6 @@
#include "Config.h"
#include "ByteBuffer.h"
#include "WorldPacket.h"
#include "GameTime.h"
PacketLog::PacketLog() : _file(NULL)
{
@@ -41,7 +40,7 @@ void PacketLog::LogPacket(WorldPacket const& packet, Direction direction)
ByteBuffer data(4+4+4+1+packet.size());
data << int32(packet.GetOpcode());
data << int32(packet.size());
data << uint32(GameTime::GetGameTime());
data << uint32(time(NULL));
data << uint8(direction);
for (uint32 i = 0; i < packet.size(); i++)

View File

@@ -22,7 +22,6 @@
#include "GuildMgr.h"
#include "Group.h"
#include "Guild.h"
#include "GameTime.h"
#include "World.h"
#include "ObjectAccessor.h"
#include "BattlegroundMgr.h"
@@ -198,13 +197,13 @@ void WorldSession::SendPacket(WorldPacket const* packet)
static uint64 sendPacketCount = 0;
static uint64 sendPacketBytes = 0;
static time_t firstTime = GameTime::GetGameTime();
static time_t firstTime = time(NULL);
static time_t lastTime = firstTime; // next 60 secs start time
static uint64 sendLastPacketCount = 0;
static uint64 sendLastPacketBytes = 0;
time_t cur_time = GameTime::GetGameTime();
time_t cur_time = time(NULL);
if ((cur_time - lastTime) < 60)
{
@@ -390,7 +389,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater)
if (updater.ProcessLogout())
{
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
if (ShouldLogOut(currTime) && !m_playerLoading)
LogoutPlayer(true);
@@ -427,7 +426,7 @@ void WorldSession::HandleTeleportTimeout(bool updateInSessions)
// pussywizard: handle teleport ack timeout
if (m_Socket && !m_Socket->IsClosed() && GetPlayer() && GetPlayer()->IsBeingTeleported())
{
time_t currTime = GameTime::GetGameTime();
time_t currTime = time(NULL);
if (updateInSessions) // session update from World::UpdateSessions
{
if (GetPlayer()->IsBeingTeleportedFar() && GetPlayer()->GetSemaphoreTeleportFar()+sWorld->getIntConfig(CONFIG_TELEPORT_TIMEOUT_FAR) < currTime)
@@ -770,7 +769,7 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string c
void WorldSession::SendAccountDataTimes(uint32 mask)
{
WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + 8 * 4); // changed in WotLK
data << uint32(GameTime::GetGameTime()); // unix time of something
data << uint32(time(NULL)); // unix time of something
data << uint8(1);
data << uint32(mask); // type mask
for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i)

View File

@@ -25,7 +25,6 @@
#include "ByteBuffer.h"
#include "Opcodes.h"
#include "DatabaseEnv.h"
#include "GameTime.h"
#include "BigNumber.h"
#include "SHA1.h"
#include "WorldSession.h"
@@ -840,7 +839,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket)
//! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now.
if (mutetime < 0)
{
mutetime = GameTime::GetGameTime() + llabs(mutetime);
mutetime = time(NULL) + llabs(mutetime);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME_LOGIN);