Mervill
2022-11-07 18:18:21 -08:00
committed by GitHub
parent 01e0f60f81
commit 40b556d206
12 changed files with 181 additions and 99 deletions

View File

@@ -1,7 +1,9 @@
using System.Linq;
using System.Linq;
using Content.Server.Administration;
using Content.Server.Maps;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
@@ -10,6 +12,8 @@ namespace Content.Server.GameTicking.Commands
[AdminCommand(AdminFlags.Round)]
sealed class ForceMapCommand : IConsoleCommand
{
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
public string Command => "forcemap";
public string Description => Loc.GetString("forcemap-command-description");
public string Help => Loc.GetString("forcemap-command-help");
@@ -25,7 +29,7 @@ namespace Content.Server.GameTicking.Commands
var gameMap = IoCManager.Resolve<IGameMapManager>();
var name = args[0];
gameMap.ForceSelectMap(name);
_configurationManager.SetCVar(CCVars.GameMap, name);
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
}