2021-10-09 13:18:20 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using Content.Server.Administration;
|
|
|
|
|
|
using Content.Server.RoundEnd;
|
|
|
|
|
|
using Content.Shared.Administration;
|
|
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameTicking.Commands
|
|
|
|
|
|
{
|
2021-11-29 14:40:10 -06:00
|
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2021-10-09 13:18:20 -05:00
|
|
|
|
public class RestartRoundCommand : IConsoleCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Command => "restartround";
|
|
|
|
|
|
public string Description => "Ends the current round and starts the countdown for the next lobby.";
|
|
|
|
|
|
public string Help => String.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
|
{
|
2021-11-15 18:14:34 +00:00
|
|
|
|
var ticker = EntitySystem.Get<GameTicker>();
|
|
|
|
|
|
|
|
|
|
|
|
if (ticker.RunLevel != GameRunLevel.InRound)
|
|
|
|
|
|
{
|
|
|
|
|
|
shell.WriteLine("This can only be executed while the game is in a round - try restartroundnow");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-10-09 13:18:20 -05:00
|
|
|
|
EntitySystem.Get<RoundEndSystem>().EndRound();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-29 14:40:10 -06:00
|
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2021-10-09 13:18:20 -05:00
|
|
|
|
public class RestartRoundNowCommand : IConsoleCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public string Command => "restartroundnow";
|
|
|
|
|
|
public string Description => "Moves the server from PostRound to a new PreRoundLobby.";
|
|
|
|
|
|
public string Help => String.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
|
{
|
2021-10-13 20:46:45 +02:00
|
|
|
|
EntitySystem.Get<GameTicker>().RestartRound();
|
2021-10-09 13:18:20 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|