mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Battleground): rework bg queue system (#10817)
This commit is contained in:
@@ -170,7 +170,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
|
||||
if (uint32 inviteInstanceId = _player->GetPendingSpectatorInviteInstanceId())
|
||||
{
|
||||
if (Battleground* tbg = sBattlegroundMgr->GetBattleground(inviteInstanceId))
|
||||
if (Battleground* tbg = sBattlegroundMgr->GetBattleground(inviteInstanceId, BATTLEGROUND_TYPE_NONE))
|
||||
tbg->RemoveToBeTeleported(_player->GetGUID());
|
||||
_player->SetPendingSpectatorInviteInstanceId(0);
|
||||
}
|
||||
@@ -904,14 +904,14 @@ void WorldSession::ComputeNewClockDelta()
|
||||
std::vector<uint32> latencies;
|
||||
std::vector<int64> clockDeltasAfterFiltering;
|
||||
|
||||
for (auto pair : _timeSyncClockDeltaQueue.content())
|
||||
for (auto& pair : _timeSyncClockDeltaQueue.content())
|
||||
latencies.push_back(pair.second);
|
||||
|
||||
uint32 latencyMedian = median(latencies);
|
||||
uint32 latencyStandardDeviation = standard_deviation(latencies);
|
||||
|
||||
uint32 sampleSizeAfterFiltering = 0;
|
||||
for (auto pair : _timeSyncClockDeltaQueue.content())
|
||||
for (auto& pair : _timeSyncClockDeltaQueue.content())
|
||||
{
|
||||
if (pair.second <= latencyMedian + latencyStandardDeviation) {
|
||||
clockDeltasAfterFiltering.push_back(pair.first);
|
||||
|
||||
Reference in New Issue
Block a user