diff --git a/Content.Client/GameTicking/Managers/ClientGameTicker.cs b/Content.Client/GameTicking/Managers/ClientGameTicker.cs index 1d44430c91..a62ebab1b7 100644 --- a/Content.Client/GameTicking/Managers/ClientGameTicker.cs +++ b/Content.Client/GameTicking/Managers/ClientGameTicker.cs @@ -57,6 +57,7 @@ namespace Content.Client.GameTicking.Managers SubscribeNetworkEvent(JoinLobby); SubscribeNetworkEvent(JoinGame); + SubscribeNetworkEvent(ConnectionStatus); SubscribeNetworkEvent(LobbyStatus); SubscribeNetworkEvent(LobbyInfo); SubscribeNetworkEvent(LobbyCountdown); @@ -110,6 +111,11 @@ namespace Content.Client.GameTicking.Managers _stateManager.RequestStateChange(); } + private void ConnectionStatus(TickerConnectionStatusEvent message) + { + RoundStartTimeSpan = message.RoundStartTimeSpan; + } + private void LobbyStatus(TickerLobbyStatusEvent message) { StartTime = message.StartTime; diff --git a/Content.Server/GameTicking/GameTicker.Lobby.cs b/Content.Server/GameTicking/GameTicker.Lobby.cs index b31472ffa4..cbccda73fc 100644 --- a/Content.Server/GameTicking/GameTicker.Lobby.cs +++ b/Content.Server/GameTicking/GameTicker.Lobby.cs @@ -86,10 +86,15 @@ namespace Content.Server.GameTicking ("desc", desc)); } + private TickerConnectionStatusEvent GetConnectionStatusMsg() + { + return new TickerConnectionStatusEvent(RoundStartTimeSpan); + } + private TickerLobbyStatusEvent GetStatusMsg(ICommonSession session) { _playerGameStatuses.TryGetValue(session.UserId, out var status); - return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground,status == PlayerGameStatus.ReadyToPlay, _roundStartTime, RoundPreloadTime, RoundStartTimeSpan, Paused); + return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground, status == PlayerGameStatus.ReadyToPlay, _roundStartTime, RoundPreloadTime, RoundStartTimeSpan, Paused); } private void SendStatusToAll() diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index 5fccee1d11..ec1f0e368a 100644 --- a/Content.Server/GameTicking/GameTicker.Player.cs +++ b/Content.Server/GameTicking/GameTicker.Player.cs @@ -66,6 +66,8 @@ namespace Content.Server.GameTicking ? Loc.GetString("player-first-join-message", ("name", args.Session.Name)) : Loc.GetString("player-join-message", ("name", args.Session.Name))); + RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel); + if (LobbyEnabled && _roundStartCountdownHasNotStartedYetDueToNoPlayers) { _roundStartCountdownHasNotStartedYetDueToNoPlayers = false; diff --git a/Content.Shared/GameTicking/SharedGameTicker.cs b/Content.Shared/GameTicking/SharedGameTicker.cs index d8ce4585a7..dac33fe5a7 100644 --- a/Content.Shared/GameTicking/SharedGameTicker.cs +++ b/Content.Shared/GameTicking/SharedGameTicker.cs @@ -63,6 +63,15 @@ namespace Content.Shared.GameTicking } } + [Serializable, NetSerializable] + public sealed class TickerConnectionStatusEvent : EntityEventArgs + { + public TimeSpan RoundStartTimeSpan { get; } + public TickerConnectionStatusEvent(TimeSpan roundStartTimeSpan) + { + RoundStartTimeSpan = roundStartTimeSpan; + } + } [Serializable, NetSerializable] public sealed class TickerLobbyStatusEvent : EntityEventArgs