Setting up a Multiplayer Server/de: Difference between revisions

From Vintage Story Wiki
Updating to match new version of source page
No edit summary
(Updating to match new version of source page)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/><br>
== Einfache Einrichtung ==
== Einfache Einrichtung ==


<div class="mw-translate-fuzzy">
===Lokaler Server===
===Lokaler Server===
Wenn du ein temporäres Multiplayer-Erlebnis haben möchtest, reicht es, eine Einzelspielerwelt zu öffnen und dann im Escape-Menü auf "Open to Lan" zu klicken. Dies ermöglicht es Spielern in Ihrem lokalen Netzwerk, dem Spiel beizutreten.
Wenn du ein temporäres Multiplayer-Erlebnis haben möchtest, reicht es, eine Einzelspielerwelt zu öffnen und dann im Escape-Menü auf "Open to Lan" zu klicken. Dies ermöglicht es Spielern in Ihrem lokalen Netzwerk, dem Spiel beizutreten.
Wenn du Spielern außerhalb deines lokalen Netzwerks den Beitritt ermöglichen willst, kannst du auch auf "Open to Internet" klicken, wodurch versucht wird, eine externe Verbindung zu deinem Server aus dem Internet herzustellen. Dies geschieht über eine Technik namens UPnP, die auf deinem Internet-Router aktiviert sein muss, was oft standardmäßig der Fall ist. Kurz gesagt, wir schätzen, dass die Wahrscheinlichkeit, dass "Open to Internet" sofort und ohne Probleme funktioniert, bei etwa 60 % liegt. Wenn dies nicht der Fall ist, musst du eine so genannte "Portweiterleitung" auf deinem Internet-Router einrichten, was leider manchmal sehr schwierig und frustrierend sein kann. In diesem Fall musst du den TCP-Port 42420 an deinen Computer weiterleiten. (Google 'Portweiterleitung' mit dem Namen oder Modell Ihres Internet-Routers, um Hilfe zu finden.)
Wenn du Spielern außerhalb deines lokalen Netzwerks den Beitritt ermöglichen willst, kannst du auch auf "Open to Internet" klicken, wodurch versucht wird, eine externe Verbindung zu deinem Server aus dem Internet herzustellen. Dies geschieht über eine Technik namens UPnP, die auf deinem Internet-Router aktiviert sein muss, was oft standardmäßig der Fall ist. Kurz gesagt, wir schätzen, dass die Wahrscheinlichkeit, dass "Open to Internet" sofort und ohne Probleme funktioniert, bei etwa 60 % liegt. Wenn dies nicht der Fall ist, musst du eine so genannte "Portweiterleitung" auf deinem Internet-Router einrichten, was leider manchmal sehr schwierig und frustrierend sein kann. In diesem Fall musst du den TCP-Port 42420 an deinen Computer weiterleiten. (Google 'Portweiterleitung' mit dem Namen oder Modell Ihres Internet-Routers, um Hilfe zu finden.)
</div>


For this server to work, your single player world has to stay open.
<div lang="en" dir="ltr" class="mw-content-ltr">
If you want a temporary multiplayer experience it is enough to open a single player world, then click on "Open to Lan" in the escape menu. This will allow players in your local network to join.
If you want to allow players outside of your local network to join, you can then also click "Open to Internet" which will attempt to set up an external connection to join your server from the internet. This is done by a technique called UPnP and has to be enabled on your internet router, which it often is by default. In short, we estimate there's about a 60% success chance that 'Open to Internet' works instantly without issues. If it doesn't you would need to set up a so called "port forwarding" on your internet router, which can be tricky and frustrating at times, unfortunately. You would need to forward TCP Port 42420 to your computer in that case. (Google 'Port forwarding' with the name or model of your internet router to find help.)
</div>
 
Damit dieser Server funktioniert, muss deine Einzelspielerwelt geöffnet bleiben.
----
----


===Dedicated Server===
<div class="mw-translate-fuzzy">
===Dedizierter Server===
Alternativ wird das Spiel mit einem eigenen Serverprogramm ausgeliefert, das du starten und dauerhaft laufen lassen kannst, ohne dich selbst anmelden zu müssen.
Es gibt mehrere Möglichkeiten, einen dedizierten Server einzurichten und laufen zu lassen.
----
</div>
 
<div lang="en" dir="ltr" class="mw-content-ltr">
Alternatively the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself.
Alternatively the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself.
There are several ways to get a dedicated server up and running.
There are several ways to get a dedicated server up and running.
----
</div>
 
==== Paid hosts ====
Some commercial hosting services offer paid server hosting. Currently Vintage Story hosting is offered by [https://pingperfect.com/ PingPerfect], [https://citadelservers.com/ Citadel Server], [https://www.creeperhost.net/ Creeperhost], [https://www.akliz.net/games/vintage-story Akliz] and [https://www.g-portal.com/en/gameserver/rent-a-vintage-story-server GPortal]


==== Dedicated Servers on Windows ====
<div class="mw-translate-fuzzy">
* Enter the games application folder, by default that is %appdata%/VintageStory
==== Bezahlte Hosts ====
* Start VintagestoryServer.exe
Einige kommerzielle Hosting-Dienste bieten kostenpflichtiges Server-Hosting an. Derzeit wird das Hosting von Vintage Story von den Entwicklern des Spiels angeboten sowie:  [https://pingperfect.com/ PingPerfect], [https://citadelservers.com/ Citadel Server], [https://www.creeperhost.net/ Creeperhost], [https://www.akliz.net/games/vintage-story Akliz] und [https://www.g-portal.com/en/gameserver/rent-a-vintage-story-server GPortal]
* You might need to set up port forwarding on your internet router if the server should be accessible from beyond your local network (internet).
</div>
----


==== Dedicated Servers on Linux ====
<div lang="en" dir="ltr" class="mw-content-ltr">
This describes how to set up the server as a service on Linux systems.
Hosting is available by the creators of the game via integrated server dashboard, no mod support yet, servers located in central europe.<br>
* [https://www.vintagestory.at/store/product/7-simple-server-hosting-8-slots/ Available on the official store].
</div>


===== Requirements for CentOS 7 (RHEL, Fedora, ...) =====
<div lang="en" dir="ltr" class="mw-content-ltr">
'''1. EPEL/screen/wget/curl Install'''
3rd party hosting services in no particular order:
</div>


  yum -y install epel-release screen wget curl
<div lang="en" dir="ltr" class="mw-content-ltr">
* [https://pingperfect.com/gameservers/vintage-story-game-server-hosting-rental.php Pingperfect]
* [https://www.4netplayers.com/ 4netplayers]
* [https://www.bisecthosting.com/vintage-story-server-hosting Bisecthosting]
* [https://hosthavoc.com/game-servers/vintage-story HostHavoc]
* [https://www.akliz.net/games/vintage-story Akliz]
* [https://citadelservers.com/game-servers/vintage-story-game-hosting CitadelHosting]
* [https://suhosting.net/ Something Unique Hosting]
* [https://www.gtxgaming.co.uk/ GTX.gaming.uk]
* [https://www.creeperhost.net/vintage/order CreeperHost]
* [https://shockbyte.com/ Shockbyte]
* [https://www.g-portal.com/ Gportal] (if you install mods, you might want to disable auto-updates)
* [https://server.nitrado.net/ Nitrado] (allegedly in the process of removing support for Vintage Story)
</div>


'''2. Mono Install'''
<div class="mw-translate-fuzzy">
==== Dedizierte Server auf Windows ====
* Geben Sie den Anwendungsordner für das Spiel ein, standardmäßig ist das %appdata%/VintageStory
* Starte VintagestoryServer.exe
* Möglicherweise musst du eine Portweiterleitung auf deinem Internet-Router einrichten, wenn der Server von außerhalb deines lokalen Netzwerks (Internet) erreichbar sein soll.
----
</div>


  yum -y install yum-utils
<div lang="en" dir="ltr" class="mw-content-ltr">
  rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
* Open the game's application folder, it is <code>%appdata%/VintageStory</code> by default.
  yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
* Run <code>VintagestoryServer.exe</code>.
  yum -y install mono mono-devel
* You might need to setup port forwarding on your internet router if you want the server to be accessible from outside of your local network (for example, anyone who isn't on the same WiFi as you).
----
----
</div>


===== Requirements for Ubuntu (Debian, Mint, ...) =====
<div class="mw-translate-fuzzy">
'''1. screen/wget/curl Install'''
==== Dedizierte Server auf Linux ====
Hier wird beschrieben, wie du den Server als Dienst auf Linux-Systemen einrichtest.
</div>


  sudo apt install -y screen wget curl
<div lang="en" dir="ltr" class="mw-content-ltr">
This describes how to set up the server as a service on Linux systems.<br>
<span style="color:#E16100">Note: ''The following only works for x64 processors, if using ARM please refer to the following section.''</span><br>
</div>


'''2. Mono Install'''
<div class="mw-translate-fuzzy">
===== Voraussetzungen für CentOS 7 (RHEL, Fedora, ...) =====
'''1. EPEL/screen/wget/curl Installation'''
</div>


As of '''Vintage Story version 1.12.7''' and above '''Mono version 5 or higher''' is recommended to use.<br>
<div lang="en" dir="ltr" class="mw-content-ltr">
This '''HowTo is written assuming Ubuntu 18.04''' as the base OS.<br>
* [https://dotnet.microsoft.com/en-us/download/dotnet/7.0 .NET Runtime 7.0] This should be all needed to run a Vintagestory server. Everything else is just for convenience to start and manage it.
To install the latest stable version for your specific distribution, please follow the instructions from the [https://www.mono-project.com/download/stable/#download-lin Official Mono Project Download Page].
* install <code>pgrep</code>, <code>screen</code> and <code>wget</code> using your systems package manager.
  sudo apt install gnupg ca-certificates
</div>
  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
  sudo apt update
  sudo apt install -y mono-complete


----<br>
<div lang="en" dir="ltr" class="mw-content-ltr">
===== Setup the server =====
</div>


'''3. Download the game'''
<div class="mw-translate-fuzzy">
'''3. Lade das Spiel herunter'''
</div>


<span style="color:#E16100">Advice: ''Create a seperate directory for Vintage Story as the tar.gz does not contain a subfolder.''</span>
<div class="mw-translate-fuzzy">
<span style="color:#E16100">Advice: ''Erstelle ein separates Verzeichnis für Vintage Story, da die tar.gz-Datei keine Unterordner enthält.''</span>
   mkdir server && cd server
   mkdir server && cd server
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Goto http://account.vintagestory.at/downloads<br>
Goto http://account.vintagestory.at/downloads<br>
Copy the link of the newest "vs_server_*.*.*.tar.gz" package ('''Tar.gz Archive/Linux (server only)''' under '''Show other available downloads of Vintage Story''')<br>
Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package ('''Linux Server (.tar.gz)''' under '''Show other available downloads of Vintage Story''')<br>
Download with "wget" via console (''Vintage Story version 1.12.9 in this example'').
Download with "wget" via console (''Vintage Story version 1.18.8 in this example'').
</div>


   wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_1.12.9.tar.gz
   <div lang="en" dir="ltr" class="mw-content-ltr">
wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz
</div>


'''4. Extract tar.gz package'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''2. Extract tar.gz package'''
</div>


   tar xzf vs_server_*.*.*.tar.gz
   <div lang="en" dir="ltr" class="mw-content-ltr">
tar xzf vs_server_linux-x64_*.*.*.tar.gz
</div>


'''5. Make server.sh script executeable'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''3. Make server.sh script executable'''
</div>


   chmod +x server.sh
   <div lang="en" dir="ltr" class="mw-content-ltr">
chmod +x server.sh
</div>


'''6. Edit server.sh file'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''4. Edit server.sh file'''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory.
For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory.
On most linux operating systems you can create a user with the command adduser.
On most linux operating systems you can create a user with the command adduser.
</div>


   adduser vintagestory
   <div lang="en" dir="ltr" class="mw-content-ltr">
adduser vintagestory
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Then change these options for your needs:
Then change these options for your needs:
</div>


   USERNAME='<your-vs-server-username>'
   <div lang="en" dir="ltr" class="mw-content-ltr">
USERNAME='<your-vs-server-username>'
   VSPATH='<your-vs-directory>'
   VSPATH='<your-vs-directory>'
</div>


'''7. Open the port at the firewall (if needed)'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''5. Open the port at the firewall (if needed)'''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
firewalld
firewalld
   firewall-cmd --permanent --zone=public --add-port=42420/tcp
   firewall-cmd --permanent --zone=public --add-port=42420/tcp
Line 94: Line 163:
iptables
iptables
   iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT
   iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT
</div>


'''8. Server start and first steps'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''6. Server start and first steps'''
</div>


  <div lang="en" dir="ltr" class="mw-content-ltr">
   ./server.sh start
   ./server.sh start
 
   Wait for the startup to finish, then you can give yourself OP with
   Wait for the startup to finish, then you can give yourself OP with
   ./server.sh command "/op <youusername>"
   ./server.sh command "/op <youusername>"
</div>


'''9. Connect to your IP/Domain and have fun'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''7. Connect to your IP/Domain and have fun'''
----
----
</div>


===== Requirements for Alpine (Advanced, no support) =====
<div lang="en" dir="ltr" class="mw-content-ltr">
'''1. Install mono'''
==== Dedicated Servers on ARM64====
</div>


As mono is in testing in Alpine, the testing URL (http://dl-cdn.alpinelinux.org/alpine/edge/testing) will have to be uncommented out in
<div lang="en" dir="ltr" class="mw-content-ltr">
<span style="color:#E16100">Note: ''Please note the ARM64 version is EXPERIMENTAL please report any issues to the [https://discord.com/channels/302152934249070593/1128220205181587516 discord ]''</span>
</div>


  /etc/apk/repositories
<div lang="en" dir="ltr" class="mw-content-ltr">
The ARM64 version is available on [https://github.com/anegostudios/VintagestoryServerArm64 GitHub ]
</div>


after, run
<div lang="en" dir="ltr" class="mw-content-ltr">
I recommend using the install script located on the GitHub. The following is a step by step guide on how to use the script on a Debian based system (Ubuntu, Debian, Rasbian, etc).
</div>


  apk update
<div lang="en" dir="ltr" class="mw-content-ltr">
  apk add mono mono-dev
1. Install the required dependencies to use this script by doing <code>apt -y install curl jq</code>
</div>


'''2. Install tmux'''
<div lang="en" dir="ltr" class="mw-content-ltr">
2. Create a new file named <code>arminstall.sh</code> by running <code>vim arminstall.sh</code> or <code>nano arminstall.sh</code>
</div>


  apk add tmux
<div lang="en" dir="ltr" class="mw-content-ltr">
3. Copy the contents of the <code>arminstall.sh</code> file from GitHub to your newly created file and save it by using <code>:wq</code> with Vim or <code>Ctrl + X</code>, then <code>Y</code>, then <code>Enter</code> with Nano.
</div>


'''3. Certificates'''
<div lang="en" dir="ltr" class="mw-content-ltr">
4. Make the script executable by running <code>chmod +x arminstall.sh</code>
</div>


  apk add ca-certificates
<div lang="en" dir="ltr" class="mw-content-ltr">
5. Run the script by doing <code>./arminstall.sh</code>
</div>


then run
<div lang="en" dir="ltr" class="mw-content-ltr">
6. Start the server by using <code>./VintagestoryServer</code> or <code>dotnet VintagestoryServer.dll</code>
</div>


  cert-sync /etc/ssl/certs/ca-certificates.crt
<div lang="en" dir="ltr" class="mw-content-ltr">
This will download the latest version of Vintagestory to the current working directory, then replace the needed files to work with ARM.
</div>


to update the certs.
<div lang="en" dir="ltr" class="mw-content-ltr">
If at any time you want to update to the latest version of Vintage Story, simply run the script again.
----
</div>


'''4. Simplified Start Script'''
<div lang="en" dir="ltr" class="mw-content-ltr">
==== Simple Server start command ====
</div>


Download and extract the server into a location as normal, then put this into a script:
<div lang="en" dir="ltr" class="mw-content-ltr">
If you want to use a custom script or just manually start your server you can run
dotnet VintagestoryServer.dll --dataPath /path/to/data
Or
./VintagestoryServer --dataPath /path/to/data
if you have the <code>DOTNET_ROOT</code> environment variable set.
</div>


  #!/bin/ash
<div lang="en" dir="ltr" class="mw-content-ltr">
  mono VintagestoryServer.exe --dataPath ./data
==== Updating Servers ====
</div>


This script will just run the server, putting the world save files into the same folder the server is extracted to.
<div lang="en" dir="ltr" class="mw-content-ltr">
As an advanced user, you don't need to worry about having the dependancies, checking for new versions, or installing the server or save files under different users and locations.
If you want to install a newer version, remove all installation files first, or you'll get unforseeable behavior. If you chose a data folder inside the installation folder, make sure to not delete that one, or you'll loose your save games, settings and player data.  
 
Download the "Tar.gz Archive/Linux (server only)" file and extract it. If you have a remote installation and only a FTP connection to your server, you will have to unpack it locally and upload each file.
Run the script in a tmux session.
</div>
 
The rest of the normal advice applies too (firewalling etc.).


<div lang="en" dir="ltr" class="mw-content-ltr">
== Basic Configuration ==
== Basic Configuration ==
</div>


Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the serverconfig.json, for which the server needs to be stopped.
<div lang="en" dir="ltr" class="mw-content-ltr">
Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the {{ll|Server Config|serverconfig.json}}, for which the server needs to be stopped first.
On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''.
On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''.
On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here)
On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here)
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
{{Protip|The easiest way to get a world configured to your wishes is to first create it in Single Player, using the advanced world creating options - and then upload it to use as your server world.}}
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
''Explanation of values in serverconfig.json you can find here: [[Server Config]]''
''Explanation of values in serverconfig.json you can find here: [[Server Config]]''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Here are some of the configurations set by commands, that you'd typically want to set.
Here are some of the configurations set by commands, that you'd typically want to set.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
* <code>/serverconfig upnp [0|1]</code><br>If set to one, the game server will attempt to set up port forwarding for you
* <code>/serverconfig upnp [0|1]</code><br>If set to one, the game server will attempt to set up port forwarding for you
* <code>/serverconfig name Peaceful PvE Server</code><br>Set up the server name, visible in the public server listing
* <code>/serverconfig name Peaceful PvE Server</code><br>Set up the server name, visible in the public server listing
Line 160: Line 280:
* <code>/serverconfig password asdaf</code><br>Require a password for players to log in, if desired. Use <code>/serverconfig nopassword</code> to remove again.
* <code>/serverconfig password asdaf</code><br>Require a password for players to log in, if desired. Use <code>/serverconfig nopassword</code> to remove again.
* <code>/serverconfig advertise (1|0)</code><br>Whether or not add this server to the public server listing
* <code>/serverconfig advertise (1|0)</code><br>Whether or not add this server to the public server listing
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Lastly, you can configure a server that was created with the 'Open to Lan' method in the same way as you do for dedicated ones, be aware though, in that case a few of the configurations are overridden by the client, such as the save file location.
Lastly, you can configure a server that was created with the 'Open to Lan' method in the same way as you do for dedicated ones, be aware though, in that case a few of the configurations are overridden by the client, such as the save file location.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
===Acquiring server admin rights===
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
If you have access to the server console, type <code>/op playername</code>. If not, open up the serverconfig.json and replace
<code>"StartupCommands": null,</code>
with
<code>"StartupCommands": "/op playername",</code>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
In both instances you should replace <code>playername</code> with your actual player name.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
== Advanced Dedicated Server ==
== Advanced Dedicated Server ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
===Debian with systemd service and rsyslog===
===Debian with systemd service and rsyslog===
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
If you prefer using systemd instead of screen to run your VS Server, you can follow these Instructions.<br>
If you prefer using systemd instead of screen to run your VS Server, you can follow these Instructions.<br>
We also will setup rsyslog to split all logs into separate files.<br>
We also will setup rsyslog to split all logs into separate files.<br>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Installation ====
==== Installation ====
</div>


'''1. mono Install Debian 9'''
<div lang="en" dir="ltr" class="mw-content-ltr">
  sudo apt install apt-transport-https dirmngr gnupg ca-certificates wget nano
'''1. create a user'''
  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
  echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
  sudo apt update
  sudo apt install mono-devel
 
For Debian 10 use
  echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
 
'''2. create a user'''
   adduser --shell /bin/bash --disabled-password gameserver
   adduser --shell /bin/bash --disabled-password gameserver
</div>


'''3. create directories'''
<div lang="en" dir="ltr" class="mw-content-ltr">
'''2. create directories'''
   mkdir -p /srv/gameserver/vintagestory
   mkdir -p /srv/gameserver/vintagestory
   mkdir -p /srv/gameserver/data/vs
   mkdir -p /srv/gameserver/data/vs
   mkdir -p /usr/lib/systemd/system
   mkdir -p /usr/lib/systemd/system
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
'''3. Download the game'''
'''3. Download the game'''
   cd /srv/gameserver/vintagestory
   cd /srv/gameserver/vintagestory
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Goto http://account.vintagestory.at/downloads<br>
Goto http://account.vintagestory.at/downloads<br>
Copy the link of the newest "vs_server_*.*.*.tar.gz" package ('''Tar.gz Archive/Linux (server only)''' under '''Show other available downloads of Vintage Story''')<br>
Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package ('''Linux Server (.tar.gz)''' under '''Show other available downloads of Vintage Story''')<br>
Download with "wget" via console (''Vintage Story version 1.12.9 in this example'').
Download with "wget" via console (''Vintage Story version 1.18.8 in this example'').
</div>


   wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_1.12.9.tar.gz
   <div lang="en" dir="ltr" class="mw-content-ltr">
wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
'''4. Extract tar.gz package'''
'''4. Extract tar.gz package'''
</div>


   tar xzf vs_server_1.12.9.tar.gz
   <div lang="en" dir="ltr" class="mw-content-ltr">
tar xzf vs_server_linux-x64_1.18.8.tar.gz
</div>
 
<div lang="en" dir="ltr" class="mw-content-ltr">
'''5. Change owner'''
'''5. Change owner'''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
You have to set the owner of your gameserver directory to avoid write permission errors
You have to set the owner of your gameserver directory to avoid write permission errors
   chown -R gameserver:gameserver /srv/gameserver
   chown -R gameserver:gameserver /srv/gameserver
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
'''6. Create systemd service unit file'''
'''6. Create systemd service unit file'''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Use your favourite tool to create a service unit file (this example uses nano)
Use your favourite tool to create a service unit file (this example uses nano)
   nano /usr/lib/systemd/system/vintagestoryserver.service
   nano /usr/lib/systemd/system/vintagestoryserver.service
Line 217: Line 376:
   [Service]
   [Service]
   WorkingDirectory=/srv/gameserver/vintagestory
   WorkingDirectory=/srv/gameserver/vintagestory
   ExecStart=/usr/bin/mono VintagestoryServer.exe --dataPath /srv/gameserver/data/vs
   ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs
   Restart=always
   Restart=always
   RestartSec=30
   RestartSec=30
Line 228: Line 387:
   [Install]
   [Install]
   WantedBy=multi-user.target
   WantedBy=multi-user.target
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Make sure the new user has access to the <code>dotnet</code> command or replace the command with the full path to where you installed the dotnet runtime (if you picked a custom install). Or you can also use <code>ExecStart=VintagestoryServer --dataPath /srv/gameserver/data/vs</code> if you have the <code>DOTNET_ROOT</code> environment variable set.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
'''7. Create config file for rsyslog'''
'''7. Create config file for rsyslog'''
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Use your favourite tool to create a rsyslog config file (this example uses nano)
Use your favourite tool to create a rsyslog config file (this example uses nano)
   nano /etc/rsyslog.d/vintagestoryserver.conf
   nano /etc/rsyslog.d/vintagestoryserver.conf
Line 255: Line 422:
   # Discard  
   # Discard  
   if $programname == 'VSSRV' then ~
   if $programname == 'VSSRV' then ~
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
'''8. restart rsyslog / enable service'''
'''8. restart rsyslog / enable service'''
To activate rsyslog and your vintagestory server type these commands
To activate rsyslog and your vintagestory server type these commands
Line 260: Line 430:
   systemctl enable vintagestoryserver.service
   systemctl enable vintagestoryserver.service
   systemctl start vintagestoryserver.service
   systemctl start vintagestoryserver.service
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
----
----
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Stop, Start, Disable Server ====
==== Stop, Start, Disable Server ====
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
To manually stop your VS Server use this command
To manually stop your VS Server use this command
   systemctl stop vintagestoryserver.service
   systemctl stop vintagestoryserver.service
Line 271: Line 447:
To disable the service use
To disable the service use
   systemctl disable vintagestoryserver.service
   systemctl disable vintagestoryserver.service
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Config ====
==== Config ====
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
to change your servers configuration, stop the server and edit
to change your servers configuration, stop the server and edit
   nano /srv/gameserver/data/vs/serverconfig.json
   nano /srv/gameserver/data/vs/serverconfig.json
After you saved your changes, start server again.
After you saved your changes, start server again.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Restart schedule ====
==== Restart schedule ====
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
If you want your server to restart every day, you can setup a cronjob for this
If you want your server to restart every day, you can setup a cronjob for this
   crontab -e
   crontab -e
Line 288: Line 472:
If you just want to restart the server this line instead of the other two should be fine
If you just want to restart the server this line instead of the other two should be fine
   30 4 * * *      systemctl restart vintagestoryserver.service
   30 4 * * *      systemctl restart vintagestoryserver.service
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Logging ====
==== Logging ====
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
The rsyslog config splits the output logs into seperate files that you can watch with tail command<br>
The rsyslog config splits the output logs into seperate files that you can watch with tail command<br>
For Login/Logout see
For Login/Logout see
Line 306: Line 494:
For all other messages see
For all other messages see
   tail -f /var/log/vintagestory-server/other.log
   tail -f /var/log/vintagestory-server/other.log
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==== Multiple Server Instances ====
==== Multiple Server Instances ====
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
If you want to run multiple instances on the same machine you just have to redo some of the steps above. This is just an example for a second instance:
If you want to run multiple instances on the same machine you just have to redo some of the steps above. This is just an example for a second instance:
</div>


   mkdir -p /srv/gameserver/data/vs2
   <div lang="en" dir="ltr" class="mw-content-ltr">
mkdir -p /srv/gameserver/data/vs2
   nano /usr/lib/systemd/system/vintagestoryserver2.service
   nano /usr/lib/systemd/system/vintagestoryserver2.service
Copy from step 6 and change these lines:
Copy from step 6 and change these lines:
   Description=Vintage Story Server 2 Unit
   Description=Vintage Story Server 2 Unit
   ExecStart=/usr/bin/mono VintagestoryServer.exe --dataPath /srv/gameserver/data/vs2
   ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs2
   SyslogIdentifier=VSSRV2
   SyslogIdentifier=VSSRV2
Create rsyslog file and copy code from step 7
Create rsyslog file and copy code from step 7
Line 331: Line 525:
Insert
Insert
   30 4 * * *      systemctl restart vintagestoryserver2.service
   30 4 * * *      systemctl restart vintagestoryserver2.service
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Have Fun!
Have Fun!
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Advanced setup==
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
===Using an SRV Record to point a domain to your server===
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
In some cases, you may not able to get a server with the default port (Multiple instances on the same server, paid hosts...), and you will have to add the port at the end of the server's address in order to connect to it.<br>
But you might want to avoid the need to specify the port (Easier to remember, look cleaner).
There is a way to point a domain to your server and avoid the need to add the port : SRV Records<br>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
SRV Records allow you to point a domain/subdomain to your instance, while letting the game know the port to use.<br>
How to set up an SRV Records will depend on your domain provider, and you should check on their documentation before making any changes. However, the idea and values remain the same for every provider.<br>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Let's take a server with the following details :
* Address : <code>play.example.com</code>
* Port : <code>50030</code>
* Owned domain : <code>mydomain.com</code>
* Desired subdomain : <code>vintagestory.mydomain.com</code>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Your raw SRV Records should look something like this :
  _vintagestory._tcp.vintagestory.mydomain.com.  IN  SRV 10 10 50030 server.example.com.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
The underscores and trailing dots are important! Here are some details :
* <code>_vintagestory</code> define the service, in our case, Vintage Story<br>
* <code>_tcp</code> define the protocol, Vintage Story use TCP<br>
* <code>vintagestory.mydomain.com.</code> is the subdomain we want to use. The trailing dot is important!<br>
* <code>IN SRV</code> Define the record type, don't change this<br>
* <code>10 10</code> are in order the priority and the weight of our record, in our case those are not important, as you are probably not going to load balance a Vintage Story server<br>
* <code>50030</code> is the port our instance is listening on<br>
* <code>server.example.com.</code> is the target, where the server is located. The trailing dot is mandatory as the target server is not on the same domain as us. If it was the case, you would only need to add the subdomain of the target without the trailing dot<br>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
If you wanted to have your record pointing to your domain directly, you would have <code>mydomain.com.</code> instead of <code>vintagestory.mydomain.com.</code>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Here is how to do it for OVH and Hetzner (Don't forget to edit the values to suit your setup !) :
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
====OVH====
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
You will need to go to your DNS zone and add an entry, select the SRV Record type :
* Sub-domain : <code>_vintagestory._tcp.vintagestory</code> You don't need to add your domain, as their form do it for you.
* TTL : No need to change this
* Priority : <code>10</code>
* Weight : <code>10</code>
* Port : <code>50030</code>
* Target : <code>server.example.com.</code>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
====Hetzner====
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
You will need to create a record from their DNS Console :
* Type : <code>SRV</code>
* Name : <code>_vintagestory._tcp.vintagestory.mydomain.com.</code>
Click on the Value field to enter the details :
* Priority : <code>10</code>
* Weight : <code>10</code>
* Port : <code>50030</code>
* Target : <code>server.example.com.</code>
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
Wait a few minutes for your record to propagate and then try to use it to connect to the server, using <code>vintagestory.mydomain.com</code> as the address.
</div>
<div lang="en" dir="ltr" class="mw-content-ltr">
You are now all set up to share your server with your custom domain.
</div>
{{Game navbox}}
43,151

edits