ServerConfiguration: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Server Configuration}}
{{DISPLAYTITLE:Server Configuration}}
== Summary ==
== Summary ==
The default server configuration file is named <code>server.xml</code>, and is located in the same folder as the file named <code>Server.exe</code> on Windows x86, <code>Server_x64.exe</code> on Windows x64, or <code>Server</code> on Linux.<br>
The server configuration file is named <code>server.xml</code> by default, and is located in the same folder as the file named <code>Server.exe</code> on Windows or <code>Server</code> on Linux.<br>
You can use a custom server configuration file with the <code>-config</code> option. Example: <code>Server.exe -config my-config.xml</code>. See the [[ServerCommandArguments|server command arguments]] page for more info on accepted command arguments.
You can use a custom filename for the server configuration file with the <code>-config</code> option. Example: <code>Server.exe -config my-config.xml</code>. See the [[ServerCommandLine|server command line]] page for more info on accepted command arguments.<br>
The file uses the XML syntax, with a root node named <code>server</code>.<br>
The file uses the XML syntax, with a root node named <code>server</code>. [https://www.w3.org/TR/xml/ Official XML Specification]
[https://www.w3.org/TR/xml/ Official XML Specification]


== Settings ==
== Settings ==
It's best practice to specify all or most of these properties in your server config XML. The corresponding default value will be used if the property is not specified.<br>
{| class="wikitable"
{| class="wikitable"
!Server Property Name
!Server Property Name
Line 12: Line 13:
!Description
!Description
|-
|-
|compresspackets
|anticheat
|false
|(empty node)
|The status of whether packets are compressed. This is only available in GTAC versions 1.0.66 and newer.
|Anti cheat. See [[Anticheat|Anticheat]] for more information.
|-
|bindip
|(empty string)
|Forces the server to use a specific IP. Only for hosts that have multiple IP addresses.
|-
|cvar
|(individual default values)
|Sets a server's cvar value. See [[CVars|CVars]] for more information.
|-
|-
|duplicatenames
|duplicatenames
Line 21: Line 30:
|-
|-
|game
|game
|gta:iii ('''required''')
|gta:iii
|The identifier of the game that the server should run for. See [[GameIdentifiers|game identifiers]] for more information.
|The identifier of the game that the server should run for. See [[GameIdentifiers|game identifiers]] for more information.
|-
|-
|gamemode
|gamemode
|n/a ('''required''')
|n/a ('''required''')
|The name of the game mode, which appears in the server browser.
|Custom text to identify the game mode. Appears in the server browser. '''This is not IV gamemode ID'''.
|-
|-
|httpport
|httpport
Line 34: Line 43:
|httpserver
|httpserver
|true
|true
|Whether or not to run the HTTP server. If you don't run it, you'll need to host the HTTP server elsewhere, with the port found in httpport.
|Whether or not to run the [[HTTPServer|HTTP server]].
|-
|-
|httpurl
|httpurl
|"" (empty string)
|(empty string)
|A URL (like a CDN) containing the server's client resource files and scripts. Clients will download them from that URL instead of the server.
|A URL (like a CDN) containing the server's client resource files and scripts. Clients will download them from that URL instead of the server.
|-
|iv_episode
| -1
|Sets the DLC to use for IV. See [[Resources/GTAIV/Episodes|IV Episodes]] for more information.
|-
|iv_gamemode
|8
|Sets the built-in gamemode for IV. See [[Resources/GTAIV/GameModes|IV Gamemodes]] for more information.
|-
|iv_nativemultiplayer
|true
|If enabled, server uses native sync (from Rockstar/GFWL), otherwise server uses GTAC's custom sync.
|-
|-
|logpath
|logpath
|"" (empty string)
|(empty string)
|The path to store the server logs. Leave blank to not use server logs.
|The path to store the server logs. Leave blank to not use server logs.
|-
|-
|logtimestamp
|logtimestamp
|"" (empty string)
|%d/%m/%Y - %X
|The timestamp format to use in the log files. Based on the [http://cplusplus.com/reference/clibrary/ctime/strftime/ strftime] format from C++. Some examples:
|The timestamp format to use in the log files. Based on the [http://cplusplus.com/reference/clibrary/ctime/strftime/ strftime] format from C++. Some examples:
<code>[%H:%M:%S]</code> This displays only the time<br>
<code>[%H:%M:%S]</code> This displays only the time.<br>
<code>[%d/%m/%Y %H:%M:%S]</code> This would display the date in dd/mm/yyyy format followed by the time in hour:minute:second format.  
<code>[%d/%m/%Y %H:%M:%S]</code> This would display the date in dd/mm/yyyy format followed by the time in hour:minute:second format.  
|-
|-
|maxplayers
|maxplayers
|32
|32
|The maximum amount of players that can connect to the server, between 0 and 256.
|The maximum amount of players that can connect to the server, between 0 and 127.
|-
|-
|minclientversion
|minclientversion
|1.0.0
|1.0.0.0
|The minimum version that clients can connect with.
|The minimum version that clients can connect with. Between 1 and 4 dot-delimited tokens. [https://gtaconnected.com/downloads/client/version See latest client version here].
|-
|minuteduration
|2.0 for IV, otherwise 1.0
|The amount of seconds for an in-game minute.
|-
|-
|modules
|modules
Line 62: Line 87:
|The modules to load. Use the <code>&lt;module&gt;</code> tag inside the <code>&lt;modules&gt;</code> tag, for each module to load, including the <code>src</code> attribute for the directory path.
|The modules to load. Use the <code>&lt;module&gt;</code> tag inside the <code>&lt;modules&gt;</code> tag, for each module to load, including the <code>src</code> attribute for the directory path.
|-
|-
|packetcompressionlevel
|multithreaded
|default
|false
|The compression level for compressed packets, between 0 and 9, or the word default. Default is 6 ([https://www.zlib.net/manual.html ZLib's Z_DEFAULT_COMPRESSION])
|Enables/disables using multiple threads for managing network peers. Useful on multi-core systems.
|-
|-
|password
|password
|"" (empty string)
|(empty string)
|The password to connect to the server.
|The password to connect to the server.
|-
|-
Line 76: Line 101:
|pickupstreamoutdistance
|pickupstreamoutdistance
|100.0
|100.0
|The distance that a pickup is removed from the client, recommended to be about 100.0.
|The distance that a pickup is removed from the client, recommended to be about 100.0. '''Must be higher than pickupstreamindistance'''.
|-  
|-
|port
|port
|22000
|22000
|The port for the server to listen on, between 0 and 65,535. Players only need to know the port if using the /connect command in-game, not when using the server browser.
|The port for the server to listen on, between 0 and 65,535. Players only need to know the port if using the /connect command in-game, not when using the server browser.
|-
|processinterval
|50
|The interval, in milliseconds, of each process-once occurrence, between 0 and 65,535.
|-
|-
|rcon
|rcon
|false
|false
|The status of whether the server will host the remote console service, use true or false.
|'''[Inoperable]''' The status of whether the server will host the remote console service.
|-
|-
|rconpassword
|rconpassword
|"" (empty string)
|(empty string)
|The password to connect to the remote console service.
|The password to connect to the remote console service.
|-
|rconport
|23000
|The port to host the remote console service on.
|-
|-
|resources
|resources
|(empty node)
|(empty node)
|The resources to load. Use the <code>&lt;resource&gt;</code> tag inside the <code>&lt;resources&gt;</code> tag, for each resource to load, including the <code>src</code> attribute for the directory path.
|The [[Resources|resources]] to load. Use the <code>&lt;resource&gt;</code> tag inside the <code>&lt;resources&gt;</code> tag, for each resource to load, including the <code>src</code> attribute for the directory path.
|-
|rule
|(empty string)
|Adds a server rule. See [[ServerRules|server rules]] for more info.
|-
|-
|serverbrowser
|serverbrowser
Line 105: Line 134:
|n/a ('''required''')
|n/a ('''required''')
|The name of the server, which appears in the server browser.
|The name of the server, which appears in the server browser.
|-
|serverquery
|true
|The enabled status of UDP server queries.
|-
|-
|streamindistance
|streamindistance
|100.0
|100.0
|The distance that an entity is sent to the client, recommended to be about 100.0.
|The distance that an entity is sent to a client, recommended to be about 100.0 mainly because of game limits.
|-
|-
|streamoutdistance
|streamoutdistance
|200.0
|200.0
|The distance that an entity is removed from the client, recommended to be about 200.0.
|The distance that an entity is removed from a client, recommended to be about 200.0. '''Must be higher than streamindistance'''.
|-
|-
|syncinterval
|syncinterval
|30
|30
|The interval, in milliseconds, of each sync occurrence for the regularly sync'd data, between 0 and 65,535.
|The interval, in milliseconds, of each sync occurrence for the regularly sync'd data, between 0 and 65,535.
|-
|synclocalentities
|false
|Whether to sync local entities to other players (objects and entities created by a client and sent to server)
|-
|-
|syncmethod
|syncmethod
|interval
|interval
|The sync type for regularly sync'd data. Use none, interval, replay, or peer2peer. (See sync methods section below)
|The sync type for regularly sync'd data. Use none, interval, or replay. (See sync methods section below.)
|-
|-
|cvar
|syncpacketpriority
|null
|low
|Sets a server's cvar value (See cvars section for accepted cvars)
|The priority of sync packets. Use low, medium, high, or immediate.
|-
|-
|bindip
|syncpacketreliable
|true
|false
|Forces the server to use a specific IP. Only for hosts that have multiple IP addresses.
|Flags to bitwise-OR with for reliable packets.
|-
|-
|iv_gamemode
|syncpacketunsequenced
|30
|false
|Sets the built-in gamemode for IV. See [[Resources/GTAIV/GameModes|IV Gamemodes]] for more information.
|Flags to bitwise-OR with for unsequenced packets.
|-
|iv_episode
|0
|Sets the DLC to use for IV. See [[Resources/GTAIV/Episodes|IV Episodes]] for more information
|-
|-
|timesync
|timesync
|false
|true
|Enables/disables syncing the time set by server to all clients
|Enables/disables syncing the time set by server to all clients.
|-
|-
|weathersync
|weathersync
|false
|true
|Enables/disables syncing the weather set by server to all clients
|Enables/disables syncing the weather set by server to all clients.
|-
|-
|rule
|streaminterval
|"" (empty string)
|1000
|Adds a server rule. See [[ServerRules|server rules]] for more info.
|The interval, in milliseconds, between checking if elements should be streamed in/out for players, between 500-5000.
|-
|-
|multithreadednetworking
|false
|Enables/disables using multiple threads for managing network peers. Useful on multi-core systems.
|}
|}


Line 162: Line 192:
{{ServerSyncMethods}}
{{ServerSyncMethods}}


== Sync Priority ==
== Optional Settings ==
There are a few different config options for sync packet priority. Here is the list of them and a brief description of each.
 
{| class="wikitable"
Most of the XML server config settings are optional, and have a default value used if not specified.<br>
!Name
The "Default Value" column in the settings list shows "required" if the setting is required.<br>
!Description
To explicitly not specify a server config XML setting, either remove that setting's XML element, or comment it out with an XML comment.<br>
|-
Do not leave a setting's XML element present with a blank value.
|immediate
 
|Sends sync immediately without delay
== IV Settings ==
|-
 
|high
Server config settings <code>iv_episode</code>, <code>iv_gamemode</code>, and <code>iv_nativemultiplayer</code>, are all optional to be specified in the server config XML file. Check the list above for default values.<br>
|Sends sync twice as much as medium (if both levels are waiting to be sent)
 
|-
'''When <code>iv_nativemultiplayer</code> is <code>false</code>:'''
|medium
 
|Sends sync twice as much as low (if both levels are waiting to be sent)
<code>iv_episode</code> and <code>iv_gamemode</code>  are ignored, whether they are specified or not.
|-
 
|low
'''When <code>iv_nativemultiplayer</code> is <code>true</code>:'''
|Sends sync with the lowest priority
 
|}
<code>iv_episode</code> and <code>iv_gamemode</code> are acknowledged and used if specified, or their default values are used if not specified.<br><br>
<code>iv_gamemode -1</code><br>
This means that an internal IV gamemode is not used, and that a sandboxed scripting environment is preferred.<br>
A script will need to be present to fade the camera in and spawn the player, via scripting functions [[fadeCamera|fadeCamera]] and [[spawnPlayer|spawnPlayer]].<br><br>
<code>iv_gamemode 30</code><br>
This is an outdated value for <code>iv_gamemode</code>, and should not be used. Please use <code>-1</code> instead.<br>
Using <code>iv_gamemode</code> with a value of <code>30</code>, is different than using <code>iv_gamemode</code> with a value of <code>-1</code>.<br>
This setting value is currently left in for backward compatibility, however may become obsolete in the future.
 
== Example ==
<source>
<server>
<!-- General Information -->
<servername>Default Server</servername>
<game>gta:iii</game>
<gamemode>Free Roam</gamemode>
<serverbrowser>true</serverbrowser>
<maxplayers>32</maxplayers>
<password></password>
<minclientversion>1.5.0</minclientversion>
<duplicatenames>false</duplicatenames>
 
<!-- Networking -->
<port>22000</port>
<httpport>22000</httpport>
<httpserver>true</httpserver>
<streaminterval>1000</streaminterval>
<syncinterval>30</syncinterval>
<syncmethod>interval</syncmethod>
<synclocalentities>true</synclocalentities>
 
<!-- Element Streaming -->
<streamindistance>200</streamindistance>
<streamoutdistance>250</streamoutdistance>
<pickupstreamindistance>30</pickupstreamindistance>
<pickupstreamoutdistance>50</pickupstreamoutdistance>
 
<!-- Logging -->
<logpath>logs</logpath>
<logtimestamp>[%d/%m/%Y - %X]</logtimestamp>
 
<!-- GTA IV -->
<!-- https://wiki.gtaconnected.com/Resources/GTAIV/GameModes -->
<!-- https://wiki.gtaconnected.com/Resources/GTAIV/Episodes -->
<iv_gamemode>8</iv_gamemode>
<iv_episode>-1</iv_episode>
 
<!-- Modules -->
<!-- https://wiki.gtaconnected.com/Modules -->
<modules>
</modules>
 
<!-- Global CVars -->
<!-- https://wiki.gtaconnected.com/CVars -->
<cvar name="nametags" value="1" />
<cvar name="gunshops" value="1" />
<cvar name="uniquestuntjumps" value="1" />
<cvar name="stuntjumps" value="1" />
<cvar name="stauntontoiletcamera" value="1" />
<cvar name="gates" value="1" />
<cvar name="trains" value="1" />
<cvar name="planes" value="1" />
<cvar name="maximumwantedlevel" value="6" />
<cvar name="defaultparkedcars" value="1" />
<cvar name="ambulances" value="1" />
<cvar name="traffic" value="1" />
<cvar name="civilians" value="1" />
<cvar name="defaultpickups" value="1" />
<cvar name="singleplayer" value="1" />
<cvar name="bigmap" value="1" />
<cvar name="iv_playerwalking" value="0" />
<cvar name="iv_scenariopeds" value="1" />
<cvar name="iv_randomcops" value="1" />
 
<!-- Rules -->
<!-- https://wiki.gtaconnected.com/ServerRules -->
<rule name="Owner" value="Nobody" />
<rule name="Website" value="https://gtaconnected.com" />
 
<!-- Resources -->
<!-- https://wiki.gtaconnected.com/Resources -->
<resources>
<resource src="freeroam" />
</resources>
</server>
</source>

Latest revision as of 17:36, 22 March 2024

Summary

The server configuration file is named server.xml by default, and is located in the same folder as the file named Server.exe on Windows or Server on Linux.
You can use a custom filename for the server configuration file with the -config option. Example: Server.exe -config my-config.xml. See the server command line page for more info on accepted command arguments.
The file uses the XML syntax, with a root node named server. Official XML Specification

Settings

It's best practice to specify all or most of these properties in your server config XML. The corresponding default value will be used if the property is not specified.

Server Property Name Default Value Description
anticheat (empty node) Anti cheat. See Anticheat for more information.
bindip (empty string) Forces the server to use a specific IP. Only for hosts that have multiple IP addresses.
cvar (individual default values) Sets a server's cvar value. See CVars for more information.
duplicatenames false The status of whether to allow players with duplicate names.
game gta:iii The identifier of the game that the server should run for. See game identifiers for more information.
gamemode n/a (required) Custom text to identify the game mode. Appears in the server browser. This is not IV gamemode ID.
httpport 22000 The port for the server to transfer HTTP data on, between 0 and 65,535.
httpserver true Whether or not to run the HTTP server.
httpurl (empty string) A URL (like a CDN) containing the server's client resource files and scripts. Clients will download them from that URL instead of the server.
iv_episode -1 Sets the DLC to use for IV. See IV Episodes for more information.
iv_gamemode 8 Sets the built-in gamemode for IV. See IV Gamemodes for more information.
iv_nativemultiplayer true If enabled, server uses native sync (from Rockstar/GFWL), otherwise server uses GTAC's custom sync.
logpath (empty string) The path to store the server logs. Leave blank to not use server logs.
logtimestamp %d/%m/%Y - %X The timestamp format to use in the log files. Based on the strftime format from C++. Some examples:

[%H:%M:%S] This displays only the time.
[%d/%m/%Y %H:%M:%S] This would display the date in dd/mm/yyyy format followed by the time in hour:minute:second format.

maxplayers 32 The maximum amount of players that can connect to the server, between 0 and 127.
minclientversion 1.0.0.0 The minimum version that clients can connect with. Between 1 and 4 dot-delimited tokens. See latest client version here.
minuteduration 2.0 for IV, otherwise 1.0 The amount of seconds for an in-game minute.
modules (empty node) The modules to load. Use the <module> tag inside the <modules> tag, for each module to load, including the src attribute for the directory path.
multithreaded false Enables/disables using multiple threads for managing network peers. Useful on multi-core systems.
password (empty string) The password to connect to the server.
pickupstreamindistance 50.0 The distance that a pickup is sent to the client, recommended to be about 50.0.
pickupstreamoutdistance 100.0 The distance that a pickup is removed from the client, recommended to be about 100.0. Must be higher than pickupstreamindistance.
port 22000 The port for the server to listen on, between 0 and 65,535. Players only need to know the port if using the /connect command in-game, not when using the server browser.
rcon false [Inoperable] The status of whether the server will host the remote console service.
rconpassword (empty string) The password to connect to the remote console service.
rconport 23000 The port to host the remote console service on.
resources (empty node) The resources to load. Use the <resource> tag inside the <resources> tag, for each resource to load, including the src attribute for the directory path.
rule (empty string) Adds a server rule. See server rules for more info.
serverbrowser false The status of whether to show the server in the server browser, use true or false.
servername n/a (required) The name of the server, which appears in the server browser.
serverquery true The enabled status of UDP server queries.
streamindistance 100.0 The distance that an entity is sent to a client, recommended to be about 100.0 mainly because of game limits.
streamoutdistance 200.0 The distance that an entity is removed from a client, recommended to be about 200.0. Must be higher than streamindistance.
syncinterval 30 The interval, in milliseconds, of each sync occurrence for the regularly sync'd data, between 0 and 65,535.
synclocalentities false Whether to sync local entities to other players (objects and entities created by a client and sent to server)
syncmethod interval The sync type for regularly sync'd data. Use none, interval, or replay. (See sync methods section below.)
syncpacketpriority low The priority of sync packets. Use low, medium, high, or immediate.
syncpacketreliable false Flags to bitwise-OR with for reliable packets.
syncpacketunsequenced false Flags to bitwise-OR with for unsequenced packets.
timesync true Enables/disables syncing the time set by server to all clients.
weathersync true Enables/disables syncing the weather set by server to all clients.
streaminterval 1000 The interval, in milliseconds, between checking if elements should be streamed in/out for players, between 500-5000.

CVars

See the CVars page for info.

Sync Methods

There are a few different config options for server sync. Here is the list of them and a brief description of each.

Name Description
none Disables element sync entirely. Not recommended for multiplayer environments.
replay This will sync elements as soon as they're processed. If CPU usage is too busy and processing is slow, sync will be too.
interval Default. This forces sync of elements at a specified interval. Use <syncinterval> in server config to set the interval time in milliseconds (ms)

Optional Settings

Most of the XML server config settings are optional, and have a default value used if not specified.
The "Default Value" column in the settings list shows "required" if the setting is required.
To explicitly not specify a server config XML setting, either remove that setting's XML element, or comment it out with an XML comment.
Do not leave a setting's XML element present with a blank value.

IV Settings

Server config settings iv_episode, iv_gamemode, and iv_nativemultiplayer, are all optional to be specified in the server config XML file. Check the list above for default values.

When iv_nativemultiplayer is false:

iv_episode and iv_gamemode are ignored, whether they are specified or not.

When iv_nativemultiplayer is true:

iv_episode and iv_gamemode are acknowledged and used if specified, or their default values are used if not specified.

iv_gamemode -1
This means that an internal IV gamemode is not used, and that a sandboxed scripting environment is preferred.
A script will need to be present to fade the camera in and spawn the player, via scripting functions fadeCamera and spawnPlayer.

iv_gamemode 30
This is an outdated value for iv_gamemode, and should not be used. Please use -1 instead.
Using iv_gamemode with a value of 30, is different than using iv_gamemode with a value of -1.
This setting value is currently left in for backward compatibility, however may become obsolete in the future.

Example

<server>
	<!-- General Information -->
	<servername>Default Server</servername>
	<game>gta:iii</game>
	<gamemode>Free Roam</gamemode>
	<serverbrowser>true</serverbrowser>
	<maxplayers>32</maxplayers>
	<password></password>
	<minclientversion>1.5.0</minclientversion>
	<duplicatenames>false</duplicatenames>

	<!-- Networking -->
	<port>22000</port>
	<httpport>22000</httpport>
	<httpserver>true</httpserver>
	<streaminterval>1000</streaminterval>
	<syncinterval>30</syncinterval>
	<syncmethod>interval</syncmethod>
	<synclocalentities>true</synclocalentities>

	<!-- Element Streaming -->
	<streamindistance>200</streamindistance>
	<streamoutdistance>250</streamoutdistance>
	<pickupstreamindistance>30</pickupstreamindistance>
	<pickupstreamoutdistance>50</pickupstreamoutdistance>

	<!-- Logging -->
	<logpath>logs</logpath>
	<logtimestamp>[%d/%m/%Y - %X]</logtimestamp>

	<!-- GTA IV -->
	<!-- https://wiki.gtaconnected.com/Resources/GTAIV/GameModes -->
	<!-- https://wiki.gtaconnected.com/Resources/GTAIV/Episodes -->
	<iv_gamemode>8</iv_gamemode>
	<iv_episode>-1</iv_episode>

	<!-- Modules -->
	<!-- https://wiki.gtaconnected.com/Modules -->
	<modules>
	</modules>

	<!-- Global CVars -->
	<!-- https://wiki.gtaconnected.com/CVars -->
	<cvar name="nametags" value="1" />
	<cvar name="gunshops" value="1" />
	<cvar name="uniquestuntjumps" value="1" />
	<cvar name="stuntjumps" value="1" />
	<cvar name="stauntontoiletcamera" value="1" />
	<cvar name="gates" value="1" />
	<cvar name="trains" value="1" />
	<cvar name="planes" value="1" />
	<cvar name="maximumwantedlevel" value="6" />
	<cvar name="defaultparkedcars" value="1" />
	<cvar name="ambulances" value="1" />
	<cvar name="traffic" value="1" />
	<cvar name="civilians" value="1" />
	<cvar name="defaultpickups" value="1" />
	<cvar name="singleplayer" value="1" />
	<cvar name="bigmap" value="1" />
	<cvar name="iv_playerwalking" value="0" />
	<cvar name="iv_scenariopeds" value="1" />
	<cvar name="iv_randomcops" value="1" />

	<!-- Rules -->
	<!-- https://wiki.gtaconnected.com/ServerRules -->
	<rule name="Owner" value="Nobody" />
	<rule name="Website" value="https://gtaconnected.com" />

	<!-- Resources -->
	<!-- https://wiki.gtaconnected.com/Resources -->
	<resources>
		<resource src="freeroam" />
	</resources>
</server>