Revert "Refactor Game Modes" oh god oh fuck go back it was too good to be true (#5855)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking.Presets;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -30,13 +29,13 @@ namespace Content.Server.GameTicking.Commands
|
||||
}
|
||||
|
||||
var name = args[0];
|
||||
if (!ticker.TryFindGamePreset(name, out var type))
|
||||
if (!ticker.TryGetPreset(name, out var type))
|
||||
{
|
||||
shell.WriteLine($"No preset exists with name {name}.");
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.SetGamePreset(type, true);
|
||||
ticker.SetStartPreset(type, true);
|
||||
shell.WriteLine($"Forced the game to start with preset {name}.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking.Presets;
|
||||
using Content.Shared;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
@@ -19,14 +18,14 @@ namespace Content.Server.GameTicking.Commands
|
||||
public string Help => $"Usage: {Command} / {Command} <preset>";
|
||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
GamePresetPrototype? preset = null;
|
||||
Type? preset = null;
|
||||
var presetName = string.Join(" ", args);
|
||||
|
||||
var ticker = EntitySystem.Get<GameTicker>();
|
||||
|
||||
if (args.Length > 0)
|
||||
{
|
||||
if (!ticker.TryFindGamePreset(presetName, out preset))
|
||||
if (!ticker.TryGetPreset(presetName, out preset))
|
||||
{
|
||||
shell.WriteLine($"No preset found with name {presetName}");
|
||||
return;
|
||||
@@ -40,7 +39,7 @@ namespace Content.Server.GameTicking.Commands
|
||||
|
||||
if (preset != null)
|
||||
{
|
||||
ticker.SetGamePreset(preset);
|
||||
ticker.SetStartPreset(preset);
|
||||
}
|
||||
|
||||
shell.WriteLine($"Enabling the lobby and restarting the round.{(preset == null ? "" : $"\nPreset set to {presetName}")}");
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.GameTicking.Commands
|
||||
|
||||
var ticker = EntitySystem.Get<GameTicker>();
|
||||
|
||||
ticker.SetGamePreset(args[0]);
|
||||
ticker.SetStartPreset(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user