Files
OldThink/Content.Server/GameTicking/Commands/ForceMapCommand.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2021-11-11 23:25:57 -07:00
using Content.Server.Administration;
using Content.Server.Maps;
2021-11-11 23:25:57 -07:00
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Server.GameTicking.Commands
{
[AdminCommand(AdminFlags.Round)]
sealed class ForceMapCommand : IConsoleCommand
2021-11-11 23:25:57 -07:00
{
public string Command => "forcemap";
public string Description => "forcemap-command-description";
public string Help => $"forcemap-command-help";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteLine(Loc.GetString("forcemap-command-need-one-argument"));
return;
}
var gameMap = IoCManager.Resolve<IGameMapManager>();
2021-11-11 23:25:57 -07:00
var name = args[0];
gameMap.ForceSelectMap(name);
2021-11-11 23:25:57 -07:00
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
}
}
}