mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Server console can forward commands to a client.
This commit is contained in:
@@ -28,7 +28,12 @@ namespace Robust.Server.Console
|
||||
/// <inheritdoc />
|
||||
public override void RemoteExecuteCommand(ICommonSession? session, string command)
|
||||
{
|
||||
//TODO: Server -> Client remote execute, just like how the client forwards the command
|
||||
if (!NetManager.IsConnected || session is null)
|
||||
return;
|
||||
|
||||
var msg = NetManager.CreateNetMessage<MsgConCmd>();
|
||||
msg.Text = command;
|
||||
NetManager.ServerSendMessage(msg, ((IPlayerSession)session).ConnectedClient);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -61,7 +66,7 @@ namespace Robust.Server.Console
|
||||
var sudoShell = new SudoShell(this, localShell, shell);
|
||||
ExecuteInShell(sudoShell, $"{command} {string.Join(' ', cArgs)}");
|
||||
});
|
||||
|
||||
|
||||
LoadConsoleCommands();
|
||||
|
||||
// setup networking with clients
|
||||
|
||||
Reference in New Issue
Block a user