forcemap update

This commit is contained in:
BIGZi0348
2024-12-01 14:44:49 +03:00
parent ab063997f7
commit 2f9a2ed9ec
3 changed files with 17 additions and 2 deletions

View File

@@ -28,11 +28,22 @@ namespace Content.Server.GameTicking.Commands
var gameMap = IoCManager.Resolve<IGameMapManager>(); var gameMap = IoCManager.Resolve<IGameMapManager>();
var name = args[0]; var name = args[0];
// WD EDIT START AHEAD OF WIZDEN
// An empty string clears the forced map
if (!string.IsNullOrEmpty(name) && !gameMap.CheckMapExists(name))
{
shell.WriteLine(Loc.GetString("forcemap-command-map-not-found", ("map", name)));
return;
}
_configurationManager.SetCVar(CCVars.GameMap, name); _configurationManager.SetCVar(CCVars.GameMap, name);
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
}
if (string.IsNullOrEmpty(name))
shell.WriteLine(Loc.GetString("forcemap-command-cleared"));
else
shell.WriteLine(Loc.GetString("forcemap-command-success", ("map", name)));
// WD EDIT END AHEAD OF WIZDEN
}
public CompletionResult GetCompletion(IConsoleShell shell, string[] args) public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{ {
if (args.Length == 1) if (args.Length == 1)

View File

@@ -3,5 +3,7 @@
forcemap-command-description = Forces the game to start with a given map next round. forcemap-command-description = Forces the game to start with a given map next round.
forcemap-command-help = forcemap <map ID> forcemap-command-help = forcemap <map ID>
forcemap-command-need-one-argument = forcemap takes one argument, the path to the map file. forcemap-command-need-one-argument = forcemap takes one argument, the path to the map file.
forcemap-command-map-not-found = No eligible map exists with name { $map }.
forcemap-command-success = Forced the game to start with map { $map } next round. forcemap-command-success = Forced the game to start with map { $map } next round.
forcemap-command-cleared = Cleared the forced map setting.
forcemap-command-arg-map = <map ID> forcemap-command-arg-map = <map ID>

View File

@@ -3,5 +3,7 @@
forcemap-command-description = Заставляет игру начать с заданной карты в следующем раунде. forcemap-command-description = Заставляет игру начать с заданной карты в следующем раунде.
forcemap-command-help = forcemap <map ID> forcemap-command-help = forcemap <map ID>
forcemap-command-need-one-argument = forcemap принимает один аргумент — путь к файлу карты. forcemap-command-need-one-argument = forcemap принимает один аргумент — путь к файлу карты.
forcemap-command-map-not-found = Не существует подходящей карты с названием { $map }.
forcemap-command-success = В следующем раунде игра принудительно начнется с карты { $map }. forcemap-command-success = В следующем раунде игра принудительно начнется с карты { $map }.
forcemap-command-cleared = Настройки принудительной карты сброшены.
forcemap-command-arg-map = <map ID> forcemap-command-arg-map = <map ID>