Core/PacketIO: Handle QueryCountdownTimer

* Add it to battleground
* Base implementation countdowns in Group
* Fix timer sync between groups in battlegrounds
Port From (https://github.com/TrinityCore/TrinityCore/commit/6ed8b5c9077aba788ff5bc51f2652109bfea6175)
This commit is contained in:
hondacrx
2024-02-06 15:51:24 -05:00
parent 95c3dd2a66
commit 43db82ae61
6 changed files with 109 additions and 50 deletions
+20 -1
View File
@@ -464,7 +464,26 @@ namespace Game
splashScreenShowLatest.UISplashScreenID = splashScreen != null ? splashScreen.Id : 0;
SendPacket(splashScreenShowLatest);
}
[WorldPacketHandler(ClientOpcodes.QueryCountdownTimer, Processing = PacketProcessing.Inplace)]
void HandleQueryCountdownTimer(QueryCountdownTimer queryCountdownTimer)
{
Group group = _player.GetGroup();
if (group == null)
return;
CountdownInfo info = group.GetCountdownInfo(queryCountdownTimer.TimerType);
if (info == null)
return;
StartTimer startTimer = new();
startTimer.Type = queryCountdownTimer.TimerType;
startTimer.TimeLeft = info.GetTimeLeft();
startTimer.TotalTime = info.GetTotalTime();
_player.SendPacket(startTimer);
}
[WorldPacketHandler(ClientOpcodes.ChatUnregisterAllAddonPrefixes)]
void HandleUnregisterAllAddonPrefixes(ChatUnregisterAllAddonPrefixes packet)
{