diff --git a/Content.IntegrationTests/DummyGameTicker.cs b/Content.IntegrationTests/DummyGameTicker.cs index 09f669139e..7ce49d81b3 100644 --- a/Content.IntegrationTests/DummyGameTicker.cs +++ b/Content.IntegrationTests/DummyGameTicker.cs @@ -58,6 +58,10 @@ namespace Content.IntegrationTests { } + public void ToggleDisallowLateJoin(bool disallowLateJoin) + { + } + public EntityCoordinates GetLateJoinSpawnPoint() => EntityCoordinates.Invalid; public EntityCoordinates GetJobSpawnPoint(string jobId) => EntityCoordinates.Invalid; public EntityCoordinates GetObserverSpawnPoint() => EntityCoordinates.Invalid; diff --git a/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs b/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs index 4569668edc..e5538d9f54 100644 --- a/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs +++ b/Content.Server/GameTicking/GamePresets/PresetSuspicion.cs @@ -159,7 +159,6 @@ namespace Content.Server.GameTicking.GamePresets return true; } - public override string ModeTitle => "Suspicion"; public override string Description => "Suspicion on the Space Station. There are traitors on board... Can you kill them before they kill you?"; } diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 82cb34bbbc..5321719632 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -411,6 +411,12 @@ namespace Content.Server.GameTicking _netManager.ServerSendToAll(GetStatusSingle(player, status)); } + public void ToggleDisallowLateJoin(bool disallowLateJoin) + { + DisallowLateJoin = disallowLateJoin; + UpdateLateJoinStatus(); + } + public T AddGameRule() where T : GameRule, new() { var instance = _dynamicTypeFactory.CreateInstance(); diff --git a/Content.Server/GameTicking/GameTickerCommands.cs b/Content.Server/GameTicking/GameTickerCommands.cs index 6ebda18401..7210653321 100644 --- a/Content.Server/GameTicking/GameTickerCommands.cs +++ b/Content.Server/GameTicking/GameTickerCommands.cs @@ -244,6 +244,26 @@ namespace Content.Server.GameTicking } } + class ToggleDisallowLateJoinCommand: IClientCommand + { + public string Command => "toggledisallowlatejoin"; + public string Description => "Allows or disallows latejoining during mid-game."; + public string Help => $"Usage: {Command} "; + + public void Execute(IConsoleShell shell, IPlayerSession player, string[] args) + { + if (args.Length != 1) + { + shell.SendText(player, "Need exactly one argument."); + return; + } + + var ticker = IoCManager.Resolve(); + + ticker.ToggleDisallowLateJoin(bool.Parse(args[0])); + } + } + class SetGamePresetCommand : IClientCommand { public string Command => "setgamepreset"; diff --git a/Content.Server/Interfaces/GameTicking/IGameTicker.cs b/Content.Server/Interfaces/GameTicking/IGameTicker.cs index 379ad83828..36d9fcac7a 100644 --- a/Content.Server/Interfaces/GameTicking/IGameTicker.cs +++ b/Content.Server/Interfaces/GameTicking/IGameTicker.cs @@ -30,6 +30,7 @@ namespace Content.Server.Interfaces.GameTicking void MakeObserve(IPlayerSession player); void MakeJoinGame(IPlayerSession player, string jobId); void ToggleReady(IPlayerSession player, bool ready); + void ToggleDisallowLateJoin(bool disallowLateJoin); EntityCoordinates GetLateJoinSpawnPoint(); EntityCoordinates GetJobSpawnPoint(string jobId);