Setting up a Multiplayer Server

From Vintage Story Wiki
Revision as of 08:08, 5 August 2019 by Tyron (talk | contribs)

Server Basics

Ad-hoc Server

If you want a temporary multiplayer experience it is enough to open a single player world and then in the escape menu click "Open To Lan". This will then allow players in your local network to join. If you want players to join that are outside your local network, you can then also click "Open To Internet" which will attempt to set up that external players can connect to your server. This is done by a technique called UPnP and that 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 thing called "port forwarding" on your internet router, which can be tricky and frustrating at times, unfortunately.

For this server to work, your single player world has to stay open

Dedicated Server

Alternatively the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself.

= Dedicated Servers on Windows

  • Enter the games application folder, by default that is in %appdata%/VintageStory
  • Start VintagestoryServer.exe
  • You might need to set up port forwarding on your router if the server should be accessible from beyond your local network


Dedicated Servers on Linux

This describes how to set up the server as a service

Requirements CentOS 7 (RHEL, Fedora, ...)

1. EPEL/screen/wget/curl Install

yum -y install epel-release screen wget curl

2. Mono Install

 yum -y install yum-utils
 rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
 yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
 yum -y install mono mono-devel

Requirements Ubuntu (Debian, Mint, ...)

1. screen/wget/curl Install

sudo apt install -y screen wget curl

2. Mono Install

 sudo apt install -y mono-complete mono-utils


3. Add the port to the firewall

firewalld

 firewall-cmd --permanent --zone=public --add-port=42420/tcp
 firewall-cmd --reload

iptables

 iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT

4. Download the game

Goto http://account.vintagestory.at/downloads
Copy the link of the newest "vs_server_*.*.*.tar.gz" package
Enter in the console "wget" and parse the link

Hint: Make for VS a own directory the tar have no subfolder

5. Open TarGZ package

tar -xzf vs_server_*.*.*.tar.gz

6. Make the server.sh executeable

 chmod 755 server.sh

7. Edit server.sh file

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

 USERNAME='<your-vs-server-username>'
 VSPATH='<your-vs-directory>'

8. Server start and first steps

 ./server.sh start
 # Wait for startup then you can give you OP
 ./server.sh command "/op <youusername>"

9. Connect to you IP/Domain and have fun