Configuration du serveur
Tout ce que vous devez savoir pour configurer votre serveur !
Fichier de configuration du serveurâ
Le fichier de configuration du serveur Config.toml
est généré automatiquement lorsque le serveur est lancé pour la premiÚre fois. Ce fichier sera toujours remplacé par le bon modÚle aprÚs le chargement du serveur.
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.
loading...
Settings Detailedâ
Setting | Description |
---|---|
name | Nom du serveur |
description | Description du serveur |
logo | URL de l'image qui sera affichée dans la liste des serveurs |
max_players | Nombre maximum de joueurs autorisés à rejoindre |
password | Mot de passe pour se connecter |
ip | IP du serveur. Nous recommandons de laisser vide |
port | Port principal du serveur et port HTTP (UDP/TCP) |
query_port | Server query Port (UDP) |
announce | Afficher ou non dans la liste des serveurs |
tick_rate | Fréquence de ticks en ms. Nous recommandons de laisser à 33 |
log_level | Quel niveau de log afficher |
game_mode | game-mode package to load - you can only load one game-mode at once. |
loading_screen | loading-screen package to load - you can only load one loading-screen at once. |
packages | script packages to load |
assets | Assets additionnels Ă charger |
map | Quelle map charger |
token | Server Token used for authorize downloads through CLI |
banned_ids | List of banned nanos account IDs |
Map & Niveauâ
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 contient (pour le moment) 4 maps incluses :nanos-world::BlankMap
,nanos-world::EmptyMap
, nanos-world::OceanMap
and nanos-world::TestingMap
qui peuvent ĂȘtre utilisĂ©es dans votre serveur sans avoir Ă tĂ©lĂ©charger aucun pack d'asset.
Console du serveurâ
Commandes intĂ©grĂ©esâ
Commande | Description |
---|---|
chat [message] | Envoie un message dans le chat |
map [map_path] | Changes the Map, reloads all Packages and reconnect all Players |
stop | ArrĂȘte le serveur |
package run [package_name] [lua_code] | Exécute du code dans un package |
package reload [package_name] | Recharge un package |
package reload all | Recharge tous les packages |
package unload [package_name] | ArrĂȘte un package |
package load [package_name] | Charge un package |
Commandes personnalisĂ©esâ
All (non built-in) commands will be sent into an event to the scripting/server-side:
Server.Subscribe("Console", function(my_input)
Package.Log("Console command received: " .. my_input)
end)
ParamĂštres de ligne de commandeâ
Il est possible de remplacer la configuration du serveur avec les paramÚtres de ligne de commande. Note : cela ne va pas écrire dans le fichier de configuration.
Parameter | Type de valeur | Description |
---|---|---|
--name | string | Nom du serveur |
--description | string | Description du serveur |
--logo | string | Logo du serveur |
--password | string | Mot de passe du serveur |
--ip | string | IP du serveur |
--map | string | Map Ă charger |
--port | number | --http_port |
--query_port | number | Server Query port |
--announce | 0 or 1 | Si afficher le serveur dans la liste des serveurs |
--game_mode | string | Mode de jeu du serveur |
--loading_screen | string | Ăcran de chargement du serveur |
--packages | string list | Packages du serveur |
--assets | string list | Assets du serveur |
--token | string | Server authorization token |
--max_players | number | Nombre de joueurs autorisés |
--save | 0 or 1 | Si sauvegarder les paramĂštres dans Config.toml |
--profiling | 0 or 1 | Activer les logs de profilage pour le débogage |
--auto_download | 0 or 1 | Automatically downloads Packages and Assets from Vault if needed |
--dedicated_server | 0 or 1 | If to start as a Dedicated Server or P2P |
--async_log | 0 or 1 | If to use async or sync logs (async provides better performance) - default is 1 |
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:
# 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:
# 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 Tick too/extreme high! Verify the server performance! 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.
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!