Difference between revisions of "RCON"
MoltonMontro (talk | contribs) |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{Documentation}} |
− | The '''Remote Console''' tools exist to help you administer your server without connecting as a player. | + | The '''Remote Console''' ('''RCON''') tools exist to help you administer your server without connecting as a player. |
− | There are two ways to invoke | + | There are two ways to invoke RCON: HTTP Requests, and the RCON Protocol. |
== Setup == | == Setup == | ||
''to-doc'' | ''to-doc'' | ||
− | The setup process | + | The setup process is not finalized yet, as I want you to be able to assign RCON keys permissions and configure the port in the server config. |
== HTTP Requests == | == HTTP Requests == | ||
Line 20: | Line 20: | ||
! Value | ! Value | ||
|- | |- | ||
− | | Command || | + | | Command || ID of a command as it would be used in chat, such as <code>teleport</code> or <code>tp</code> |
|- | |- | ||
− | | Key || An authorized | + | | Key || An authorized RCON key you have assigned permissions to run this command. |
|- | |- | ||
− | | Arg || Key=Value pairs of arguments to the command. | + | | Arg || Key = Value pairs of arguments to the command. |
|} | |} | ||
Line 36: | Line 36: | ||
</pre> | </pre> | ||
− | Whereas a failed response which | + | Whereas a failed response which did not execute a command will contain an error explanation: |
<pre> | <pre> | ||
Line 45: | Line 45: | ||
</pre> | </pre> | ||
− | == | + | == RCON Protocol == |
Using the protocol is more complex than the HTTP requests, but has the advantage of streaming log data from the server. | Using the protocol is more complex than the HTTP requests, but has the advantage of streaming log data from the server. | ||
− | To keep things simple it | + | To keep things simple it is implemented as null-terminated UTF8 messages over a TCP socket connection. |
− | All | + | All RCON messages start with "RCON" followed by the version number, the type of message and then any parameters. |
{| class="wikitable" | {| class="wikitable" | ||
Line 86: | Line 86: | ||
==== Execute Command ==== | ==== Execute Command ==== | ||
− | Can be sent once you | + | Can be sent once you have authenticated to execute a command. |
{| class="wikitable" | {| class="wikitable" | ||
Line 104: | Line 104: | ||
<pre> | <pre> | ||
RCON 1 CMD teleport -from=player1 -to=player2 | RCON 1 CMD teleport -from=player1 -to=player2 | ||
+ | </pre> | ||
+ | |||
+ | ==== Ping ==== | ||
+ | |||
+ | Request a PONG from the server. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Key | ||
+ | ! Value | ||
+ | |- | ||
+ | | RCON || RCON | ||
+ | |- | ||
+ | | Version || 1 | ||
+ | |- | ||
+ | | Type || PING | ||
+ | |- | ||
+ | | Parameters || None. | ||
+ | |} | ||
+ | |||
+ | ''Example:'' | ||
+ | <pre> | ||
+ | RCON 1 PING | ||
+ | </pre> | ||
+ | |||
+ | ==== Pong ==== | ||
+ | |||
+ | Should be sent in reply to a PING from the server. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Key | ||
+ | ! Value | ||
+ | |- | ||
+ | | RCON || RCON | ||
+ | |- | ||
+ | | Version || 1 | ||
+ | |- | ||
+ | | Type || PONG | ||
+ | |- | ||
+ | | Parameters || None. | ||
+ | |} | ||
+ | |||
+ | ''Example:'' | ||
+ | <pre> | ||
+ | RCON 1 PONG | ||
</pre> | </pre> | ||
Line 173: | Line 217: | ||
RCON 1 LOG LogAIModule: Creating AISystem for world Devtest | RCON 1 LOG LogAIModule: Creating AISystem for world Devtest | ||
</pre> | </pre> | ||
+ | |||
+ | ==== Ping ==== | ||
+ | |||
+ | Sent by the server to check that you are still alive. You should send back a PONG or you will be disconnected. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Key | ||
+ | ! Value | ||
+ | |- | ||
+ | | RCON || RCON | ||
+ | |- | ||
+ | | Version || 1 | ||
+ | |- | ||
+ | | Type || PING | ||
+ | |- | ||
+ | | Parameters || None. | ||
+ | |} | ||
+ | |||
+ | ''Example:'' | ||
+ | <pre> | ||
+ | RCON 1 PING | ||
+ | </pre> | ||
+ | |||
+ | ==== Pong ==== | ||
+ | |||
+ | Received in response to a PING you sent the server. The time difference between when you sent your PING and got this PONG is the travel time to the server plus the processing time on the server plus the travel time back. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Key | ||
+ | ! Value | ||
+ | |- | ||
+ | | RCON || RCON | ||
+ | |- | ||
+ | | Version || 1 | ||
+ | |- | ||
+ | | Type || PONG | ||
+ | |- | ||
+ | | Parameters || None. | ||
+ | |} | ||
+ | |||
+ | ''Example:'' | ||
+ | <pre> | ||
+ | RCON 1 PONG | ||
+ | </pre> | ||
+ | |||
+ | {{Navbox tutorials (U4)}} |
Latest revision as of 02:13, 11 January 2019
![]() |
This page provides official documentation. | |
---|---|---|
This page is officially maintained by Smartly Dressed Games, and serves as documentation to walk you through a specific task or feature. |
The Remote Console (RCON) tools exist to help you administer your server without connecting as a player.
There are two ways to invoke RCON: HTTP Requests, and the RCON Protocol.
Contents
Setup[edit]
to-doc The setup process is not finalized yet, as I want you to be able to assign RCON keys permissions and configure the port in the server config.
HTTP Requests[edit]
Intended for web-based control panels to run commands on the server.
Requests can be sent to {Server}/rcon/{Command}?key={Key}&arg1=value1&arg2=value2
.
Key | Value |
---|---|
Command | ID of a command as it would be used in chat, such as teleport or tp
|
Key | An authorized RCON key you have assigned permissions to run this command. |
Arg | Key = Value pairs of arguments to the command. |
Responses are returned in JSON. If a command was found and executed the response looks like:
{ "Success": true, "Output": "{Logs}" }
Whereas a failed response which did not execute a command will contain an error explanation:
{ "Success": false, "Error": "{Explanation}" }
RCON Protocol[edit]
Using the protocol is more complex than the HTTP requests, but has the advantage of streaming log data from the server.
To keep things simple it is implemented as null-terminated UTF8 messages over a TCP socket connection.
All RCON messages start with "RCON" followed by the version number, the type of message and then any parameters.
RCON | Version | Type | Parameters |
---|
Client to Server Messages[edit]
Authentication[edit]
Should be the first packet you send. Wait for an AUTH reply from the server as notification that you were approved for login, or ERR if you were rejected.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | AUTH |
Parameters | Authorized RCON key. |
Example:
RCON 1 AUTH MySecretKey
Execute Command[edit]
Can be sent once you have authenticated to execute a command.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | CMD |
Parameters | Command as would be used in chat. |
Example:
RCON 1 CMD teleport -from=player1 -to=player2
Ping[edit]
Request a PONG from the server.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | PING |
Parameters | None. |
Example:
RCON 1 PING
Pong[edit]
Should be sent in reply to a PING from the server.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | PONG |
Parameters | None. |
Example:
RCON 1 PONG
Server to Client Messages[edit]
Welcome[edit]
Sent after your AUTH packet is verified and approved for login.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | AUTH |
Parameters | None. |
Example:
RCON 1 AUTH
Error[edit]
Sent if your AUTH packet was denied, or a packet you sent was malformed.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | ERR |
Parameters | Explanation of error. |
Example:
RCON 1 ERR Bad Key
Log Relay[edit]
Sent to mirror log messages that were printed on the server.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | LOG |
Parameters | Line(s) of output relayed from the log. |
Example:
RCON 1 LOG LogAIModule: Creating AISystem for world Devtest
Ping[edit]
Sent by the server to check that you are still alive. You should send back a PONG or you will be disconnected.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | PING |
Parameters | None. |
Example:
RCON 1 PING
Pong[edit]
Received in response to a PING you sent the server. The time difference between when you sent your PING and got this PONG is the travel time to the server plus the processing time on the server plus the travel time back.
Key | Value |
---|---|
RCON | RCON |
Version | 1 |
Type | PONG |
Parameters | None. |
Example:
RCON 1 PONG