Unturned II Dedicated Server

From Unturned Wiki
Jump to navigation Jump to search

The Unturned II Dedicated Server application was used to host multiplayer servers for the Unturned II demo. Server listing utilized the Steam platform, although due to the in-development state of Unturned II, there were a variety of quirks compared to hosting servers in Unturned.

  1. Downloading the Unturned II Dedicated Server application required a login during the private beta. If Unturned II had been marked as released on Steam, then it would have been available while logging in anonymously.
  2. Running a client on the same machine as a dedicated server required specifying the -DisableSteamServerInit launch option. However, running a listen server did not require this.
  3. Specifying a dedicated server name is currently done with the -SteamServerName="My Server" launch option. It was planned for this to be exposed in a more user-friendly manner.

RCON

The remote console (RCON) tools existed to help administrate servers without needing to connect as a player. There were two ways to invoke RCON: HTTP requests, and the RCON protocol. The setup process was not finalized, and it was planned for server administrators to be able to assign RCON keys permissions and configure the port in the server config.

HTTP requests

This invocation method is 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

Using the RCON protocol is more complex than the HTTP requests, but has the advantage of streaming log data from the server. To keep the method simple, the protocol 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

Authentication

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.

For example:

RCON 1 AUTH MySecretKey
Execute Command

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.

For example:

RCON 1 CMD teleport -from=player1 -to=player2
Ping

Request a PONG from the server.

Key Value
RCON RCON
Version 1
Type PING
Parameters None.

For example:

RCON 1 PING
Pong

Should be sent in reply to a PING from the server.

Key Value
RCON RCON
Version 1
Type PONG
Parameters None.

For example:

RCON 1 PONG

Server-to-client messages

Welcome

Sent after your AUTH packet is verified and approved for login.

Key Value
RCON RCON
Version 1
Type AUTH
Parameters None.

For example:

RCON 1 AUTH
Error

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.

For example:

RCON 1 ERR Bad Key
Log Relay

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.

For example:

RCON 1 LOG LogAIModule: Creating AISystem for world Devtest
Ping

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.

For example:

RCON 1 PING
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.

Key Value
RCON RCON
Version 1
Type PONG
Parameters None.

For example:

RCON 1 PONG