2020-12-03 03:40:47 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using Content.Server.Administration;
|
|
|
|
|
|
using Content.Server.GameTicking;
|
|
|
|
|
|
using Content.Server.Interfaces.GameTicking;
|
|
|
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
|
using Robust.Shared.Console;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Commands.GameTicking
|
|
|
|
|
|
{
|
|
|
|
|
|
[AdminCommand(AdminFlags.Server)]
|
2021-02-01 16:49:43 -08:00
|
|
|
|
class EndRoundCommand : IConsoleCommand
|
2020-12-03 03:40:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
public string Command => "endround";
|
|
|
|
|
|
public string Description => "Ends the round and moves the server to PostRound.";
|
|
|
|
|
|
public string Help => String.Empty;
|
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-12-03 03:40:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
var ticker = IoCManager.Resolve<IGameTicker>();
|
|
|
|
|
|
|
|
|
|
|
|
if (ticker.RunLevel != GameRunLevel.InRound)
|
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
|
shell.WriteLine("This can only be executed while the game is in a round.");
|
2020-12-03 03:40:47 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ticker.EndRound();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|