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
@@ -21,6 +21,7 @@ using Game.Achievements;
using Game.Entities;
using Game.Networking;
using Game.Networking.Packets;
using System;
using System.Collections.Generic;
namespace Game
@@ -240,7 +241,7 @@ namespace Game
return _completedObjectives.Contains(questObjective.Id);
}
public override void SendCriteriaUpdate(Criteria criteria, CriteriaProgress progress, uint timeElapsed, bool timedCompleted)
public override void SendCriteriaUpdate(Criteria criteria, CriteriaProgress progress, TimeSpan timeElapsed, bool timedCompleted)
{
CriteriaUpdate criteriaUpdate = new();
@@ -252,7 +253,7 @@ namespace Game
criteriaUpdate.Flags = timedCompleted ? 1 : 0u; // 1 is for keeping the counter at 0 in client
criteriaUpdate.CurrentTime = progress.Date;
criteriaUpdate.ElapsedTime = timeElapsed;
criteriaUpdate.ElapsedTime = (uint)timeElapsed.TotalSeconds;
criteriaUpdate.CreationTime = 0;
SendPacket(criteriaUpdate);