Barotrauma Server Doc
Barotrauma.DebugConsole.Command Class Reference

Public Member Functions

 Command (string name, string help, Action< string[]> onExecute, Func< string[][]> getValidArgs=null, bool isCheat=false)
 Use this constructor to create a command that executes the same action regardless of whether it's executed by a client or the server. More...
 
void Execute (string[] args)
 
override int GetHashCode ()
 
void ServerExecuteOnClientRequest (Client client, Vector2 cursorWorldPos, string[] args)
 

Public Attributes

readonly ImmutableArray< IdentifierNames
 
readonly string Help
 
Action< string[]> OnExecute
 
Func< string[][]> GetValidArgs
 
readonly bool IsCheat
 Using a command that's considered a cheat disables achievements More...
 
Action< Client, Vector2, string[]> OnClientRequestExecute
 Executed server-side when a client attempts to use the command. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Command()

Barotrauma.DebugConsole.Command.Command ( string  name,
string  help,
Action< string[]>  onExecute,
Func< string[][]>  getValidArgs = null,
bool  isCheat = false 
)

Use this constructor to create a command that executes the same action regardless of whether it's executed by a client or the server.

Definition at line 60 of file BarotraumaShared/SharedSource/DebugConsole.cs.

Member Function Documentation

◆ Execute()

void Barotrauma.DebugConsole.Command.Execute ( string[]  args)

◆ GetHashCode()

override int Barotrauma.DebugConsole.Command.GetHashCode ( )

◆ ServerExecuteOnClientRequest()

void Barotrauma.DebugConsole.Command.ServerExecuteOnClientRequest ( Client  client,
Vector2  cursorWorldPos,
string[]  args 
)

Member Data Documentation

◆ GetValidArgs

Func<string[][]> Barotrauma.DebugConsole.Command.GetValidArgs

◆ Help

readonly string Barotrauma.DebugConsole.Command.Help

◆ IsCheat

readonly bool Barotrauma.DebugConsole.Command.IsCheat

Using a command that's considered a cheat disables achievements

Definition at line 55 of file BarotraumaShared/SharedSource/DebugConsole.cs.

◆ Names

readonly ImmutableArray<Identifier> Barotrauma.DebugConsole.Command.Names

◆ OnClientRequestExecute

Action<Client, Vector2, string[]> Barotrauma.DebugConsole.Command.OnClientRequestExecute

Executed server-side when a client attempts to use the command.

Definition at line 32 of file BarotraumaServer/ServerSource/DebugConsole.cs.

◆ OnExecute

Action<string[]> Barotrauma.DebugConsole.Command.OnExecute