Remote Administration

From King Arthur's Gold Wiki
Revision as of 06:16, 18 November 2012 by FliesLikeABrick (Talk | contribs)

Jump to: navigation, search

Overview

As of build 580, the KAG server has remote RCON capabilities, when enabled. This means that you can administer your server without joining via the game client. This is achieved by using telnet to connect to the game port over TCP, or using a remote administration client as they become available.

Configuration

This feature is enabled by setting sv_tcpr to 1 in the server configuration. If this variable is not in your configuration, it will be added after starting/stopping your server on a build >= 580, or you may add it manually (less recommended).

When enabled, the KAG server will bind to sv_ip and sv_ipv6 on the game port on TCP. If only sv_ip is configured (sv_ipv6 is still blank or 0), only IPv4 will be bound. If both are configured, both addresses will be bound. If both are unconfigured (empty or 0), all IPv4 and IPv6 addresses will be bound.

Protocol

Upon connecting to the port, the client must send \n-terminated string consisting of the server's rcon password.

If the password is incorrect, the server will close the connection.

If the password is correct, the server will immediately begin sending all console output to the client. The first line is usually something like that shown below. While this line will always show up, it may not be the first line sent back to the client depending on what other activity is going on in the server.

ryan@ubuntu:~/kagdev_local/trunk$ telnet ::1 50311
Trying ::1...
Connected to ::1.
Escape character is '^]'.
asd
[23:22:53] TCP RCON Connection from [::1]:46997 is now authenticated

After the connection is open and authenticated, any \n-terminated string will be handled as a console command. Adding /rcon is unnecessary, as this is a connection to the server hence all commands will be executed server-side.

Currently the output from all commands run from any client will be sent to all other clients (including in-game admins). This is a design decision that predates the implementation of TCP Rcon and is not currently slated to be changed. As such, rich GUI frontends for TCP Rcon connections may be difficult since there is no surefire way to identify which output goes with commands sent from a specific client.

Availability

This feature is available in KAG >= 580. This feature is not available to servers running under Windows due to the use of low-level POSIX socket system calls. In the event that the KAG server codebase is ported to Mac or BSD, this feature should be available on them as well.