mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +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:
@@ -8,7 +8,6 @@
|
||||
#include "BattlefieldMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "Map.h"
|
||||
#include "MapManager.h"
|
||||
#include "Group.h"
|
||||
@@ -78,7 +77,7 @@ void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/)
|
||||
else // No more vacant places
|
||||
{
|
||||
// TODO: Send a packet to announce it to player
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + (player->IsGameMaster() ? 30*MINUTE : 10);
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + (player->IsGameMaster() ? 30*MINUTE : 10);
|
||||
InvitePlayerToQueue(player);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +167,7 @@ bool Battlefield::Update(uint32 diff)
|
||||
// Kick players who chose not to accept invitation to the battle
|
||||
if (m_uiKickDontAcceptTimer <= diff)
|
||||
{
|
||||
time_t now = GameTime::GetGameTime();
|
||||
time_t now = time(NULL);
|
||||
for (int team = 0; team < 2; team++)
|
||||
for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); ++itr)
|
||||
if (itr->second <= now)
|
||||
@@ -254,7 +253,7 @@ void Battlefield::InvitePlayersInZoneToWar()
|
||||
if (m_PlayersInWar[player->GetTeamId()].size() + m_InvitedPlayers[player->GetTeamId()].size() < m_MaxPlayer)
|
||||
InvitePlayerToWar(player);
|
||||
else if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)// Battlefield is full of players
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + 10;
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,7 +277,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
||||
if (player->getLevel() < m_MinLevel)
|
||||
{
|
||||
if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + 10;
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -287,7 +286,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
||||
return;
|
||||
|
||||
m_PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID());
|
||||
m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + m_TimeForAcceptInvite;
|
||||
m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = time(NULL) + m_TimeForAcceptInvite;
|
||||
player->GetSession()->SendBfInvitePlayerToWar(m_BattleId, m_ZoneId, m_TimeForAcceptInvite);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user