Core/Groups: Use std::chrono type for Group::m_readyCheckTimer

Port From (https://github.com/TrinityCore/TrinityCore/commit/48b63c4c6721fa9a38f74f8fa92255ac0938da42)
This commit is contained in:
hondacrx
2021-04-06 23:42:49 -04:00
parent be2292e815
commit 1aa78d32eb
2 changed files with 9 additions and 8 deletions
+7 -7
View File
@@ -2160,12 +2160,12 @@ namespace Game.Groups
if (!m_readyCheckStarted)
return;
m_readyCheckTimer -= (int)diff;
if (m_readyCheckTimer <= 0)
m_readyCheckTimer -= TimeSpan.FromMilliseconds(diff);
if (m_readyCheckTimer <= TimeSpan.Zero)
EndReadyCheck();
}
public void StartReadyCheck(ObjectGuid starterGuid, sbyte partyIndex, uint duration = MapConst.ReadycheckDuration)
public void StartReadyCheck(ObjectGuid starterGuid, sbyte partyIndex, TimeSpan duration)
{
if (m_readyCheckStarted)
return;
@@ -2175,7 +2175,7 @@ namespace Game.Groups
return;
m_readyCheckStarted = true;
m_readyCheckTimer = (int)duration;
m_readyCheckTimer = duration;
SetOfflineMembersReadyChecked();
@@ -2185,7 +2185,7 @@ namespace Game.Groups
readyCheckStarted.PartyGUID = m_guid;
readyCheckStarted.PartyIndex = partyIndex;
readyCheckStarted.InitiatorGUID = starterGuid;
readyCheckStarted.Duration = duration;
readyCheckStarted.Duration = (uint)duration.TotalMilliseconds;
BroadcastPacket(readyCheckStarted, false);
}
@@ -2195,7 +2195,7 @@ namespace Game.Groups
return;
m_readyCheckStarted = false;
m_readyCheckTimer = 0;
m_readyCheckTimer = TimeSpan.Zero;
ResetMemberReadyChecked();
@@ -2623,7 +2623,7 @@ namespace Game.Groups
// Ready Check
bool m_readyCheckStarted;
int m_readyCheckTimer;
TimeSpan m_readyCheckTimer;
// Raid markers
RaidMarker[] m_markers = new RaidMarker[MapConst.RaidMarkersCount];
+2 -1
View File
@@ -20,6 +20,7 @@ using Game.Entities;
using Game.Groups;
using Game.Networking;
using Game.Networking.Packets;
using System;
namespace Game
{
@@ -569,7 +570,7 @@ namespace Game
return;
// everything's fine, do it
group.StartReadyCheck(GetPlayer().GetGUID(), packet.PartyIndex);
group.StartReadyCheck(GetPlayer().GetGUID(), packet.PartyIndex, TimeSpan.FromMilliseconds(MapConst.ReadycheckDuration));
}
[WorldPacketHandler(ClientOpcodes.ReadyCheckResponse, Processing = PacketProcessing.Inplace)]