CryoFall/Server/Setup: Difference between revisions

From AtomicTorchWiki
No edit summary
(40 intermediate revisions by 4 users not shown)
Line 2: Line 2:


== Requirements ==
== Requirements ==
To launch a multiplayer server on any system, you need to have .NET Core 2.1 Runtime installed. It's supported for the many operating systems including Windows, Linux and Mac.
Hardware requirements:
<br>(for up to about 100 players online) 2-core CPU 1.6-2 GHz, 1-1.5 GB RAM, 5-10 Mbit/s connection.
<br>(for up to about 200 players online) 2-core CPU 2-2.4 GHz, 1.5-2 GB RAM, 10-20 Mbit/s connection.
<br>Usually, VPS (virtual machines) hosting such as Vultr is sufficient for hosting a game server. Using 1-core machines is not recommended as the game requires a secondary CPU to ensure smooth performance without hiccups during intensive background operations (such as world snapshot saving).
 
To launch a multiplayer server on any system, you need to have .NET Core 2.1 Runtime installed. It's supported for the many operating systems (including Windows, Linux and Mac) and installation is very quick.
To install .NET Core 2.1 Runtime please visit [https://www.microsoft.com/net/download/dotnet-core/2.1 Microsoft .NET Core Downloads] and select Runtime Installer for your operating system. Follow the installation steps to setup the game server.
To install .NET Core 2.1 Runtime please visit [https://www.microsoft.com/net/download/dotnet-core/2.1 Microsoft .NET Core Downloads] and select Runtime Installer for your operating system. Follow the installation steps to setup the game server.


=== Docker Image ===
==== Docker Image ====
The docker server image is coming soon. It will make it much easier to install and update the game on Linux.
The docker server image is coming soon. It will make it much easier to install and update the game on Linux.
Currently, only the .NET Core executable is distributed (which is cross-platform but requires .NET Core 2.1 to be installed).
Currently, only the .NET Core executable is distributed (which is cross-platform but requires .NET Core 2.1 to be installed as described above).


== Installation ==
== Installation ==


==== How to host your own server: ====
==== How to host your own server: ====
* (0) Download the game server runtime from [https://atomictorch.com/Account/MyItems AtomicTorch.com] and extract it.  
# Make sure to read server requirements section above and install the required software before attempting to run the server.
* (1) The server executable is located in the subfolder: "Binaries/Server". Launch the command line (or PowerShell in Windows) and navigate to this folder (hint: in Windows you can simply '''SHIFT + Right-click''' on the "Server" folder in Explorer and select "Open PowerShell window here").
# Download the game server runtime from [https://atomictorch.com/Account/MyItems AtomicTorch.com] (you need to be logged-in to access the page) and extract it.  
* (2) Start the server executable first time with <code>loadOrNew</code> flag: <code>dotnet .\CryoFall_Server.dll loadOrNew</code>. The server will start and create the world.
# The server executable is located in the subfolder: "Binaries/Server". Launch the command line (or PowerShell in Windows) and navigate to this folder (hint: in Windows you can simply '''SHIFT + Right-click''' on the "Server" folder in Explorer and select "Open PowerShell window here").
* (3) Enter <code>stop 0</code> and press Enter key. The server will save and quit. Now you have the "SettingsServer.xml" and "ModsConfig.xml" files.
# Start the server executable first time with <code>loadOrNew</code> flag. The server will start and create the game world.
* (4) Now you need to navigate to the game subfolder "Data" (which is in the root of the game, '''not''' in the "Binaries/Server") and modify "SettingsServer.xml" to set the unique server name, make it private if needed, set other settings, etc... There are XML comments explaining every setting so it should be straightforward.
#:<code>dotnet .\CryoFall_Server.dll loadOrNew</code>
# Stop the server. To do so enter command below and press Enter key.
#:<code>stop 0</code>
#The server will save and quit. Now you have the "SettingsServer.xml" and "ModsConfig.xml" files.
# Now you need to navigate to the game subfolder "Data" (which is in the root of the game folder, '''not''' in the "Binaries/Server") and modify "SettingsServer.xml" to set the unique server '''name''', '''description''', '''welcome_message''', make it public if needed, set other settings, etc (there are XML comments explaining every setting so it should be straightforward).


In ''SettingsServer.xml'', '''do not modify misc and network parts'''! It may cause malfunction if something is set in a way it is not intended to be.
In ''SettingsServer.xml'', '''do not modify misc and network parts'''! It may cause malfunction if something is set in a way it is not intended to be.


You may, however, modify <server> part on your own risk. There you can set up some server configurations that would affect gameplay.
You may, however, modify <server> part at your own risk. There you can set up some server configurations that would affect gameplay.
 
'''Note:''' if you are interested in hosting public server make sure to edit <code><is_public_server></code> and set the value from 0 to 1. This will make your server accessible publicly. Also make sure your router is configured correctly (port forwarding) to enable other people to connect to your machine from outside. But ideally you should use dedicated server hardware to host public servers.
 
'''Windows:''' you need to allow the dotnet process in the Windows Firewall settings - if the Firewall access request was not shown automatically by Windows you can add the <code>C:\Program Files\dotnet\dotnet.exe</code> file into Firewall whitelist. To to this, open Windows Start menu and search for "Allow an app through Windows Firewall" -> button "Allow another app".


==== Starting the server: ====
==== Starting the server: ====
* (0) Launch the command line (or PowerShell in Windows) and navigate to this folder (hint: in Windows you can simply '''SHIFT + Right-click''' on the "Server" folder in Explorer and select "Open PowerShell window here").
# Launch the command line (or '''PowerShell''' in Windows (not CMD!))) and navigate to this folder (hint: in Windows you can simply '''SHIFT + Right-click''' on the "Server" folder in Explorer and select "Open PowerShell window here").
* (1) Start the server executable with <code>load</code> flag: <code>dotnet .\CryoFall_Server.dll load</code>
# Start the server executable with <code>load</code> flag.
* (2) Stop your server by typing <code>stop 60 My shutdown message goes here</code> and pressing Enter key any time (it will save the world before stopping).
#:<code>dotnet .\CryoFall_Server.dll load</code>
# Stop your server by typing command below and pressing Enter key (it will save the world before stopping).
#:<code>stop 60 The shutdown message text goes here</code>
(Where <code>60</code> is the shutdown delay (in seconds) so the connected players will have some time to find a safe location)
 
'''''Please note that typing this message is really hard as the console is updating regularly! The best way is to simply copy-paste from the text editor the whole command text into the game console window (hint: you can paste in PowerShell by simply pressing the right mouse button) and pressing Enter key.'''''
 
You can always wipe the world by launching the game with <code>new</code> flag:
:<code>dotnet .\CryoFall_Server.dll new</code>
 
Currently we don't support the savegame migration between the major game versions (if there are changes to the game data serialization scheme). We plan to implement the proper data migration feature ASAP.
 
==== Connecting to the server: ====
If you want to connect to your local game server, simply add SERVERS->Custom list as <code>localhost</code>
 
To connect to the public server you need to navigate to SERVERS->Community servers list (please note that this might not work if you host this server on the same PC as the client, read below).
 
If you're attempting to host your server on a home computer and other players cannot connect to it, you need to manually forward the port '''UDP 6000''' on your home router to your local IP address (the game has the auto port forwarding feature but it often fails due to the difference in UPnP implementation on many routers).
 
Please note that if you're running a game server on the same PC as the game client, you might be unable to connect to the game server from the Community servers list on that PC due to NAT routing even with the proper port forwarding. In that case, simply add a Custom game server as <code>localhost:6000</code> and connect to it directly.


Connecting to the private servers requires adding it via the Custom servers menu.


== Whitelist, blacklist ==
6000 is the default port but you can change it in the Data/SettingsServer.xml file.
This feature is not implemented yet and coming soon.


== Server commands ==
== Server commands ==
The server commands list and operators access setup instructions are coming soon.
The server commands list coming soon. Most of them require the server operator access.
 
To give yourself a server operator access (OP), please copy-paste this command right in the running server console:  <code>opadd yourUsername</code> Don't forget to replace <code>yourUsername</code> with your actual username which you're using on AtomicTorch.com (not an e-mail). In Windows, you can simply press the right mouse button to paste the text from clipboard into the command line window.
 
For the time being you can use <code>/help</code> in the game console to get a full list of console commands available in the game. To enable the console, you need to enable the Developer Mode first in the General Options. The game console can be toggled by pressing <code>~</code> like in old-school games.
 
== Moderation (whitelist, blacklist, kicking, muting) ==
Server operator can access special moderation commands. To invoke these commands, please enable Developer mode, connect to your game server, open the console (~ key) and then you can use these commands: (replace username with the actual player nickname)
 
Whitelist management:
 
<code>/mod.whiteList.add username</code>
 
<code>/mod.whiteList.remove username</code>
 
<code>/mod.whiteList.print</code>
 
To enable whitelist:
 
<code>/mod.whiteList.enabled 1</code>
 
Blacklist management:
 
<code>/mod.blackList.add username</code>
 
<code>/mod.blackList.remove username</code>
 
<code>/mod.blackList.print</code>
 
Kicking players (temporary removing from server and blocking from connecting):
 
<code>/mod.kickList.add username durationInMinutes</code>
 
<code>/mod.kickList.remove username</code>
 
<code>/mod.kickList.print</code>
 
Muting players (temporary removing their ability to send messages to chat):
 
<code>/mod.muteList.add username durationInMinutes</code>
 
<code>/mod.muteList.remove username</code>
 
<code>/mod.muteList.print</code>

Revision as of 09:44, 14 March 2019

Multiplayer server setup

Requirements

Hardware requirements:
(for up to about 100 players online) 2-core CPU 1.6-2 GHz, 1-1.5 GB RAM, 5-10 Mbit/s connection.
(for up to about 200 players online) 2-core CPU 2-2.4 GHz, 1.5-2 GB RAM, 10-20 Mbit/s connection.
Usually, VPS (virtual machines) hosting such as Vultr is sufficient for hosting a game server. Using 1-core machines is not recommended as the game requires a secondary CPU to ensure smooth performance without hiccups during intensive background operations (such as world snapshot saving).

To launch a multiplayer server on any system, you need to have .NET Core 2.1 Runtime installed. It's supported for the many operating systems (including Windows, Linux and Mac) and installation is very quick. To install .NET Core 2.1 Runtime please visit Microsoft .NET Core Downloads and select Runtime Installer for your operating system. Follow the installation steps to setup the game server.

Docker Image

The docker server image is coming soon. It will make it much easier to install and update the game on Linux. Currently, only the .NET Core executable is distributed (which is cross-platform but requires .NET Core 2.1 to be installed as described above).

Installation

How to host your own server:

  1. Make sure to read server requirements section above and install the required software before attempting to run the server.
  2. Download the game server runtime from AtomicTorch.com (you need to be logged-in to access the page) and extract it.
  3. The server executable is located in the subfolder: "Binaries/Server". Launch the command line (or PowerShell in Windows) and navigate to this folder (hint: in Windows you can simply SHIFT + Right-click on the "Server" folder in Explorer and select "Open PowerShell window here").
  4. Start the server executable first time with loadOrNew flag. The server will start and create the game world.
    dotnet .\CryoFall_Server.dll loadOrNew
  5. Stop the server. To do so enter command below and press Enter key.
    stop 0
  6. The server will save and quit. Now you have the "SettingsServer.xml" and "ModsConfig.xml" files.
  7. Now you need to navigate to the game subfolder "Data" (which is in the root of the game folder, not in the "Binaries/Server") and modify "SettingsServer.xml" to set the unique server name, description, welcome_message, make it public if needed, set other settings, etc (there are XML comments explaining every setting so it should be straightforward).

In SettingsServer.xml, do not modify misc and network parts! It may cause malfunction if something is set in a way it is not intended to be.

You may, however, modify <server> part at your own risk. There you can set up some server configurations that would affect gameplay.

Note: if you are interested in hosting public server make sure to edit <is_public_server> and set the value from 0 to 1. This will make your server accessible publicly. Also make sure your router is configured correctly (port forwarding) to enable other people to connect to your machine from outside. But ideally you should use dedicated server hardware to host public servers.

Windows: you need to allow the dotnet process in the Windows Firewall settings - if the Firewall access request was not shown automatically by Windows you can add the C:\Program Files\dotnet\dotnet.exe file into Firewall whitelist. To to this, open Windows Start menu and search for "Allow an app through Windows Firewall" -> button "Allow another app".

Starting the server:

  1. Launch the command line (or PowerShell in Windows (not CMD!))) and navigate to this folder (hint: in Windows you can simply SHIFT + Right-click on the "Server" folder in Explorer and select "Open PowerShell window here").
  2. Start the server executable with load flag.
    dotnet .\CryoFall_Server.dll load
  3. Stop your server by typing command below and pressing Enter key (it will save the world before stopping).
    stop 60 The shutdown message text goes here

(Where 60 is the shutdown delay (in seconds) so the connected players will have some time to find a safe location)

Please note that typing this message is really hard as the console is updating regularly! The best way is to simply copy-paste from the text editor the whole command text into the game console window (hint: you can paste in PowerShell by simply pressing the right mouse button) and pressing Enter key.

You can always wipe the world by launching the game with new flag:

dotnet .\CryoFall_Server.dll new

Currently we don't support the savegame migration between the major game versions (if there are changes to the game data serialization scheme). We plan to implement the proper data migration feature ASAP.

Connecting to the server:

If you want to connect to your local game server, simply add SERVERS->Custom list as localhost

To connect to the public server you need to navigate to SERVERS->Community servers list (please note that this might not work if you host this server on the same PC as the client, read below).

If you're attempting to host your server on a home computer and other players cannot connect to it, you need to manually forward the port UDP 6000 on your home router to your local IP address (the game has the auto port forwarding feature but it often fails due to the difference in UPnP implementation on many routers).

Please note that if you're running a game server on the same PC as the game client, you might be unable to connect to the game server from the Community servers list on that PC due to NAT routing even with the proper port forwarding. In that case, simply add a Custom game server as localhost:6000 and connect to it directly.

Connecting to the private servers requires adding it via the Custom servers menu.

6000 is the default port but you can change it in the Data/SettingsServer.xml file.

Server commands

The server commands list coming soon. Most of them require the server operator access.

To give yourself a server operator access (OP), please copy-paste this command right in the running server console: opadd yourUsername Don't forget to replace yourUsername with your actual username which you're using on AtomicTorch.com (not an e-mail). In Windows, you can simply press the right mouse button to paste the text from clipboard into the command line window.

For the time being you can use /help in the game console to get a full list of console commands available in the game. To enable the console, you need to enable the Developer Mode first in the General Options. The game console can be toggled by pressing ~ like in old-school games.

Moderation (whitelist, blacklist, kicking, muting)

Server operator can access special moderation commands. To invoke these commands, please enable Developer mode, connect to your game server, open the console (~ key) and then you can use these commands: (replace username with the actual player nickname)

Whitelist management:

/mod.whiteList.add username

/mod.whiteList.remove username

/mod.whiteList.print

To enable whitelist:

/mod.whiteList.enabled 1

Blacklist management:

/mod.blackList.add username

/mod.blackList.remove username

/mod.blackList.print

Kicking players (temporary removing from server and blocking from connecting):

/mod.kickList.add username durationInMinutes

/mod.kickList.remove username

/mod.kickList.print

Muting players (temporary removing their ability to send messages to chat):

/mod.muteList.add username durationInMinutes

/mod.muteList.remove username

/mod.muteList.print