Request window attention when round starts/restarts.

This commit is contained in:
Pieter-Jan Briers
2020-08-16 23:36:50 +02:00
parent 9dc884fa46
commit d04ad6ec85
5 changed files with 62 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ using Content.Server.Players;
using Content.Shared;
using Content.Shared.Chat;
using Content.Shared.GameObjects.Components.PDA;
using Content.Shared.Network.NetMessages;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Prometheus;
@@ -137,6 +138,7 @@ namespace Content.Server.GameTicking
_netManager.RegisterNetMessage<MsgTickerLobbyInfo>(nameof(MsgTickerLobbyInfo));
_netManager.RegisterNetMessage<MsgTickerLobbyCountdown>(nameof(MsgTickerLobbyCountdown));
_netManager.RegisterNetMessage<MsgRoundEndMessage>(nameof(MsgRoundEndMessage));
_netManager.RegisterNetMessage<MsgRequestWindowAttention>(nameof(MsgRequestWindowAttention));
SetStartPreset(_configurationManager.GetCVar<string>("game.defaultpreset"));
@@ -206,6 +208,16 @@ namespace Content.Server.GameTicking
_roundStartTimeUtc = DateTime.UtcNow + LobbyDuration;
_sendStatusToAll();
ReqWindowAttentionAll();
}
}
private void ReqWindowAttentionAll()
{
foreach (var player in _playerManager.GetAllPlayers())
{
player.RequestWindowAttention();
}
}
@@ -284,6 +296,7 @@ namespace Content.Server.GameTicking
_roundStartTimeSpan = IoCManager.Resolve<IGameTiming>().RealTime;
_sendStatusToAll();
ReqWindowAttentionAll();
}
private void SendServerMessage(string message)
@@ -621,6 +634,7 @@ namespace Content.Server.GameTicking
_playerJoinLobby(player);
}
EntitySystem.Get<GasTileOverlaySystem>().ResettingCleanup();
EntitySystem.Get<PathfindingSystem>().ResettingCleanup();
EntitySystem.Get<AiReachableSystem>().ResettingCleanup();
EntitySystem.Get<WireHackingSystem>().ResetLayouts();