Server configuration

The server reads one JSON file, server.json. This page lists every setting, the command-line flags, the ports and how to start the server. For the first start see Make your own server.

Rules of the file

Settings

KeyTypeDefaultMeaning
nametextSixL serverThe server name shown in the server list. Scripts can read it as mp.config.name.
gamemodetextfreeroamThe game mode name shown in the server list.
maxPlayersinteger1000The player limit, shown in the list. Joins are refused with full when the players online plus join tokens not yet used reach it.
languagetextenThe server's language as a BCP 47 tag (en, ru, pt-BR ...), shown in the server list as its language.
announcetrue or falsefalseKept and given to scripts as a server setting; the server does not act on it. Listing the server in the lobby is controlled by lobbyToken.
urltextemptyThe server's web address. Kept and given to scripts as a server setting; the server does not act on it.
bindtext0.0.0.0Only reported to scripts as mp.config.bind. It does not choose the listening address: use bindAddress.
gamePortinteger31130The game port. See Ports.
gameShardCountinteger2The number of game shards (UDP ports). At least 1. More players need more shards; 20 is fine.
bindAddresstext127.0.0.1The address the entry, the game shards and voice listen on. 127.0.0.1 means this computer only; 0.0.0.0 means every network interface (needed for players on the internet); or one address.
streamingRangenumber (metres)200How far players see each other and other entities: they stream in within this distance and out beyond it. Values are clamped to 1 .. 300.
sharedAddresseslist of textemptyAddresses that many players share, for example a gateway that translates their addresses. The server-list rate limits treat such an address like a local one instead of as a single client. Bans are never by address.
bridgePortinteger31151The local TCP port for the connection between the server and the script host. Always on loopback. The local stop and status endpoint uses the next port, bridgePort + 1.
lobbyTokentextemptyThe token the SixL lobby gave when the server was registered (it starts with sixl_srv_). A server with a token reports itself to the lobby every 30 seconds and appears in the list; an empty token means the server is not listed. Keep the token out of shared files: it is the server's identity in the lobby.
serverKeyPathtextemptyThe file of the server's own encryption key for the game port: players' clients join over an encrypted connection and accept only this key, which the lobby lists with the server. Empty means server-key.pfx next to server.json; the environment variable SIXL_SERVER_KEY_PATH overrides it. The server makes the key on its first start: keep the file (back it up with server.json). Only the server's account may read it: on Linux the server creates it readable by its account only and warns when it is not; on Windows it takes the permissions of its folder, so keep the server's folder closed to other accounts, as for server.json. In Docker put it on a volume (the example compose file does). If the file cannot be kept, the server runs without encryption and says why in its log.
requireEncryptedSessionstrue/falsefalseRefuse every player whose client does not encrypt the game traffic. Clients that support it encrypt the whole session (positions, chat, voice, callRemote and player.call data) on a server with a key (serverKeyPath); older clients play unencrypted beside them. Turned on, older clients get the "update your client" refusal instead. Turn it on only when your players have updated. Without a kept key every join is refused, and the server says so in its log.
lobbyUrltexthttp://lobby.sixlThe lobby address used for the report. Leave as is.
lobbyProxytexthttp://127.0.0.1:31128The local gateway through which the report reaches the lobby (the Windows archive starts it for you). Leave as is.
lobbyKeystextemptyThe lobby's public keys that let the server verify player logins: a path to a JSON file, or the JSON text itself. Empty means the file lobby-keys.json next to server.json. See Player logins.
publicAddresstextemptyThe public address of a server that is not registered in the lobby, as host:port: lower-case host, an IPv6 address in square brackets, an international name in its ASCII (punycode) form. See Player logins. An address in another form is ignored with a warning.
logLeveltextInformationTrace, Debug, Information, Warning or Error. Any other value means Information.
resourcesobjectsee belowThe client scripts the server gives to players; see Resources and packages.
nodeobjectsee belowThe script host.
chatobjectsee belowThe server's limit on each player's chat lines and commands.

resources

KeyDefaultMeaning
sourceDirclient_packagesThe folder with the client scripts and files players download. A missing folder means the server has no client resources.
buildDirbuild/client_packagesWhere the server builds what it serves. Must be a folder of its own, outside sourceDir: the server writes and deletes files there. It accepts only an empty folder or an earlier build; anything else stops the server with an error and nothing is touched.
maxFileBytes33554432 (32 MiB)A bigger file is left out of the build, with a warning.
maxFiles5000When there are more files, the rest are left out, with a warning.
watchtrueRebuild shortly (half a second) after sourceDir changes. Players who join later get the new files.

Relative paths are relative to the server's working directory.

node

KeyDefaultMeaning
enabledtrueStart the script host. false runs the server without scripts.
executablenodeThe Node.js program. A plain name is searched in PATH; an absolute path must exist.
scriptsPath../nodeThe folder that holds the script host (index.js) and the packages folder with your server packages.
entryPointindex.jsThe script host's file inside scriptsPath.
traceWarningstrueStart Node.js with --trace-deprecation --trace-warnings.
nodeArgsnoneExtra arguments for Node.js, for example --inspect.

If the script host stops, the server stops too. The server does not restart it.

chat

The game client already sends at most 5 lines in 3 seconds and cuts a line to 256 characters, but a modified client can send as fast as it likes. The server counts each player's chat lines and commands together; a line over the count is dropped before playerChat or playerCommand, and the log gets one line per player per window ([Chat] player <id> sends more than ...), not one per dropped line. A longer line is cut, not dropped. The defaults are looser than the client's, so an honest player never reaches them.

KeyDefaultMeaning
maxLines10Lines (chat and commands together) one player may send per window. 0 turns the count off.
windowMs3000The window in milliseconds; it slides (the last windowMs before each line).
maxLength256The longest line passed to scripts, in UTF-16 units (as JavaScript's length); a longer one is cut. 0 turns the cut off.

A small example

{
      "name": "My first server",
      "maxPlayers": 50,
      "language": "en",
      "bindAddress": "0.0.0.0",
      "streamingRange": 200,
      "lobbyToken": ""
    }

Ports

All ports follow from gamePort (31130 by default):

PortProtocolSettingPurposeOpen to players?
gamePort (31130)TCPgamePortThe entry: server information, the download of client scripts and the joinYes
gamePort + 1 (31131)UDPgamePortVoiceYes
gamePort + 2 ... (31132, 31133)UDPgameShardCountThe game shards: one port per shardYes, as many as shards
31128TCPlobbyProxyThe local gateway to the lobbyNever
bridgePort (31151)TCPbridgePortServer to script hostNever (loopback only)
bridgePort + 1 (31152)TCPbridgePortLocal stop and statusNever (loopback only)

Player logins

Players can join as guests or with a SixL lobby account. The server checks a login offline: the lobby signs a short-lived token, and the server verifies it with the lobby's public keys from lobbyKeys. The player also signs a one-time challenge issued by your server, so a modified client cannot claim someone else's account. Any failure makes the player a guest.

The server archive ships the keys file next to the example configuration.

Command-line flags

Flags override server.json.

FlagOverridesMeaning
--config <file>the file nameRead this file instead of server.json.
--port <n>gamePortThe game port.
--shards <n>gameShardCountThe number of game shards.
--bridge-port <n>bridgePortThe bridge port.
--no-nodenode.enabledDo not start the script host.
--log-level <level>logLevelThe log level.
-v, --verboselogLevelThe same as --log-level Trace.
--node-args <text>node.nodeArgsExtra arguments for Node.js.
--log-dir <folder>noneWhere server.log is written.

Environment variable

One variable is meant for server owners:

The server does not read any other variable for its settings.

Logs

Everything the server and the script host write to the console is also appended to logs/server.log. At each start the previous file is renamed to server.1.log, that one to server.2.log and so on up to server.9.log, so the current run and the nine before it are kept. If the folder cannot be written the server says so and runs with the console only. When the server dies, the reason is written first as a FATAL: line. A normal stop exits with code 0.

Starting and stopping

Windows

Unpack the server archive anywhere and run start-server.cmd. It starts the local gateway to the lobby, then the server in the same window; logs go to the logs folder. On the first start server.json.example is copied to server\server.json: edit it (name, maxPlayers, lobbyToken) and start again to apply changes. Nothing needs to be installed: the server, Node.js and the gateway are in the archive. Stop the server with Ctrl+C.

Linux

The server for Linux comes as a container image with an example compose.yml and server.json.example. Put these next to each other:

The package is one file, SixL-Server-linux-<version>.tar.gz, on the lobby site's /download/ page (the page of the launcher: over Tor or I2P), with its .sha256 and .sig beside it. Check it as Check the download shows for the launcher zip: the same commands, with the package's file name in the signed text. Then unpack it (tar -xzf SixL-Server-linux-<version>.tar.gz): it holds the two image files (sixl-server-<version>.image.tar.gz and sixl-gateway-<version>.image.tar.gz), compose.yml, server.json.example, lobby-keys.json and the types folder.

Load each image that comes with the release (docker load -i <image file>), tag it with the name the compose file expects (sixl-server:current; the gateway image sixl-gateway:current the same way), and run:

docker compose up -d

docker compose logs -f shows the log and docker compose down stops the server. The container publishes TCP 31130, UDP 31131 and UDP 31132-31133 (raise the last range together with gameShardCount). The file system of the container is read-only; the log is kept in a volume. If the script host stops, the container restarts. The lobby gateway runs as a second service of the same compose file and stays inside the container network: never publish its port.

Check that it runs

Open http://127.0.0.1:31130/info in a browser on the same computer: the server answers with its name, the number of players, the player limit, the protocol version, the game mode and the language. In the launcher use "Connect by address" with 127.0.0.1:31130.

Stopping from the same computer

A request to http://127.0.0.1:31152/shutdown stops the server gracefully, and http://127.0.0.1:31152/status returns a small summary (counts of players, vehicles, objects and peds, uptime, memory). The port is bridgePort + 1; use it from the same computer only. Scripts' serverShutdown handlers have about 0.2 seconds before the process stops.

Registering the server in the lobby

  1. Open the lobby in the launcher and sign in (Sign in; Sign up / Create account if you have no account yet).
  2. Open the Brands tab and press Register a brand. Enter the name (3-32 characters; the form shows Available or Taken: ... while you type) and an optional description, then press Register. You become the brand's owner and its page opens.
  3. On the brand's page, in the Servers section, fill in the form (only the owner and the brand's admins see it): Server name, the address host:port (for example play.example.com:31130, the TCP entry), tags separated by commas and a description. Press Add server. The form reminds you which ports to open: TCP 31130, UDP 31131 and UDP 31132 and up.
  4. The page shows the token (sixl_srv_...) in a box titled "Token of the server ... - shown only once". Copy it into lobbyToken in server.json, restart the server, then press Saved it, hide. The token cannot be shown again.
  5. To replace a lost or leaked token, press New token next to the server. In the dialog type the server's name to confirm and choose Gracefully (the old token keeps working for 24 hours, or until the server signs in with the new one) or At once (the old token stops now and the server drops off the list until you put the new token into server.json), then press Reissue the token.

The server is listed as online after its first report (they repeat every 30 seconds), with its players, maxPlayers and language.