2020-12-03 03:40:47 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using Content.Server.Administration;
|
|
|
|
|
|
using Content.Shared.Administration;
|
2021-02-01 16:49:43 -08:00
|
|
|
|
using Robust.Shared.Console;
|
2021-06-20 10:09:24 +02:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-12-03 03:40:47 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Server.GameTicking.Commands
|
2020-12-03 03:40:47 +01:00
|
|
|
|
{
|
2021-11-29 14:40:10 -06:00
|
|
|
|
[AdminCommand(AdminFlags.Round)]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
sealed 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
|
|
|
|
{
|
2021-06-20 10:09:24 +02:00
|
|
|
|
var ticker = EntitySystem.Get<GameTicker>();
|
2020-12-03 03:40:47 +01:00
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-06-09 22:19:39 +02:00
|
|
|
|
}
|