From bd66eb1a97d0d71efc321bed9fd1f0cf529fb58c Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Mon, 11 Sep 2023 23:21:14 +0900 Subject: [PATCH] Add setrandommap command (#386) --- .../White/Commands/SetRandomMapCommand.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Content.Server/White/Commands/SetRandomMapCommand.cs diff --git a/Content.Server/White/Commands/SetRandomMapCommand.cs b/Content.Server/White/Commands/SetRandomMapCommand.cs new file mode 100644 index 0000000000..b7463b64ac --- /dev/null +++ b/Content.Server/White/Commands/SetRandomMapCommand.cs @@ -0,0 +1,23 @@ +using Content.Server.Administration; +using Content.Shared.Administration; +using Content.Shared.CCVar; +using Robust.Shared.Configuration; +using Robust.Shared.Console; + +namespace Content.Server.White.Commands; + +[AdminCommand(AdminFlags.Round)] +sealed class SetRanomMapCommand : IConsoleCommand +{ + [Dependency] private readonly IConfigurationManager _configurationManager = default!; + + public string Command => "setrandommap"; + public string Description => "Устанавливает случайную карту из пула и включает ротацию карт"; + public string Help => "setrandommap"; + + public void Execute(IConsoleShell shell, string argStr, string[] args) + { + _configurationManager.SetCVar(CCVars.GameMap, string.Empty); + shell.WriteLine("Включена ротация карт."); + } +}