Core/Criteria: Use std::chrono type for CriteriaHandler::SendCriteriaUpdate

Port From (https://github.com/TrinityCore/TrinityCore/commit/33bce9e28b28f018dc43a31ed37790fa1fc81f88)
This commit is contained in:
hondacrx
2021-04-12 12:30:51 -04:00
parent b35aa78c2e
commit d62ca82d30
4 changed files with 15 additions and 13 deletions
+3 -2
View File
@@ -21,6 +21,7 @@ using Game.DataStorage;
using Game.Entities;
using Game.Networking;
using Game.Networking.Packets;
using System;
using System.Collections.Generic;
namespace Game.Scenarios
@@ -153,7 +154,7 @@ namespace Game.Scenarios
return _stepStates[step];
}
public override void SendCriteriaUpdate(Criteria criteria, CriteriaProgress progress, uint timeElapsed, bool timedCompleted)
public override void SendCriteriaUpdate(Criteria criteria, CriteriaProgress progress, TimeSpan timeElapsed, bool timedCompleted)
{
ScenarioProgressUpdate progressUpdate = new();
progressUpdate.CriteriaProgress.Id = criteria.Id;
@@ -163,7 +164,7 @@ namespace Game.Scenarios
if (criteria.Entry.StartTimer != 0)
progressUpdate.CriteriaProgress.Flags = timedCompleted ? 1 : 0u;
progressUpdate.CriteriaProgress.TimeFromStart = timeElapsed;
progressUpdate.CriteriaProgress.TimeFromStart = (uint)timeElapsed.TotalSeconds;
progressUpdate.CriteriaProgress.TimeFromCreate = 0;
SendPacket(progressUpdate);