Редактирование: RCON
Материал из Eco - Русская Wiki
Сделанные вами изменения будут показаны читателям после того, как их утвердит уполномоченный участник (подробнее).
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий ниже, чтобы убедиться, что это нужная вам правка, и запишите страницу ниже, чтобы отменить правку.
Текущая версия | Ваш текст | ||
Строка 11: | Строка 11: | ||
С списком доступных команд, которые можно использовать с RCON или в игре, можно изучить [[Команды чата|тут]]. | С списком доступных команд, которые можно использовать с RCON или в игре, можно изучить [[Команды чата|тут]]. | ||
=== | ===Public Tools and Libraries=== | ||
Most standard tools for communicating with standard RCON will work with Eco RCON. A short list of known working tools can be found below | |||
''' | '''Tools''' | ||
*https://github.com/n0la/rcon (RCON | *https://github.com/n0la/rcon (RCON command line tool) | ||
*https://github.com/Tiiffi/mcrcon (RCON | *https://github.com/Tiiffi/mcrcon (RCON command line client) | ||
== | All command requests sent through RCON are executed with server admin permissions. For best practice its advised you keep your RCON information secure and only let trusted users or trusted programs access your RCON server. | ||
=== | == Developer Documentation== | ||
===Establishing a Connection=== | |||
To establish a TCP connection to an Eco RCON server you need to know the server's configured RCON port and the server's configured password and connect via a standard TCP client. Once connected you must authenticate your selves by sending a '''SERVERDATA_AUTH''' packet. Failure to do so will result in no response. If your authentication request was successful you should receive back a '''SERVERDATA_AUTH_RESPONSE''' packet with a matching id of the authentication request packet. Receiving an packet id of -1 means the authentication request has failed. An authentication request can fail if the password is incorrect, misconfigured, or if there is already an active RCON client connection. | To establish a TCP connection to an Eco RCON server you need to know the server's configured RCON port and the server's configured password and connect via a standard TCP client. Once connected you must authenticate your selves by sending a '''SERVERDATA_AUTH''' packet. Failure to do so will result in no response. If your authentication request was successful you should receive back a '''SERVERDATA_AUTH_RESPONSE''' packet with a matching id of the authentication request packet. Receiving an packet id of -1 means the authentication request has failed. An authentication request can fail if the password is incorrect, misconfigured, or if there is already an active RCON client connection. | ||
=== | ===Packet Structure=== | ||
==== Basic Packet Structure==== | ==== Basic Packet Structure==== | ||
All Eco RCON packets payloads follow this basic structure and are sent over a TCP socket | All Eco RCON packets payloads follow this basic structure and are sent over a TCP socket | ||
{| class="wikitable standard-table" | {| class="wikitable standard-table" | ||
!Field|| | !Field||Type|||Value | ||
|- | |- | ||
|Size||32-bit little-endian Signed Integer||Varies, see below. | |Size||32-bit [[wiki:Endianness|little-endian]] Signed [[Integer]]||Varies, see below. | ||
|- | |- | ||
|ID||32-bit little-endian Signed Integer||Varies, see below. | |ID||32-bit [[wiki:Endianness|little-endian]] Signed [[Integer]]||Varies, see below. | ||
|- | |- | ||
|Type||32-bit little-endian Signed Integer||Varies, see below. | |Type||32-bit [[wiki:Endianness|little-endian]] Signed [[Integer]]||Varies, see below. | ||
|- | |- | ||
|Body||Null-terminated ASCII String||Varies, see below. | |Body||[[wiki:Null-terminated string|Null-terminated]] [[wiki:ASCII|ASCII]] [[String]]||Varies, see below. | ||
|- | |- | ||
|Empty String||Null-terminated ASCII String||0x00 | |Empty String||[[wiki:Null-terminated string|Null-terminated]] [[wiki:ASCII|ASCII]] [[String]]||0x00 | ||
|- | |- | ||
|} | |} | ||
==== | ====Packet Size==== | ||
The RCON packet size field is represented by a 32-bit little endian integer, It represents the total length of the request in bytes. Note that the '''packet size''' field itself is '''not''' included when determining the size of the packet, so the value of this field is always 4 less than the packet's actual length. The minimum possible value for '''packet size''' is 14. | The RCON packet size field is represented by a 32-bit little endian integer, It represents the total length of the request in bytes. Note that the '''packet size''' field itself is '''not''' included when determining the size of the packet, so the value of this field is always 4 less than the packet's actual length. The minimum possible value for '''packet size''' is 14. | ||
{| class="wikitable standard-table" | {| class="wikitable standard-table" | ||
!Size||Containing | !Size||Containing | ||
|- | |- | ||
|4 Bytes||ID Field | |4 [[Byte|Bytes]]||ID Field | ||
|- | |- | ||
|4 Bytes||Type Field | |4 [[Byte|Bytes]]||Type Field | ||
|- | |- | ||
|At least 1 Byte||Packet body (potentially empty) | |At least 1 [[Byte]]||Packet body (potentially empty) | ||
|- | |- | ||
|1 Byte||Empty string terminator | |1 [[Byte|Bytes]]||Empty string terminator | ||
|} | |} | ||
====ID | ====Packet ID==== | ||
The packet id field is a 32-bit little endian integer which is specified by the requesting client for each request. Its value can be any positive integer. When the server responds to a client request it will send back the same packet id it received for that command request allowing you match the original request to the server response. | The packet id field is a 32-bit little endian integer which is specified by the requesting client for each request. Its value can be any positive integer. When the server responds to a client request it will send back the same packet id it received for that command request allowing you match the original request to the server response. | ||
==== | ====Packet Type ==== | ||
The packet type field is represented by a 32-bit little endian integer. It the intended purpose of the packet. | The packet type field is represented by a 32-bit little endian integer. It the intended purpose of the packet. | ||
{| class="wikitable standard-table" | {| class="wikitable standard-table" | ||
Строка 69: | Строка 68: | ||
|0||SERVERDATA_RESPONSE_VALUE | |0||SERVERDATA_RESPONSE_VALUE | ||
|} | |} | ||
==== | ====Packet Body ==== | ||
The packet body field is a null-terminated ASCII encoded string. The contents of the packet body vary by the executed request. | The packet body field is a null-terminated ASCII encoded string. The contents of the packet body vary by the executed request. | ||
=== | ====Packet Types==== | ||
====='''SERVERDATA_AUTH'''===== | ====='''SERVERDATA_AUTH'''===== | ||
'''SERVERDATA_AUTH''' is the first packet to be sent by a newly connected client. It is used to authenticate with the RCON server and gain access to the '''SERVERDATA_EXECCOMMAND''' request. The values of this packet type's fields are as follows: | '''SERVERDATA_AUTH''' is the first packet to be sent by a newly connected client. It is used to authenticate with the RCON server and gain access to the '''SERVERDATA_EXECCOMMAND''' request. The values of this packet type's fields are as follows: | ||
Строка 134: | Строка 133: | ||
|} | |} | ||
__NOEDITSECTION__ | __NOEDITSECTION__ | ||
[[Category:Server Management]] | |||
[[Category:Modding]] |