Reorganize commands into the Commands folder (#2679)
* Reorganize commands into the Commands folder * RIDER
This commit is contained in:
54
Content.Server/Commands/GameTicking/DelayStartCommand.cs
Normal file
54
Content.Server/Commands/GameTicking/DelayStartCommand.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class DelayStartCommand : IClientCommand
|
||||
{
|
||||
public string Command => "delaystart";
|
||||
public string Description => "Delays the round start.";
|
||||
public string Help => $"Usage: {Command} <seconds>\nPauses/Resumes the countdown if no argument is provided.";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
if (ticker.RunLevel != GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
shell.SendText(player, "This can only be executed while the game is in the pre-round lobby.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
var paused = ticker.TogglePause();
|
||||
shell.SendText(player, paused ? "Paused the countdown." : "Resumed the countdown.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Need zero or one arguments.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!uint.TryParse(args[0], out var seconds) || seconds == 0)
|
||||
{
|
||||
shell.SendText(player, $"{args[0]} isn't a valid amount of seconds.");
|
||||
return;
|
||||
}
|
||||
|
||||
var time = TimeSpan.FromSeconds(seconds);
|
||||
if (!ticker.DelayStart(time))
|
||||
{
|
||||
shell.SendText(player, "An unknown error has occurred.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Content.Server/Commands/GameTicking/EndRoundCommand.cs
Normal file
32
Content.Server/Commands/GameTicking/EndRoundCommand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class EndRoundCommand : IClientCommand
|
||||
{
|
||||
public string Command => "endround";
|
||||
public string Description => "Ends the round and moves the server to PostRound.";
|
||||
public string Help => String.Empty;
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
|
||||
if (ticker.RunLevel != GameRunLevel.InRound)
|
||||
{
|
||||
shell.SendText(player, "This can only be executed while the game is in a round.");
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.EndRound();
|
||||
}
|
||||
}
|
||||
}
|
||||
44
Content.Server/Commands/GameTicking/ForcePresetCommand.cs
Normal file
44
Content.Server/Commands/GameTicking/ForcePresetCommand.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class ForcePresetCommand : IClientCommand
|
||||
{
|
||||
public string Command => "forcepreset";
|
||||
public string Description => "Forces a specific game preset to start for the current lobby.";
|
||||
public string Help => $"Usage: {Command} <preset>";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
if (ticker.RunLevel != GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
shell.SendText(player, "This can only be executed while the game is in the pre-round lobby.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Need exactly one argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
var name = args[0];
|
||||
if (!ticker.TryGetPreset(name, out var type))
|
||||
{
|
||||
shell.SendText(player, $"No preset exists with name {name}.");
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.SetStartPreset(type, true);
|
||||
shell.SendText(player, $"Forced the game to start with preset {name}.");
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Content.Server/Commands/GameTicking/JoinGameCommand.cs
Normal file
58
Content.Server/Commands/GameTicking/JoinGameCommand.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AnyCommand]
|
||||
class JoinGameCommand : IClientCommand
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public string Command => "joingame";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
|
||||
public JoinGameCommand()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
}
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var output = string.Join(".", args);
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
if (ticker.RunLevel == GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
shell.SendText(player, "Round has not started.");
|
||||
return;
|
||||
}
|
||||
else if(ticker.RunLevel == GameRunLevel.InRound)
|
||||
{
|
||||
string ID = args[0];
|
||||
var positions = ticker.GetAvailablePositions();
|
||||
|
||||
if(positions.GetValueOrDefault(ID, 0) == 0) //n < 0 is treated as infinite
|
||||
{
|
||||
var jobPrototype = _prototypeManager.Index<JobPrototype>(ID);
|
||||
shell.SendText(player, $"{jobPrototype.Name} has no available slots.");
|
||||
return;
|
||||
}
|
||||
ticker.MakeJoinGame(player, args[0].ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.MakeJoinGame(player, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
68
Content.Server/Commands/GameTicking/MappingCommand.cs
Normal file
68
Content.Server/Commands/GameTicking/MappingCommand.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server | AdminFlags.Mapping)]
|
||||
class MappingCommand : IClientCommand
|
||||
{
|
||||
public string Command => "mapping";
|
||||
public string Description => "Creates and teleports you to a new uninitialized map for mapping.";
|
||||
public string Help => $"Usage: {Command} <mapname> / {Command} <id> <mapname>";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
shell.SendText(player, "Only players can use this command");
|
||||
return;
|
||||
}
|
||||
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
int mapId;
|
||||
string mapName;
|
||||
|
||||
switch (args.Length)
|
||||
{
|
||||
case 1:
|
||||
if (player.AttachedEntity == null)
|
||||
{
|
||||
shell.SendText(player, "The map name argument cannot be omitted if you have no entity.");
|
||||
return;
|
||||
}
|
||||
|
||||
mapId = (int) mapManager.NextMapId();
|
||||
mapName = args[0];
|
||||
break;
|
||||
case 2:
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
{
|
||||
shell.SendText(player, $"{args[0]} is not a valid integer.");
|
||||
return;
|
||||
}
|
||||
|
||||
mapId = id;
|
||||
mapName = args[1];
|
||||
break;
|
||||
default:
|
||||
shell.SendText(player, Help);
|
||||
return;
|
||||
}
|
||||
|
||||
shell.ExecuteCommand(player, $"addmap {mapId} false");
|
||||
shell.ExecuteCommand(player, $"loadbp {mapId} \"{CommandParsing.Escape(mapName)}\"");
|
||||
shell.ExecuteCommand(player, "aghost");
|
||||
shell.ExecuteCommand(player, $"tp 0 0 {mapId}");
|
||||
|
||||
var newGridId = mapManager.GetAllGrids().Max(g => (int) g.Index);
|
||||
|
||||
shell.SendText(player, $"Created unloaded map from file {mapName} with id {mapId}. Use \"savebp {newGridId} foo.yml\" to save the new grid as a map.");
|
||||
}
|
||||
}
|
||||
}
|
||||
24
Content.Server/Commands/GameTicking/NewRoundCommand.cs
Normal file
24
Content.Server/Commands/GameTicking/NewRoundCommand.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
public class NewRoundCommand : IClientCommand
|
||||
{
|
||||
public string Command => "restartround";
|
||||
public string Description => "Moves the server from PostRound to a new PreRoundLobby.";
|
||||
public string Help => String.Empty;
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
ticker.RestartRound();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Content.Server/Commands/GameTicking/ObserveCommand.cs
Normal file
27
Content.Server/Commands/GameTicking/ObserveCommand.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AnyCommand]
|
||||
class ObserveCommand : IClientCommand
|
||||
{
|
||||
public string Command => "observe";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
ticker.MakeObserve(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
61
Content.Server/Commands/GameTicking/RespawnCommand.cs
Normal file
61
Content.Server/Commands/GameTicking/RespawnCommand.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Server.Players;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
class RespawnCommand : IClientCommand
|
||||
{
|
||||
public string Command => "respawn";
|
||||
public string Description => "Respawns a player, kicking them back to the lobby.";
|
||||
public string Help => "respawn [player]";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (args.Length > 1)
|
||||
{
|
||||
shell.SendText(player, "Must provide <= 1 argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
var playerMgr = IoCManager.Resolve<IPlayerManager>();
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
|
||||
NetUserId userId;
|
||||
if (args.Length == 0)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
shell.SendText((IPlayerSession)null, "If not a player, an argument must be given.");
|
||||
return;
|
||||
}
|
||||
|
||||
userId = player.UserId;
|
||||
}
|
||||
else if (!playerMgr.TryGetUserId(args[0], out userId))
|
||||
{
|
||||
shell.SendText(player, "Unknown player");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!playerMgr.TryGetSessionById(userId, out var targetPlayer))
|
||||
{
|
||||
if (!playerMgr.TryGetPlayerData(userId, out var data))
|
||||
{
|
||||
shell.SendText(player, "Unknown player");
|
||||
return;
|
||||
}
|
||||
|
||||
data.ContentData().WipeMind();
|
||||
shell.SendText(player,
|
||||
"Player is not currently online, but they will respawn if they come back online");
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.Respawn(targetPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Content.Server/Commands/GameTicking/SetGamePresetCommand.cs
Normal file
30
Content.Server/Commands/GameTicking/SetGamePresetCommand.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class SetGamePresetCommand : IClientCommand
|
||||
{
|
||||
public string Command => "setgamepreset";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Need exactly one argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
|
||||
ticker.SetStartPreset(args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Content.Server/Commands/GameTicking/StartRoundCommand.cs
Normal file
32
Content.Server/Commands/GameTicking/StartRoundCommand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class StartRoundCommand : IClientCommand
|
||||
{
|
||||
public string Command => "startround";
|
||||
public string Description => "Ends PreRoundLobby state and starts the round.";
|
||||
public string Help => String.Empty;
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
|
||||
if (ticker.RunLevel != GameRunLevel.PreRoundLobby)
|
||||
{
|
||||
shell.SendText(player, "This can only be executed while the game is in the pre-round lobby.");
|
||||
return;
|
||||
}
|
||||
|
||||
ticker.StartRound();
|
||||
}
|
||||
}
|
||||
}
|
||||
112
Content.Server/Commands/GameTicking/TileWallsCommand.cs
Normal file
112
Content.Server/Commands/GameTicking/TileWallsCommand.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects.Components.Transform;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Mapping)]
|
||||
class TileWallsCommand : IClientCommand
|
||||
{
|
||||
// ReSharper disable once StringLiteralTypo
|
||||
public string Command => "tilewalls";
|
||||
public string Description => "Puts an underplating tile below every wall on a grid.";
|
||||
public string Help => $"Usage: {Command} <gridId> | {Command}";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
GridId gridId;
|
||||
|
||||
switch (args.Length)
|
||||
{
|
||||
case 0:
|
||||
if (player?.AttachedEntity == null)
|
||||
{
|
||||
shell.SendText((IPlayerSession) null, "Only a player can run this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
gridId = player.AttachedEntity.Transform.GridID;
|
||||
break;
|
||||
case 1:
|
||||
if (!int.TryParse(args[0], out var id))
|
||||
{
|
||||
shell.SendText(player, $"{args[0]} is not a valid integer.");
|
||||
return;
|
||||
}
|
||||
|
||||
gridId = new GridId(id);
|
||||
break;
|
||||
default:
|
||||
shell.SendText(player, Help);
|
||||
return;
|
||||
}
|
||||
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
if (!mapManager.TryGetGrid(gridId, out var grid))
|
||||
{
|
||||
shell.SendText(player, $"No grid exists with id {gridId}");
|
||||
return;
|
||||
}
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
if (!entityManager.TryGetEntity(grid.GridEntityId, out var gridEntity))
|
||||
{
|
||||
shell.SendText(player, $"Grid {gridId} doesn't have an associated grid entity.");
|
||||
return;
|
||||
}
|
||||
|
||||
var tileDefinitionManager = IoCManager.Resolve<ITileDefinitionManager>();
|
||||
var underplating = tileDefinitionManager["underplating"];
|
||||
var underplatingTile = new Tile(underplating.TileId);
|
||||
var changed = 0;
|
||||
foreach (var childUid in gridEntity.Transform.ChildEntityUids)
|
||||
{
|
||||
if (!entityManager.TryGetEntity(childUid, out var childEntity))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var prototype = childEntity.Prototype;
|
||||
while (true)
|
||||
{
|
||||
if (prototype?.Parent == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
prototype = prototype.Parent;
|
||||
}
|
||||
|
||||
if (prototype?.ID != "base_wall")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!childEntity.TryGetComponent(out SnapGridComponent snapGrid))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var tile = grid.GetTileRef(childEntity.Transform.Coordinates);
|
||||
var tileDef = (ContentTileDefinition) tileDefinitionManager[tile.Tile.TypeId];
|
||||
|
||||
if (tileDef.Name == "underplating")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
grid.SetTile(childEntity.Transform.Coordinates, underplatingTile);
|
||||
changed++;
|
||||
}
|
||||
|
||||
shell.SendText(player, $"Changed {changed} tiles.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AdminCommand(AdminFlags.Server)]
|
||||
class ToggleDisallowLateJoinCommand : IClientCommand
|
||||
{
|
||||
public string Command => "toggledisallowlatejoin";
|
||||
public string Description => "Allows or disallows latejoining during mid-game.";
|
||||
public string Help => $"Usage: {Command} <disallow>";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (args.Length != 1)
|
||||
{
|
||||
shell.SendText(player, "Need exactly one argument.");
|
||||
return;
|
||||
}
|
||||
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
|
||||
if (bool.TryParse(args[0], out var result))
|
||||
{
|
||||
ticker.ToggleDisallowLateJoin(bool.Parse(args[0]));
|
||||
shell.SendText(player, result ? "Late joining has been disabled." : "Late joining has been enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
shell.SendText(player, "Invalid argument.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Content.Server/Commands/GameTicking/ToggleReadyCommand.cs
Normal file
27
Content.Server/Commands/GameTicking/ToggleReadyCommand.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Commands.GameTicking
|
||||
{
|
||||
[AnyCommand]
|
||||
class ToggleReadyCommand : IClientCommand
|
||||
{
|
||||
public string Command => "toggleready";
|
||||
public string Description => "";
|
||||
public string Help => "";
|
||||
|
||||
public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ticker = IoCManager.Resolve<IGameTicker>();
|
||||
ticker.ToggleReady(player, bool.Parse(args[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user