Refresh Lobby Info Box (#7521)
This commit is contained in:
@@ -38,6 +38,7 @@ namespace Content.Server.GameTicking.Commands
|
|||||||
|
|
||||||
ticker.SetGamePreset(type, true);
|
ticker.SetGamePreset(type, true);
|
||||||
shell.WriteLine($"Forced the game to start with preset {name}.");
|
shell.WriteLine($"Forced the game to start with preset {name}.");
|
||||||
|
ticker.UpdateInfoText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Server.GameTicking
|
|||||||
public IReadOnlyDictionary<IPlayerSession, LobbyPlayerStatus> PlayersInLobby => _playersInLobby;
|
public IReadOnlyDictionary<IPlayerSession, LobbyPlayerStatus> PlayersInLobby => _playersInLobby;
|
||||||
public IReadOnlySet<NetUserId> PlayersInGame => _playersInGame;
|
public IReadOnlySet<NetUserId> PlayersInGame => _playersInGame;
|
||||||
|
|
||||||
private void UpdateInfoText()
|
public void UpdateInfoText()
|
||||||
{
|
{
|
||||||
RaiseNetworkEvent(GetInfoMsg(), Filter.Empty().AddPlayers(_playersInLobby.Keys));
|
RaiseNetworkEvent(GetInfoMsg(), Filter.Empty().AddPlayers(_playersInLobby.Keys));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ namespace Content.Server.GameTicking
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//When the status of a player changes, update the server info text
|
||||||
|
UpdateInfoText();
|
||||||
|
|
||||||
async void SpawnWaitPrefs()
|
async void SpawnWaitPrefs()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ public sealed class GameMapManager : IGameMapManager
|
|||||||
|
|
||||||
_currentMap = map;
|
_currentMap = map;
|
||||||
_currentMapForced = false;
|
_currentMapForced = false;
|
||||||
|
var ticker = EntitySystem.Get<GameTicking.GameTicker>();
|
||||||
|
ticker.UpdateInfoText();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -97,6 +99,8 @@ public sealed class GameMapManager : IGameMapManager
|
|||||||
throw new ArgumentException($"The map \"{gameMap}\" is invalid!");
|
throw new ArgumentException($"The map \"{gameMap}\" is invalid!");
|
||||||
_currentMap = map;
|
_currentMap = map;
|
||||||
_currentMapForced = true;
|
_currentMapForced = true;
|
||||||
|
var ticker = EntitySystem.Get<GameTicking.GameTicker>();
|
||||||
|
ticker.UpdateInfoText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SelectRandomMap()
|
public void SelectRandomMap()
|
||||||
@@ -104,6 +108,8 @@ public sealed class GameMapManager : IGameMapManager
|
|||||||
var maps = CurrentlyEligibleMaps().ToList();
|
var maps = CurrentlyEligibleMaps().ToList();
|
||||||
_currentMap = _random.Pick(maps);
|
_currentMap = _random.Pick(maps);
|
||||||
_currentMapForced = false;
|
_currentMapForced = false;
|
||||||
|
var ticker = EntitySystem.Get<GameTicking.GameTicker>();
|
||||||
|
ticker.UpdateInfoText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameMapPrototype GetSelectedMap()
|
public GameMapPrototype GetSelectedMap()
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ namespace Content.Server.Voting.Managers
|
|||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException(nameof(voteType), voteType, null);
|
throw new ArgumentOutOfRangeException(nameof(voteType), voteType, null);
|
||||||
}
|
}
|
||||||
|
var ticker = EntitySystem.Get<GameTicker>();
|
||||||
|
ticker.UpdateInfoText();
|
||||||
TimeoutStandardVote(voteType);
|
TimeoutStandardVote(voteType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user