Refactor GameMapManager a bit (nukes mapforced) (#11513)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Closes https://github.com/space-wizards/space-station-14/issues/7192 Closes https://github.com/space-wizards/space-station-14/issues/6537 Closes https://github.com/space-wizards/space-station-14/issues/9579
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user