Files
RobustToolbox/Robust.Shared/Console/IConsoleShell.cs
Moony 0e1328675c Toolshed (#4197)
* Saving work

* Move shit to engine

* lord

* merg

* awa

* bql is kill

* forgot the fucking bike rack

* bql is kill for real

* pjb will kill me

* aughfhbdj

* yo ho here we go on my way to the MINES

* a

* adgddf

* gdsgvfvxshngfgh

* b

* hfsjhghj

* hbfdjjh

* tf you mean i have to document it

* follow C# standards

* Assorted cleanup and documentation pass, minor bugfix in ValueRefParser.

* Start porting old commands, remove that pesky prefix in favor of integrating with the shell.

* Fix valueref up a bit, improve autocomplete for it.

* e

* Toolshed type system adventure.

* a log

* a

* a e i o u

* awa

* fix tests

* Arithmetic commands.

* a

* parse improvements

---------

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
2023-08-02 16:06:16 -05:00

72 lines
2.4 KiB
C#

using Robust.Shared.Players;
using Robust.Shared.Utility;
namespace Robust.Shared.Console
{
/// <summary>
/// The console shell that executes commands. Each shell executes commands in the context of a player
/// session, or without a session in a local context.
/// </summary>
public interface IConsoleShell
{
/// <summary>
/// The console host that owns this shell.
/// </summary>
IConsoleHost ConsoleHost { get; }
/// <summary>
/// Is the shell running on the client?
/// </summary>
bool IsClient => !IsServer;
/// <summary>
/// Is the shell running in a local context (no remote peer session)?.
/// </summary>
bool IsLocal { get; }
/// <summary>
/// Is the shell running on the server?
/// </summary>
bool IsServer { get; }
/// <summary>
/// The remote peer that owns this shell, or the local player if this is a client-side local shell (<see cref="IsLocal" /> is true and <see cref="IsClient"/> is true).
/// </summary>
ICommonSession? Player { get; }
/// <summary>
/// Executes a command string on this specific session shell. If the command does not exist, the command will be forwarded
/// to the
/// remote shell.
/// </summary>
/// <param name="command">command line string to execute.</param>
void ExecuteCommand(string command);
/// <summary>
/// Executes the command string on the remote peer. This is mainly used to forward commands from the client to the server.
/// If there is no remote peer (this is a local shell), this function does nothing.
/// </summary>
/// <param name="command">Command line string to execute at the remote endpoint.</param>
void RemoteExecuteCommand(string command);
/// <summary>
/// Writes a line to the output of the console.
/// </summary>
/// <param name="text">Line of text to write.</param>
void WriteLine(string text);
void WriteLine(FormattedMessage message);
/// <summary>
/// Write an error line to the console window.
/// </summary>
/// <param name="text">Line of text to write.</param>
void WriteError(string text);
/// <summary>
/// Clears the entire console of text.
/// </summary>
void Clear();
}
}