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:
Acruid
2021-02-01 16:49:43 -08:00
committed by GitHub
parent 80ad2ef5b7
commit 8b5d66050a
119 changed files with 820 additions and 796 deletions

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using Content.Server.Commands.Observer;
using Content.Shared.Audio;
@@ -8,11 +8,12 @@ using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Mobs.State;
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Utility;
using Robust.Server.Console;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
using Robust.Shared.Audio;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC;
@@ -89,9 +90,9 @@ namespace Content.Server.GameObjects.Components.Body
if (Owner.TryGetComponent(out IMobStateComponent? mobState) &&
mobState.IsDead())
{
var shell = IoCManager.Resolve<IConsoleShell>();
var host = IoCManager.Resolve<IServerConsoleHost>();
new Ghost().Execute(shell, (IPlayerSession) session, Array.Empty<string>());
new Ghost().Execute(new ConsoleShell(host, session), string.Empty, Array.Empty<string>());
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Administration.Commands;
@@ -15,9 +15,9 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Robust.Server.Console;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -686,9 +686,10 @@ namespace Content.Server.GameObjects.Components.GUI
var entityId = target.Uid.ToString();
var command = new SetOutfitCommand();
var shell = IoCManager.Resolve<IConsoleShell>();
var host = IoCManager.Resolve<IServerConsoleHost>();
var args = new string[] {entityId};
command.Execute(shell, user.PlayerSession(), args);
var session = user.PlayerSession();
command.Execute(new ConsoleShell(host, session), $"{command.Command} {entityId}", args);
}
private static bool CanCommand(IEntity user)