Remove TickerLobbyReadyEvent (#17522)
This commit is contained in:
@@ -49,7 +49,6 @@ namespace Content.Client.GameTicking.Managers
|
|||||||
|
|
||||||
public event Action? InfoBlobUpdated;
|
public event Action? InfoBlobUpdated;
|
||||||
public event Action? LobbyStatusUpdated;
|
public event Action? LobbyStatusUpdated;
|
||||||
public event Action? LobbyReadyUpdated;
|
|
||||||
public event Action? LobbyLateJoinStatusUpdated;
|
public event Action? LobbyLateJoinStatusUpdated;
|
||||||
public event Action<IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>>>? LobbyJobsAvailableUpdated;
|
public event Action<IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>>>? LobbyJobsAvailableUpdated;
|
||||||
|
|
||||||
@@ -62,7 +61,6 @@ namespace Content.Client.GameTicking.Managers
|
|||||||
SubscribeNetworkEvent<TickerLobbyStatusEvent>(LobbyStatus);
|
SubscribeNetworkEvent<TickerLobbyStatusEvent>(LobbyStatus);
|
||||||
SubscribeNetworkEvent<TickerLobbyInfoEvent>(LobbyInfo);
|
SubscribeNetworkEvent<TickerLobbyInfoEvent>(LobbyInfo);
|
||||||
SubscribeNetworkEvent<TickerLobbyCountdownEvent>(LobbyCountdown);
|
SubscribeNetworkEvent<TickerLobbyCountdownEvent>(LobbyCountdown);
|
||||||
SubscribeNetworkEvent<TickerLobbyReadyEvent>(LobbyReady);
|
|
||||||
SubscribeNetworkEvent<RoundEndMessageEvent>(RoundEnd);
|
SubscribeNetworkEvent<RoundEndMessageEvent>(RoundEnd);
|
||||||
SubscribeNetworkEvent<RequestWindowAttentionEvent>(msg =>
|
SubscribeNetworkEvent<RequestWindowAttentionEvent>(msg =>
|
||||||
{
|
{
|
||||||
@@ -124,11 +122,6 @@ namespace Content.Client.GameTicking.Managers
|
|||||||
Paused = message.Paused;
|
Paused = message.Paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LobbyReady(TickerLobbyReadyEvent message)
|
|
||||||
{
|
|
||||||
LobbyReadyUpdated?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RoundEnd(RoundEndMessageEvent message)
|
private void RoundEnd(RoundEndMessageEvent message)
|
||||||
{
|
{
|
||||||
if (message.LobbySong != null)
|
if (message.LobbySong != null)
|
||||||
|
|||||||
@@ -78,22 +78,6 @@ namespace Content.Server.GameTicking
|
|||||||
("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
|
("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TickerLobbyReadyEvent GetStatusSingle(ICommonSession player, PlayerGameStatus gameStatus)
|
|
||||||
{
|
|
||||||
return new (new Dictionary<NetUserId, PlayerGameStatus> { { player.UserId, gameStatus } });
|
|
||||||
}
|
|
||||||
|
|
||||||
private TickerLobbyReadyEvent GetPlayerStatus()
|
|
||||||
{
|
|
||||||
var players = new Dictionary<NetUserId, PlayerGameStatus>();
|
|
||||||
foreach (var player in _playerGameStatuses.Keys)
|
|
||||||
{
|
|
||||||
_playerGameStatuses.TryGetValue(player, out var status);
|
|
||||||
players.Add(player, status);
|
|
||||||
}
|
|
||||||
return new TickerLobbyReadyEvent(players);
|
|
||||||
}
|
|
||||||
|
|
||||||
private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
|
private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
|
||||||
{
|
{
|
||||||
_playerGameStatuses.TryGetValue(session.UserId, out var status);
|
_playerGameStatuses.TryGetValue(session.UserId, out var status);
|
||||||
@@ -160,7 +144,6 @@ namespace Content.Server.GameTicking
|
|||||||
if (!_playerManager.TryGetSessionById(playerUserId, out var playerSession))
|
if (!_playerManager.TryGetSessionById(playerUserId, out var playerSession))
|
||||||
continue;
|
continue;
|
||||||
RaiseNetworkEvent(GetStatusMsg(playerSession), playerSession.ConnectedClient);
|
RaiseNetworkEvent(GetStatusMsg(playerSession), playerSession.ConnectedClient);
|
||||||
RaiseNetworkEvent(GetStatusSingle(playerSession, status));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +163,6 @@ namespace Content.Server.GameTicking
|
|||||||
var status = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
var status = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
||||||
_playerGameStatuses[player.UserId] = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
_playerGameStatuses[player.UserId] = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
||||||
RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
|
RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
|
||||||
RaiseNetworkEvent(GetStatusSingle(player, status));
|
|
||||||
// update server info to reflect new ready count
|
// update server info to reflect new ready count
|
||||||
UpdateInfoText();
|
UpdateInfoText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ namespace Content.Server.GameTicking
|
|||||||
RaiseNetworkEvent(new TickerJoinLobbyEvent(), client);
|
RaiseNetworkEvent(new TickerJoinLobbyEvent(), client);
|
||||||
RaiseNetworkEvent(GetStatusMsg(session), client);
|
RaiseNetworkEvent(GetStatusMsg(session), client);
|
||||||
RaiseNetworkEvent(GetInfoMsg(), client);
|
RaiseNetworkEvent(GetInfoMsg(), client);
|
||||||
RaiseNetworkEvent(GetPlayerStatus(), client);
|
|
||||||
RaiseLocalEvent(new PlayerJoinedLobbyEvent(session));
|
RaiseLocalEvent(new PlayerJoinedLobbyEvent(session));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,6 @@ namespace Content.Server.GameTicking
|
|||||||
|
|
||||||
PlayerJoinGame(player);
|
PlayerJoinGame(player);
|
||||||
SpawnObserver(player);
|
SpawnObserver(player);
|
||||||
RaiseNetworkEvent(GetStatusSingle(player, PlayerGameStatus.JoinedGame));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -116,20 +116,6 @@ namespace Content.Shared.GameTicking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
|
||||||
public sealed class TickerLobbyReadyEvent : EntityEventArgs
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The Status of the Player in the lobby (ready, observer, ...)
|
|
||||||
/// </summary>
|
|
||||||
public Dictionary<NetUserId, PlayerGameStatus> Status { get; }
|
|
||||||
|
|
||||||
public TickerLobbyReadyEvent(Dictionary<NetUserId, PlayerGameStatus> status)
|
|
||||||
{
|
|
||||||
Status = status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public sealed class TickerJobsAvailableEvent : EntityEventArgs
|
public sealed class TickerJobsAvailableEvent : EntityEventArgs
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user