mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 17:42:29 +01:00
Updated Multiplayer (markdown)
@@ -14,34 +14,28 @@ openrct2 host <saved game path> --port 11753
|
||||
|
||||
### Dedicated server
|
||||
OpenRCT2 also supports a headless mode where the game will run as a console application with no UI. This is useful for running dedicated game servers. This can be launched by the following command line:
|
||||
|
||||
```
|
||||
openrct2 host <saved game path> --port 11753 --headless
|
||||
```
|
||||
|
||||
Alternatively, on Linux, the openrct2-cli binary may be used:
|
||||
|
||||
```
|
||||
openrct2-cli host <saved game path> --port 11753
|
||||
```
|
||||
|
||||
Additional arguments:
|
||||
|
||||
Argument | Variable | Description
|
||||
--- | --- | ---
|
||||
|`--headless`| N/A | Runs OpenRCT without graphical interface
|
||||
|`--port`| Port number | Changes the server port number
|
||||
|`--user-data-path`| Path to directory containing `config.ini` | Changes the server configuration data path
|
||||
|`--password`| Password to set | Sets the server password
|
||||
|`--verbose`| N/A | Output additional information to the console
|
||||
|`--help`| N/A | Prints out help for CLI
|
||||
-------- | -------- | -----------
|
||||
`--headless` | N/A | Runs OpenRCT2 without graphical interface.
|
||||
`--port` | Port number | Changes the server port number.
|
||||
`--user-data-path` | Path to directory containing `config.ini` | Changes the server configuration data path.
|
||||
`--password` | Password to set. | Sets the server password.
|
||||
`--verbose` | N/A | Output additional information to the console.
|
||||
`--help` | N/A | Prints out help for CLI.
|
||||
|
||||
### Setting permissions
|
||||
The quickest way to setup permissions as of v0.2.7, is for you to join the server from a client and then on the dedicated server's STDIN terminal, and then change yourself to 'admin' role. Executing `network.players` in the terminal will print information about all the players connected to the server. Typically you would be the first user to join, so you will like be player index 1. You can change your player group to admin by running:
|
||||
```
|
||||
network.players[1].group = 0
|
||||
```
|
||||
|
||||
Now you can make further changes to the permissions using the client as you will be admin.
|
||||
|
||||
You can modify other aspects of the server using the scripting API:
|
||||
@@ -68,47 +62,42 @@ Group=<groupname>
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Reload the systemd daemon:
|
||||
```
|
||||
systemctl daemon-reload
|
||||
```
|
||||
|
||||
Enable the service:
|
||||
```
|
||||
systemctl enable openrct2.service
|
||||
```
|
||||
|
||||
Start the service:
|
||||
```
|
||||
systemctl start openrct2.service
|
||||
```
|
||||
|
||||
|
||||
## Starting the client
|
||||
To connect to a server, click "Multiplayer" from the Main Title of OpenRCT2, and then select the server. If the server is not on the list, click "New Server", and enter the IP/hostname of the server. After that, click on the entry to connect the server. If the server is not running on the default port, you can specify that after the IP address, e.g. ```127.0.0.1:22050```.
|
||||
To connect to a server, click "Multiplayer" from the Main Title of OpenRCT2, and then select the server. If the server is not on the list, click "New Server", and enter the IP/hostname of the server. After that, click on the entry to connect the server. If the server is not running on the default port, you can specify that after the IP address, e.g. `127.0.0.1:22050`.
|
||||
|
||||
To connect to a server by command line with the IP address 192.168.1.102 and listening on port 22050 in command prompt, type the following command (replace with the actual values of the server you want to connect to):
|
||||
|
||||
```
|
||||
openrct2 join 192.168.1.102 --port 22050
|
||||
```
|
||||
|
||||
## Permissions
|
||||
See https://github.com/OpenRCT2/OpenRCT2/wiki/Multiplayer-permissions
|
||||
See [[Multiplayer-permissions]]
|
||||
|
||||
## Desynchronisation
|
||||
_For a list of causes, see here_: https://github.com/OpenRCT2/OpenRCT2/wiki/Multiplayer-issues
|
||||
_For a list of causes, see here_: [[Multiplayer-issues]]
|
||||
|
||||
In order for network games to be reliable, they must stay synchronised. This works by each client always running the game slightly later than the server and never overtake its number of game ticks. When a player sends a game action (e.g. placing a path or opening a ride) - the action is sent to the server. The server then sends the action to all the clients - the clients then all run the action on precisely the same game tick as the server. So long as the game logic is deterministic, the games remain synchronised down to every peep position.
|
||||
|
||||
Currently there are still bugs relating to the initial connection setup and some of the user actions which cause the game state to diverge between the server and the client. If the client detects that its game state is not the same as the server, it will automatically disconnect. The client is able to reconnect to the server if this happens.
|
||||
|
||||
If you would like to ignore de-synchronisation for testing purposes, you can enable the "stay connected" option in the options dialog. **Warning:** doing this can lead to strange side effects.
|
||||
If you would like to ignore desynchronisation for testing purposes, you can enable the "stay connected" option in the options dialog. **Warning:** doing this can lead to strange side effects.
|
||||
|
||||

|
||||
|
||||
Alternatively set the following configuration option as a client in your config.ini file. This will alert you when the game has desynchronised but keep the connection open so you can still play.
|
||||
|
||||
```
|
||||
[network]
|
||||
stay_connected = true
|
||||
@@ -123,7 +112,6 @@ GET HTTP/1.1
|
||||
Host: servers.openrct2.io
|
||||
Accept: application/json
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user