Skip to main content
Version: latest - a1.7.0 ⚖️

Serverkonfiguration

Alles was du wissen musst, um deinen Server zu konfigurieren!

Server-Konfigurationsdatei

tip

nanos world Config files use TOML (Tom’s Obvious, Minimal Language), please refer to https://github.com/toml-lang/toml for more information and syntax.

Die Server-Konfigurationsdatei Config.toml wird automatisch erzeugt, wenn der Server zum ersten Mal gestartet wird. Diese Datei wird immer mit dem korrekten Muster überschrieben, nachdem der Server geladen wurde.

Config.toml
loading...

Einstellungen detailliert

EinstellungBeschreibung
nameName des Servers
beschreibungBeschreibung des Servers
logoURL des Bildes in der Serverliste anzeigen
max. SpielerMax amount of players allowed to join
passwortPasswort zum Verbinden
ipServer-IP. Wir empfehlen das leer zu lassen
portServer main Port and HTTP Port (UDP/TCP)
query_portServer query Port (UDP)
ankündigenOb in der Server-Liste angekündigt werden soll oder nicht
tick_rateServer Tick in ms. Wir empfehlen es 33 zu belassen
log_levelAuszugebendes Log Level
game_modegame-mode package to load - you can only load one game-mode at once.
lade_screenloading-screen package to load - you can only load one loading-screen at once.
paketescript packages to load
vermögenZusätzliche zu ladende Assets
kartographieWelche Karte zu laden
tokenServer Token used for authorize downloads through CLI
gebannt_ipsListe der gesperrten IPs

Karte & Level

The Map (or Level) is defined in the Server’s config file, this level will be loaded when the player joins the server and the Path is supposed for be or a built-in asset or an asset which is located at Assets/ folder.

nanos world counts on (for now) 4 built-in maps: nanos-world::BlankMap, nanos-world::EmptyMap, nanos-world::OceanMap and nanos-world::TestingMap which can be used in your server without needing to download any Asset Pack.

Server-Konsole

Integrierte Befehle

BefehlBeschreibung
chat [message]Sendet eine Chat-Nachricht
map [map_path]Changes the Map, reloads all Packages and reconnect all Players
stoppenStoppt den Server
package run [package_name] [lua_code]Führt einen Code in einem Paket aus
Paket neu laden [package_name]Lade ein Paket neu
alle neu ladenAlle Pakete neu laden
entlade Paket [package_name]Entlade ein Paket
Paket laden [package_name]Lädt ein Paket

Eigene Befehle

All (non built-in) commands will be sent into an event to the scripting/server-side:

Server/Index.lua
Server.Subscribe("Console", function(my_input)
Package.Log("Console command received: " .. my_input)
Ende)

Parameter der Kommandozeile

Die Server-Konfiguration kann mit Befehlszeilenparametern überschrieben werden. Hinweis: Dies wird nicht in die Config-Datei schreiben.

ParameterWerttypBeschreibung
--NamestringServername
--BeschreibungstringServerbeschreibung
--logostringServer Logo
--passwortstringServerpasswort
--ipstringServer IP
--KartestringKarte zum Laden
--PortnumberServerport
--query_portnumberServer Query port
--kündigen0 oder 1Wenn Ankündigungen in der Hauptliste
--game_modestringServer game-mode
--loading_screenstringServer loading-screen
--packagesstring-ListeServerpakete
--assetsstring-ListeServer assets
--tokenstringServer authorization token
--Maximale SpielernumberMaximal erlaubte Spieler
--speichern0 oder 1Wenn die Parameter in Config.toml gespeichert werden sollen
--profiling0 oder 1Enables Performance Profiling Logs for debugging
--auto_download0 oder 1Automatically downloads Packages and Assets from Vault if needed

One-liner Server Configuration

With Command Line Parameters and Command Line Interface (CLI), it is also possible to automate the full server installation, here's an example:

Shell/Linux
# Installs/Updates the server through SteamCMD
steamcmd +force_install_dir /home/nanos-world-server +login anonymous +app_update "1936830 -beta bleeding-edge" validate +quit

# Installs all needed Packages (this will install needed Assets as well)
./NanosWorldServer.sh --cli install package sandbox battlefield-kill-ui ts-fireworks-tools

# Starts the server with all configs set
./NanosWorldServer.sh --name "nanos world Amazing Sandbox" --description "Awesome Sandbox Server" --map "nanos-world::TestingMap" --gamemode "sandbox" --packages "battlefield-kill-ui,ts-fireworks-tools" --port 7777 --query_port 7778 --max_players 32 --logo "https://i.imgur.com/U1rZp5v.png"

Another shorter example:

Shell/Linux
# Starts the server with all configs set and auto downloads the packages and assets if needed
./NanosWorldServer.sh --name "nanos world Amazing Sandbox" --description "Awesome Sandbox Server" --map "nanos-world::TestingMap" --gamemode "sandbox" --packages "battlefield-kill-ui,ts-fireworks-tools" --port 7777 --query_port 7778 --max_players 32 --auto_download 1 --logo "https://i.imgur.com/U1rZp5v.png"

Common Console Messages and Errors

Server zu stark/extrem hoch! Überprüfen Sie die Leistung des Servers! Server got stuck for Xms...

It means the server got stuck for X milliseconds. The warning (yellow) is not something to worry about, but too many messages in red) could mean your server infrastructure is not that good or your scripting code is not that optimized.

Usually the server runs at 33 ticks per second (or the value configured at Config.toml), the server runs in an infinite loop in that frequency, and inside that loop all server operations are executed, such as receiving and sending network packets, triggering lua events, executing functions or callbacks, and so on.

If a single tick takes more than 33 milliseconds, this warning will appear up.

tip

In some shared VPS, this warning may appear up more frequently due how the VPS handles the scaling of it's machines, sometimes the provider may think your VPS is "idle" (due nanos world server using extremely low CPU) and may decrease your processing power, causing this warning show up as well.

Assertion Failed: [...] problem (5002) We don't have cert, and self-signed certs not allowed...

This is an internal problem from Steam Library when you attempt to connect to a server too fast (when it has just started). The server automatically fixes it by retrying the connection, there is nothing to worry about.

Lua Stack Error: Should be X, is Y...

This is an internal error and should not supposed to happen. Those are guards set around our Lua Scripting implementation to prevent bad things from happening. If this error appears it means a implementation bug happened. Please communicate immediately with the devs, and if possible how to reproduce that!