SubscribeNetworkEvent<TickerJoinLobbyEvent>(JoinLobby);
SubscribeNetworkEvent<TickerJoinGameEvent>(JoinGame);
+ SubscribeNetworkEvent<TickerConnectionStatusEvent>(ConnectionStatus);
SubscribeNetworkEvent<TickerLobbyStatusEvent>(LobbyStatus);
SubscribeNetworkEvent<TickerLobbyInfoEvent>(LobbyInfo);
SubscribeNetworkEvent<TickerLobbyCountdownEvent>(LobbyCountdown);
_stateManager.RequestStateChange<LobbyState>();
}
+ private void ConnectionStatus(TickerConnectionStatusEvent message)
+ {
+ RoundStartTimeSpan = message.RoundStartTimeSpan;
+ }
+
private void LobbyStatus(TickerLobbyStatusEvent message)
{
StartTime = message.StartTime;
("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()
? 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;
}
}
+ [Serializable, NetSerializable]
+ public sealed class TickerConnectionStatusEvent : EntityEventArgs
+ {
+ public TimeSpan RoundStartTimeSpan { get; }
+ public TickerConnectionStatusEvent(TimeSpan roundStartTimeSpan)
+ {
+ RoundStartTimeSpan = roundStartTimeSpan;
+ }
+ }
[Serializable, NetSerializable]
public sealed class TickerLobbyStatusEvent : EntityEventArgs