Changes

Jump to navigation Jump to search

Documentation/Tools/Dedicated Server

2,407 bytes added, 22:42, 27 November 2023
m
Data requirements
=How to download a dedicated server=
====Game owner, using steam Steam client====Dedicated server can be download downloaded via steam the Steam client. You can either search directly for application ID in you your library tab
Euro Truck Simulator 2 Dedicated Server ID = 1948160
American Truck Simulator Dedicated Server ID = 2239530
or you can find it among listed tools. To show tools in steam the Steam library, you have to adjust steam filters (combo box above search field in library tab).
====Anonymous, without game ownership, or without Steam Client====
If you are not game owner or you don't have steam the Steam client installed, you have to use [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD] to download server.'''Remember that SteamCMD does not auto-update your server.'''
=How to launch a dedicated server=
You can launch the dedicated server either from the Steam client's library tab, or directly by starting its executable. Game ownership is not required. If you want to launch a server with different configuration, you can use the following startup parameters:
<nowiki>-server "server packages file name" (loads non default server game setup)</nowiki>
<nowiki>-server_cfg "server config file name" (loads non default server configuration)</nowiki>
<nowiki>-homedir "path" (redirects game/server home directoryon Windows, use XDG_DATA_HOME environment for the same thing on Linux)</nowiki> <nowiki>-nosingle (enables multiple instances of server, will be default in next patch)</nowiki>
If you have redirected home directory for the game (location where server_config, server.log, game.log, server_packages are stored), you have to redirect server home directory as well (this is done with -homedir parameter).
==How to launch a dedicated server on linux Linux without steam Steam client installed==
You may get the following error when starting a server with Linux: `[S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.dll.`
To launch server on linux Linux `steamclient.so` library is required. You can either use provided launch_serverserver_launch.sh script (located in folder next to to the server executable) or create a link to this library using `ln -s steamcmd/linux64/steamclient.so ~/.steam/sdk64/steamclient.so`
=First launch=
First launch will create server home folder and default server_config.sii.
By default server/game home directories are:Windows: c:\Users\XXX\Documents\American Truck Simulator\ c:\Users\XXX\Documents\Euro Truck Simulator 2\Linux: ~/.local/share/American Truck Simulatordirectory is configured to point at the [[Documentation/ ~Engine/Game_user_path|Game User Path]].local/share/Euro Truck Simulator 2/
This location can be changed with -homedir start up parameter, however it must be changed for both game and server.
=Required files to run dedicated server=
In the server/game home folder the following files are used to set up a dedicated server session:
'''server_config.sii'''
* contains session description and configuration, connections ports info, logon token and list of moderators
* ports and logon token must be different for each session instance running at the same time
* default configuration, which is generated automatically with on first launch</nowiki>
'''server_packages.sii'''
* contains map details, dlc and mods configuration</nowiki>
'''server_packages.dat'''
* contains internal map data
server_packages.sii and server_packages.dat must be generated manually via calling the `export_server_packages` command while normal game is running. Generated configuration will mirror your game configuration. These files are necessary for a dedicated server to start. If you are running a server without the base game being installedon it, you have to manually copy these files to the server home directory.
These files are NOT linked to your account in any way.
=Data requirements=
Dedicated server does not require any additional dlc DLC or mod data. Everything needed is handled via server_packages.sii and server_packages.dat files. It is not required to copy any additional files. As the dedicated server does not use steam clientthe Steam Client, it cannot access the workshop.
=Network address translation (NAT)=
=Ports setup=
`'''connection_virtual_port` ''' and `'''query_virtual_port` ''' are virtual ports used for connection to server. Allowed range is <100,200>.`connection_dedicated_port` '''connection_dedicated_portand''' and `'''query_dedicated_port` ''' are physical ports used by steam the Steam game server api to fill sessions browser. For LAN games query_dedicated_port has be in range of <27015,27020>. 
For port forwarding both TPP/IP and UPD rules are required.
By default, whenever a dedicated server is launched it is using an anonymous account. For such an account non-persistent server id is generated (used for direct search). To avoid this you can acquire a logon token on https://steamcommunity.com/dev/managegameservers (game ownership is required). This token has to be placed into server_config.
Use the game appID to generate token, not the server appID!
Example:
moderator_list[1]: 234567891
where 123456789 is the moderator steam 's Steam id
=Quality of life=
Any player who is a moderator can now change the game time or disable rain. This can be done via chat message box by sending a message containing an admin command.
Available admin commands are
/set_time <HH:MM>
=Troubleshooting=
In game server home folder server.log.txt and server.crash.txt (when server crashes) files can be found to help solve any issue with a dedicated server.
=Known issues=
[MP] Session closing
It is caused by steam lossing Steam losing connection. This can happen when internet connection is lost, or when the computer switches to sleep mode.Other reason Will be fixed in next patch. =Server config paramaters=  lobby_name: "Euro Truck Simulator 2 server" // Session name, limited to 63 characters. description: "" // Session description, limited to 63 characters. welcome_message: "" // Session welcome message, limited to 127 characters. password: "" // Session password, limited to 63 characters. max_players: 8 // Maximum players in session, limit is 8 players. max_vehicles_total: 100 max_ai_vehicles_player: 50 max_ai_vehicles_player_spawn: 50 connection_virtual_port: 100 query_virtual_port: 101 connection_dedicated_port: 27015 query_dedicated_port: 27016 server_logon_token: 6544F7E034119F113526E96474F // Token for game server login (persistent account). player_damage: true // Flag if player can receive damage from other players. traffic: true // Flag if traffic is enabled. hide_in_company: false // Flag if remote player are under investigationhidden in company area. hide_colliding: true // Flag to hide colliding vehicle after teleport. force_speed_limiter: false // Flag to force speed limiter. mods_optioning: false // Flag to enable mods marked as optional, to be really optional. timezones: 2 // Values 0 - 2. service_no_collision: false // Disable collisions on service area. in_menu_ghosting: false // Disable collisions when game paused. name_tags: true // Show player name tags above vehicles. friends_only: false // Not used for dedicated server. show_server: true // Not used for dedicated server. moderator_list: 2 // Default moderators. moderator_list[0]: 123456789 // User steam id. moderator_list[1]: 234567891 // User steam id.
67
edits

Navigation menu