Console Unify API Changes (#3059)
* Remove unused IChatCommand. * Lots of refactoring into a shared context. * Removed ICommonSession from server concmd Execute. * Added argStr parameter to concmd execute. * The execute function of client concmds now returns void, use the new shell.RemoteExecuteCommand function to forward commands. * Finally move shells and commands into shared. * Console commands can now be registered directly without a class in a shared context. * Engine API Changes. * Repair rebase damage. * Update Submodule.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System;
|
||||
using Content.Server.Database;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Network;
|
||||
|
||||
@@ -11,14 +11,15 @@ using Robust.Shared.Network;
|
||||
namespace Content.Server.Administration.Commands
|
||||
{
|
||||
[AdminCommand(AdminFlags.Ban)]
|
||||
public sealed class BanCommand : IClientCommand
|
||||
public sealed class BanCommand : IConsoleCommand
|
||||
{
|
||||
public string Command => "ban";
|
||||
public string Description => "Bans somebody";
|
||||
public string Help => "Usage: <name or user ID> <reason> <duration in minutes, or 0 for permanent ban>";
|
||||
|
||||
public async void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
|
||||
public async void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||
{
|
||||
var player = shell.Player as IPlayerSession;
|
||||
var plyMgr = IoCManager.Resolve<IPlayerManager>();
|
||||
var dbMan = IoCManager.Resolve<IServerDbManager>();
|
||||
|
||||
@@ -37,7 +38,7 @@ namespace Content.Server.Administration.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
shell.SendText(player, "Unable to find user with that name.");
|
||||
shell.WriteLine("Unable to find user with that name.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user