User talk:Rain/Sandbox: Difference between revisions

From Pavlov VR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Setting up a dedicated server ==
==What does and does not belong on this page==


'''There are no Windows binaries'''
If something describes in detail how an aspect of the implementation of Pavlov VR dedicated servers works, it belongs on this page.


This guide is written exclusively for Linux and covers Ubuntu/Debian/Debian-like and Red Hat RPM-based distros. Possible to run with other distros, but some of the commands won't work and you will need to know enough to figure out the software install of dependencies on your own.  
If something is only tangentially related to dedicated servers, like how to get an MD5 checksum from text, how to use bash, execute files, use (s)ftp, port forwarding, file permissions, specific features of tools/libraries, do not belong on this page. That's what guides are for and wikis do not contain guides! Guides may be linked at the bottom of the article.


If you are considering hosting from home, please read that section of the wiki first.  
If something is a hack and not officially supported, such as having more than 10 max players on shack servers, does not belong on this page.


This guide assumes you know the basics of using a bash terminal: ssh'ing into a server, running bash commands, editing text files, etc.
DO NOT REPLICATE INFORMATION THAT IS AVAILABLE IN OTHER PAGES OR WIKIS. LINK TO THEM INSTEAD!


If you have no experience using bash, maybe start [https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/ here]. Editing text files via commandline is often a challenge. Suggest using nano and reading guide [https://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/ here]
Users are expected to have a certain brain capacity to be able to google for things to figure them out. This is not an IT help forum that explains in detail how to use computers. All it must contain is information specific to dedicated server software.


If you are new to linux and accessing your server from Windows, highly suggest using MobaXterm as your SSH client as that can make required editing of text files easier using built in editor instead of the native linux command line editors.
==Grammar and syntax==


And finally, ask yourself why you want to setup a server? If you look at the list, there are many, many more servers than players. If you don't have a team, discord community, or group of friends ready to play on your server, chances are it will go unused. Got one of these... great, let's go.  
The user/reader is never to be referred to directly. Reflexive and personal pronouns are to be avoided.


If you don't want to go through the hassle yourself and want to pay for a hosting service Arctic VR (PC and Shack) and Horde (Shack) provide a server hosting services and are trusted in the community. See links below.
Bad: You can run the command.


Good: This command can be run.


Bad: If this does not work, try something else.


----
Good: There are alternatives, should this not work.


=== Server Requirements ===
Bad: Note: I don't think this is accurate


'''Pavlovserver can only be hosted under Linux.'''
Good: Note: The accuracy of this information may be questionable.
 
This can be running as a VM under windows, but this will increase the complexity of the setup beyond this guide.
 
Ubuntu 18.04 x86_64, Ubuntu 19/04 amd64, Ubuntu 20.04, and Rocky Linux 8 are confirmed working. Ubuntu 15.04 x86 is known to fail to install using this guide. Recommend not running on "minimal" images as some tools are missing.
 
* 2GB RAM + 1GB RAM per each additional server with 10 players. More RAM is recommended for larger maps, higher player counts, or complex gamemodes. Not having enough RAM is a common cause of server crashes.
 
* A ~2.5Ghz CPU will comfortably support a 10 player server.
* A ~4Ghz CPU will comfortably support 24 players. This is a limit built into Pavlov itself, no server will allow players to join over 24. Lower player counts are recommended for complex gamemodes (E.g. CodZ) and/or highly detailed maps, so that maximum number will often be lower.
 
(Note that these are '''not''' hard limits for player counts, just suggestions for the best performance, based on experiences with many server providers on different grades of hardware.)
* Pavlovserver is functionally single threaded (one thread does vast majority of work). More CPUs only help if you are running more servers. More clockspeed = higher performance = more users per server.
The maximum number of servers you can run is dependent on how many CPUs you have. For example, if you have an 8 core CPU, the maximum number of servers would be 7. You should always have at least one CPU free as overhead, as Pavlov servers can use slightly more than one thread.
 
----
 
==== Hosting at home ====
When hosting at home there are additional requirements regarding networking: Your router has to support port-forwarding, hair-pinning/LoopbackNAT, and respond to ping requests.  These techniques are necessary to allow your server to be found and to talk back to the client. please see https://en.wikipedia.org/wiki/Port_forwarding,  https://en.wikipedia.org/wiki/Hairpinning, and https://www.speedguide.net/faq/how-to-become-pingable-behind-a-routerfirewall-376 for more info and google for these terms in addition to your router model to find guides on how to enable/configure it properly. If you have modern Router, it may have these features already enabled, in this case you just have to configure port-forwarding. If you can see your server but not join it while others can, this is indicative of a failure of LoopbackNAT.
 
A second challenge to hosting at home is CGNAT (Carrier grade NAT: https://www.a10networks.com/blog/carrier-grade-nat/). Just like NAT on your home network that has to be gotten around w/ port-forwarding, CGNAT breaks the ability of external connections to be made back to your server, but the controls are solely in your ISPs hands. Sometimes if you ask, you can be removed from CGNAT pools and/or assigned a static IP. CGNAT rollouts are becoming very common now, so if your server worked then doesn't allow connections now, your ISP may have made this change.
 
You can check whether you’re on a CGNAT network by visiting a Web site such as ipaddress.com or whatsmyip.com and comparing the IP address listed to the public/WAN IP address assigned to your Internet gateway. To find your gateway’s public IP address, check the status page in the administrative interface. If the two IP addresses differ, you’re likely on a CGNAT network. If so, this problem must be resolved before you go any further.
 
'''Not understanding these requirements and configuration is a frequent cause of failed setups and questions in discord. Don't skip this if you are trying to host from home'''
 
'''There are serious security implications of hosting this software at home.''' None of the devs are security experts and there has been no security review of the code. You are opening up your system to the world and publicity advertising this fact. Expect that any system hosting this software is open to compromise from the Internet and act accordingly. If your router offers a DMZ network, use it. Consider hosting on a cloud based server and think twice before running this software on any system that contains data you care about or has access to networks and computers you care about.
 
If you're hosting at home using Oracle's VirtualBox, there are steps you can take to prevent double NAT (which can cause issues later on)
 
1. Select your VM and then click Settings in VirtualBox's main window.
 
2. Click on Network and change Attached To from NAT to Bridged Adapter.
 
Once you've done this, your VM should be connected directly to your home router and double NAT should no longer be a issue.
----
 
==== Starting Server Install ====
 
====Obtaining an ApiKey====
For your server to show up in the server list, there is now a requirement to have an ApiKey issued by vankrupt. This is to prevent DOS attacks against the master server
 
Get the key by going here: https://pavlov-ms.vankrupt.com/servers/v1/key and using your mobile number to get a SMS
(note that there have been reported failures of this SMS system for non-US mobiles. In this case DM davevillz your mobile and ask for a key)
 
 
Put this key in your Game.ini as follows:
    ApiKey="ABC123FALSEKEYDONTUSEME"
or if you would like (personally untested..I would use game.ini) you can call it at server runtime with flag as follows:
  -KEY="ABC123FALSEKEYDONTUSEME"
 
This key can be re-used for a reasonable number of servers (a limit of 10 has been mentioned). Contact the Devs if you need more servers per key.
 
====System setup and software installation====
 
Install dependencies and create the `steam` user. (You only need to do this once):
 
Confirm Linux version
<pre>
lsb_release -a
</pre>
 
'''Ubuntu 20.04'''
<pre>
sudo apt update && sudo apt install -y gdb curl lib32gcc1 libc++-dev unzip
sudo useradd -m steam
</pre>
 
'''Ubuntu 20.10 or higher'''
<pre>
sudo apt update && sudo apt install -y gdb curl lib32gcc-s1 libc++-dev unzip
sudo useradd -m steam
</pre>
 
'''Rocky Linux, CentOS 8, and RHEL 8'''
 
<pre>
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/g' /etc/selinux/config
sudo setenforce 0
sudo yum install gdb curl glibc.i686 libstdc++.i686 libstdc++-devel.i686 libstdc++-devel.x86_64 unzip wget -y
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libcxx-3.8.0-3.el7.x86_64.rpm
sudo rpm -i libcxx-3.8.0-3.el7.x86_64.rpm
sudo useradd -m steam
</pre>
 
[Optional] Set a password for steam.
<pre>sudo passwd steam</pre>
 
Login as the steam user. ('''You will need to do this each time you connect to your server'''):
 
<pre>
sudo su -l steam
</pre>
 
 
Install Steam:
 
<pre>
mkdir ~/Steam && cd ~/Steam && curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
</pre>
 
There are different dedicated server versions for Pavlov Server - choose which server version you want to host (PC non-beta, PC Beta, Shack Live, or Shack RC)
(You will need to run this command each time there is a Pavlov Server update).
 
<br />
To host '''PC Server (non-beta)''':
 
<pre>
~/Steam/steamcmd.sh +force_install_dir /home/steam/pavlovserver +login anonymous +app_update 622970 -beta default +exit
</pre>
 
To host '''PC BETA''':
 
<pre>
~/Steam/steamcmd.sh +force_install_dir /home/steam/pavlovserver +login anonymous +app_update 622970 -beta beta_server +exit
</pre>
 
To host '''Shack Live''' (Quest):
 
<pre>
~/Steam/steamcmd.sh +force_install_dir /home/steam/pavlovserver +login anonymous +app_update 622970 -beta shack +exit
</pre>
 
To host '''Shack RC''' (Quest): <br />
 
<pre>
~/Steam/steamcmd.sh +force_install_dir /home/steam/pavlovserver +login anonymous +app_update 622970 -beta shack_beta +exit
</pre>
 
Now that we've installed the server, all pavlov server versions should continue.  <br />
Install a fresh copy of steamclient.so (May have to do this after each update):
<pre>
~/Steam/steamcmd.sh +login anonymous +app_update 1007 +quit
mkdir -p ~/.steam/sdk64
cp ~/Steam/steamapps/common/Steamworks\ SDK\ Redist/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
cp ~/Steam/steamapps/common/Steamworks\ SDK\ Redist/linux64/steamclient.so ~/pavlovserver/Pavlov/Binaries/Linux/steamclient.so
</pre>
 
The update 29 of the PCVR version of pavlov and after added a requirement to run these commands to change the steamclient.so:
<code>sudo rm /usr/lib/x86_64-linux-gnu/libc++.so</code>
<code>sudo ln -s /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libc++.so</code>
 
 
Make the PavlovServer script executable. (You only need to do this once):
 
<pre>
chmod +x ~/pavlovserver/PavlovServer.sh
</pre>
 
 
 
 
----
 
=== Server Configuration ===
 
Before starting the server we need to configure it. Start by creating some directories:
 
<pre>
mkdir -p /home/steam/pavlovserver/Pavlov/Saved/Logs
mkdir -p /home/steam/pavlovserver/Pavlov/Saved/Config/LinuxServer
mkdir -p /home/steam/pavlovserver/Pavlov/Saved/maps
</pre>
 
==== Mods/Blacklist/Whitelist (optional)  ====
 
The following three files allow you to specify mods, banned players, and whitelist players.  These are optional, but go ahead and create them.  Populating the files is described later.
 
<pre>
touch /home/steam/pavlovserver/Pavlov/Saved/Config/mods.txt
touch /home/steam/pavlovserver/Pavlov/Saved/Config/blacklist.txt
touch /home/steam/pavlovserver/Pavlov/Saved/Config/whitelist.txt
</pre>
 
====Configuring Game.ini====
Create a new Game.ini file using following command to open an editor and copy/paste the following block into it then save it. Note not all of these options are required. For instance remove or comment out the Password=0000 line to make a public server with no pin.
<pre>
nano /home/steam/pavlovserver/Pavlov/Saved/Config/LinuxServer/Game.ini
</pre>
 
<pre>
[/Script/Pavlov.DedicatedServer]
bEnabled=true
ServerName="My_private_idaho"
MaxPlayers=10    #Set this to 10 for Shack. 24 is the max for PC, setting it higher will not allow players to join.
ApiKey="ABC123FALSEKEYDONTUSEME"
bSecured=true
bCustomServer=true
bVerboseLogging=false
bCompetitive=false #This only works for SND
bWhitelist=false
RefreshListTime=120
LimitedAmmoType=0
TickRate=90
TimeLimit=60
#Password=0000
#BalanceTableURL="vankruptgames/BalancingTable/main"
MapRotation=(MapId="UGC1758245796", GameMode="GUN")
MapRotation=(MapId="datacenter", GameMode="SND")
MapRotation=(MapId="sand", GameMode="DM")
 
</pre>
 
* '''bEnabled''' - whether the server appears in the server list (unconfirmed)
* '''ServerName''' - name it will be listed as. (approx 35 chars max)
* '''MaxPlayers''' - See suggested specs for limits. 10 standard (10 for shack), 20-24 is max recommended for large maps like Stalingrad or PUSH/RUSH modes, and servers allow a maximum of 24 players.
* '''ApiKey''' - Unique ApiKey required to register server with master server. Replace with your key
* '''bSecured''' - enabled Valve Anti-Cheat (VAC)
* '''bCustomServer''' - activates some new modding tools (save and http functions. Required to write to blacklist.txt for bans)
* '''bCompetitive''' - sets the server to competitive mode for SND. If removed the server will default to false
* '''bVerboseLogging''' - enables verbose logging, mostly detailed statistics.  Be prepared for significant increase in logging.
* '''bWhitelist''' - Only allow users in whitelist.txt to join
* '''RefreshListTime''' - sets how often the running server checks for updates in ban/whitelist/mod files
* '''LimitedAmmoType''' - sets limited ammo mode, see Limited Ammo Types table below
 
* '''TimeLimit''' - sets time limit for each map
* '''TickRate''' - sets the server tickrate. (so far minimum stable seems around 50 and max around 120. Beware setting this changes weapon despawn time and breaks some game modes. Recommend not touching)
* '''Password''' - PIN number for server #FYI - this is now also changeable via rcon.
* '''BalanceTableURL''' - Points to a custom balance table from github. See https://github.com/vankruptgames/BalancingTable for instructions. This line isn't needed if you don't have one.
* '''MapRotation''' - you can add multiple of these. The map system has switched from the steam workshop to modio which means that the server rotation will need to be redone with modio UGCs. <nowiki>https://mod.io/g/pavlov</nowiki>. This is done by taking the resource ID from the modio page, adding “UGC” in front of it and then adding that to the rotation. For example the map gravity <nowiki>https://mod.io/g/pavlov/m/gravity1</nowiki> has a resource ID of 2773760 so the map ID to add to the server would be “UGC2773760”. When a match ends, the server will load the next map in the rotation. 
* '''AFKTimeLimit''' There is now a feature to kick players who are idle in the game. Integers are measured in seconds and 0 disables AFK kicking completely.
 
Available game modes as of 09/06/2022: See Game modes table below
 
For maps running a Custom gamemode (CodZ, BR, Duel, etc.) it doesn't matter which gamemode you choose, as the map will automatically override it with the custom mode.
 
{| class="wikitable"
|+Limited Ammo Types
!AmmoType
!Name
!Description
|-
|0
|Unlimited
|Players have unlimited ammo, carry no ammo boxes and do not display an ammo count on the wrist.
|-
|1
|Limited Generic
|Players carry ammo boxes with a limited amount of ammo.
One box for each weapon class (Pistol, Submachine gun, Rifles/MGs, Shotgun, Sniper).
 
Mags and ammo boxes can be put on the chest of the player to consolidate the ammo.
 
An ammo count is displayed on the wrist.
|-
|2
|Limited Specific
|Players carry ammo boxes with a limited amount of ammo.
One box for each weapon.
 
Mags and ammo boxes can be put on the chest of the player to consolidate the ammo.
 
An ammo count is displayed on the wrist.
|-
|3
|Custom
|Allows for full control over ammo by the map.
|-
|4
| Limited Special
|'''All weapons except "special" weapons are unlimited, more clarification is needed.'''
|-
|5
|Boxless
|'''Like limited generic but without boxes? Clarification is needed.'''
|}
{| class="wikitable"
|+Game modes
!GameMode
!Name
|-
|DM
|Death match
|-
|KOTH
|King of the hill
|-
|GUN
| Gun game
|-
|OITC
| One in the chamber
|-
|SND
|Search and destroy
|-
|TANKTDM
|WW2 Team Death Match
|-
| TDM
|Team Death Match
|-
|TTT
|Trouble in Terrorist Town
|-
|WW2GUN
|WW2 gun game
|-
|ZWV
| Zombie wave survival
|-
|HIDE
|The Hidden
|-
|INFECTION
|Hidden infection
|-
|PUSH
|Push
|-
|PH
|Prop hunt
|}
= Default Map ID's =
datacenter
 
sand
 
bridge
 
containeryard
 
siberia (Prison Break)
 
hospital (Zombies map)
 
killhouse
 
range
 
tutorial
 
santorini
 
station
 
industry
 
ogcontainers (Shack only)
 
haguenau (Shack only)
 
foundation (Shack only)
 
stalingrad (PC only)
 
stalingrad_night (PC only)
 
santorini_night (PC only)
 
sand_night (PC only)
 
station_night (PC only)
 
industry_night (PC only)
 
bunker (PC only)
 
 
==== Firewall/Port forwarding ====
Using the default settings there are two UDP ports (7777, 8177) that need to be allowed to access the server either by firewall setup or port forwarding.
 
'''Ubuntu''' firewall commands to check firewall and open ports:
<pre>
sudo ufw status
sudo ufw allow 7777
sudo ufw allow 8177
sudo ufw allow 9100
sudo ufw status
</pre>
 
'''Rocky Linux''' firewall commands to check firewall and open ports:
<pre>
sudo firewall-cmd --zone=public --add-port=7777/tcp
sudo firewall-cmd --zone=public --add-port=7777/udp
sudo firewall-cmd --zone=public --add-port=8177/tcp
sudo firewall-cmd --zone=public --add-port=8177/udp
sudo firewall-cmd --zone=public --add-port=9100/udp
sudo firewall-cmd --zone=public --add-port=9100/tcp
sudo firewall-cmd --list-ports
firewall-cmd --runtime-to-permanent
</pre>
 
You may also need to allow Pings (ICMP) for the server's true latency to appear in the master list.
 
If you are running multiple servers and have set additional ports (see http://wiki.pavlov-vr.com/index.php?title=Dedicated_server#Running_multiple_servers_on_one_host) then you need to allow access to the defined port plus the port 400 higher. So if you use 7000 as your port, then UDP 7000 and 7400 need to be open
 
If you have setup rcon via RconSettings.txt (below) then that port also need to be allowed access via TCP
 
If you are running Shack/Quest and want to have maps that are downloadable from your server, your server ports (ex. 7777 & 8177) must also be open via TCP
 
----
 
==== Shack Maps (Quest) ====
 
If you try to use the steps above to add maps for Shack, youll run into issues very quickly. This is because Shack has no affiliation to Steam, and therefore cannot use Steam Workshop maps like above. In the future, these steps will apply to PC servers as well, allowing a server to hold the map itself, instead of offloading to Steam.
 
To get started, first create the directory to hold the maps
 
<pre>mkdir -p /home/steam/pavlovserver/Pavlov/Saved/maps</pre>
 
You can use any number of methods to move the map files onto the server, but ill go over the two simplest, starting with a GUI approach
 
Download and install CyberDuck onto your "home" PC (Whatever PC you use for access to the server, but not the server itsself): https://cyberduck.io/
 
Next, download and unzip your map of choice from https://www.pavlovquest.com/ , https://pavlovhorde.com/mapsList, or look in #shack-map-showcase channel in the discord server.  I'm going to use Cheeto's WW2 Items test (http://www.mediafire.com/file/emyt9bs1z9u9ykw/SVR_Cheeto_Items.zip/file ) for this example, you do what you like
 
In the top left corner, open a connection, set the connection type to SFTP, and fill in the rest of the information. User will be root, password is whatever you set the root pw as (toor in Ubuntu by default)
 
In the directory dropdown (itll say /root) go back to /
 
Follow the directories until we arrive back at our "maps" folder <pre>/home/steam/pavlovserver/Pavlov/Saved/maps</pre>
 
Drag and drop the unzipped map folder into the main window, in this case itll be SVR_Cheeto_Items
 
Hit Allow
 
Youll now see a folder named SVR_Cheeto_Items, and within it should be nothing but 3 files. If there is another folder in it, move this folder to the maps directory, otherwise the server wont work. The 3 files (2 .PAK one .JSON) should be in home/steam/pavlovserver/Pavlov/Saved/maps/SVR_Cheeto_Items, no more, no less.
 
Pavlov Shack servers load maps at pavlovserver start.  '''YOU MUST RESTART THE GAME SERVER TO USE THE MAPS.'''
 
To play the map, you can either use RCON switch map command, or to add the map to your servers automatic map rotation list, add the map's folder name to your Game.ini. This replaces the MapID section, so for our example it would be
 
<pre>MapRotation=(MapId="SVR_Cheeto_Items", GameMode="TDM")</pre>
 
And thats all! Disconnect CyberDuck from your server before playing, otherwise youll have difficulty joining.
 
-----------
 
==== Adding Shack Maps over Command Line Interface ====
 
Pavlov Shack servers load maps at pavlovserver start.  '''YOU MUST RESTART THE GAME SERVER TO USE THE MAPS.'''
 
A bit more complicated, but adding maps over CLI has its benefits
 
First, CD to the maps directory you made above
 
<pre>cd ~/pavlovserver/Pavlov/Saved/maps</pre>
 
Download the map files from whatever you use to upload them. To do this, you can either use curl or wget
 
<pre>curl -O insertURLhere</pre>
 
 
<p>'''If you download your map from Google Drive''', make sure that your .zip folder is shared to anyone.</p>
Then, get the file's url from the shared link. <p>Example : ''<nowiki>https://drive.google.com/file/d/19bI8gUHaN5tUrDvnadAacUnchQf6_k/view</nowiki>''</p> <p>will be ''19bI8gUHaN5tUrDvnadAacUnchQf6_k''</p>
Edit "fileId" and "fileName" before you execute the command.
<pre>
fileId=19bI8gUHaN5tUrDvnadAacUnchQf6_k
fileName=SVR_USER_MAPNAME
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${fileId}" > /dev/null
code="$(awk '/_warning_/ {print $NF}' /tmp/cookie)" 
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${code}&id=${fileId}" -o ${fileName} </pre>
 
 
To keep with the Items example:
 
<pre>curl -O https://cdn.discordapp.com/attachments/744185280759857234/745027406695366788/SVR_Cheeto_Items.zip</pre>
 
Next, unzip the file. If this next step errors out, saying the command is unknown, switch back to the root user (su root), and install unzip (sudo apt install unzip), then return to the steam user, and continue.
 
<pre>unzip SVR_Cheeto_Items.zip</pre>
 
Now finish like before by adding the map to your Game.ini
 
<pre>nano /home/steam/pavlovserver/Pavlov/Saved/Config/LinuxServer/Game.ini</pre>
 
<pre>MapRotation=(MapId="SVR_Cheeto_Items", GameMode="TDM")</pre>
 
==== Admin/Moderator list (optional) ====
 
The only working in-game admin menu is through Arctic VR server hosting (see below). 
 
If you add moderators to your server, they will not be subject to vote kicks.
 
<pre>
nano ~/pavlovserver/Pavlov/Saved/Config/mods.txt
</pre>
 
Example Mod List:
<pre>
76541198397498572 #Optional Comment: Player name
76541198397498573 #Some Other Player
</pre>
 
==== ArcticVR Admin Menu ====
 
[[File:Arcticmenu.jpg|500px|link=https://www.arctic-vr.com/server-admin-menu]]
 
Arctic-VR Offers an advanced In-Game Admin menu that is exclusive to their hosting service. Features include:
* Switch Maps+Modes
* Teleport Players to Players
* Change Player Skins
* Control Player Buying+Cash
* Spawn Items
* Clean up corpses + guns
* Spawn Bots
* Spawn Items for other players
* Control Teams + Balance/Shuffle Teams
* ResetSND
* And More
 
You can read more about the ArcticVR admin menu on their website: https://www.arctic-vr.com/server-admin-menu
 
==== Handy tools for finding steamIDs ====
 
Steam ID finder: https://steamidfinder.com/lookup/ or https://steamid.xyz/
 
You want to enter in the steamID64 format.
 
This tool can convert or lookup IDs:  https://steamid.io/
 
If you are looking for a steamID of a player that has been on your server recently this is technique to find them:
<pre>
grep -i playername ~/pavlovserver/Pavlov/Saved/Logs/* | grep TicketValidation
</pre>
 
=== Configure Rcon ===
To enable Rcon access create config file:
<pre> nano /home/steam/pavlovserver/Pavlov/Saved/Config/RconSettings.txt </pre>
 
Copy in the following text - change password, and if desired the port:
<pre>
Password=ChangeThisPassword
Port=9100
</pre>
You must specify a port for the Rcon server to use as well as a Password (use a different port per sever instance if running multiple server instances off the same hardware)
 
=== Starting the server ===
 
 
<pre>
cd ~/pavlovserver && ./PavlovServer.sh
</pre>
 
That's it, your server will be automatically broadcast to the master server! :)
 
Two handy tools to determine quickly if your server is broadcasting are [https://pablub.xyz/ Pablub] (PC only) and [https://pavlovhorde.com/ Horde] (Shack) and [https://pavlovhorde.com/pcServers Horde] (PC version)
 
Note that when you close your terminal, the server will go down. See the "supervisors" section below for how to prevent this.
 
=== Auto-updating the server ===
 
Assuming you have followed this guide and used the default paths, users, and install instructions, you can paste the following into your terminal to auto-update your Pavlov server:
 
<pre>
cat << 'EOF' > $HOME/pavlov_daily_update_and_restart.sh
#!/bin/bash
 
USER="steam"
SERVICENAME="pavlovserver.service"
INSTALLDIRNAME="pavlovserver"
USERHOME="/home/$USER"
 
echo -e "Beginning Pavlov VR update run on $(date)\n\n"
 
systemctl stop "$SERVICENAME"
 
sleep 5
sudo -iu "$USER" "$USERHOME/Steam/steamcmd.sh" +login anonymous +force_install_dir "$USERHOME/$INSTALLDIRNAME" +app_update 622970 +exit
sudo -iu "$USER" "$USERHOME/Steam/steamcmd.sh" +login anonymous +app_update 1007 +quit
sudo -iu "$USER" cp "$USERHOME/Steam/steamapps/common/Steamworks SDK Redist/linux64/steamclient.so" "$USERHOME/.steam/sdk64/steamclient.so"
sudo -iu "$USER" cp "$USERHOME/Steam/steamapps/common/Steamworks SDK Redist/linux64/steamclient.so" "$USERHOME/pavlovserver/Pavlov/Binaries/Linux/steamclient.so"
 
systemctl start "$SERVICENAME"
 
echo -e "Ending Pavlov VR update run on $(date)\n\n"
 
EOF
 
chmod +x $HOME/pavlov_daily_update_and_restart.sh
mkdir $HOME/pavlov_update_logs && touch $HOME/pavlov_update_logs/pavlov_daily_update_and_restart.sh.log
CRONLINE="00 2 * * * $HOME/pavlov_daily_update_and_restart.sh >>$HOME/pavlov_update_logs/pavlov_daily_update_and_restart.sh.log 2>&1"
(sudo crontab -u root -l; echo "$CRONLINE" ) | sudo crontab -u root -
unset CRONLINE
 
</pre>
 
These commands will:
 
1. Create a shell script in the "steam" user's home directory that automatically stops the Pavlov server, pulls any updates via steam, pull updates to the Steamworks SDK Redist, and copies the latest version of steamclient.so to the Pavlov server directory
 
2. Make the shell script executable
 
3. Create a new directory called "pavlov_update_logs" in the "steam" user's directory, and create a logfile inside that directory called "pavlov_daily_update_and_restart.sh.log". You can check this logfile to see the output of the Pavlov and Steam SDK update commands.
 
4. Create a crontab entry for the root user that runs this shell script automatically every day at 2:00AM local time
 
 
If you want to change the time that this script runs, edit the numbers "00 2" in the line that starts with "CRONLINE=". In the example provided, 00 is the minutes column, and 2 is the hour column. For example, if you wanted the server to automatically update and restart at 4:17AM every day, change the line starting with "CRONLINE=" to:
 
<pre>
CRONLINE="17 4 * * * $HOME/pavlov_daily_update_and_restart.sh >>$HOME/pavlov_update_logs/pavlov_daily_update_and_restart.sh.log 2>&1"
</pre>
 
If the time is PM, use 24-hour time format, e.g. "32 18" for 6:32PM.
 
----
 
=== Supervising the server using systemd ===
 
Running '''./PavlovServer.sh''' in your interactive shell is easy, but the server will shut down when you close your terminal. If you want to run the server in the background,
you'll want to run it under a supervisor. There are many options, ranging from the simple (nohup, screen or tmux), to the
more robust (supervisord, systemd).
 
Systemd is running by default on Ubuntu Linux, so we'll use that here.
 
To run the server as a systemd service, create the file '''/etc/systemd/system/pavlovserver.service''' (as root) by typing
<pre>
sudo nano /etc/systemd/system/pavlovserver.service
</pre>
 
Copy contents below into the file and save.
 
<pre>
[Unit]
Description=Pavlov VR dedicated server
 
[Service]
Type=simple
WorkingDirectory=/home/steam/pavlovserver
ExecStart=/home/steam/pavlovserver/PavlovServer.sh
 
RestartSec=1
Restart=always
User=steam
Group=steam
 
[Install]
WantedBy = multi-user.target
</pre>
 
If you'd like your server to start as competitive without editing the game.ini, change the line "ExecStart=/home/steam/pavlovserver/PavlovServer.sh" to look like this below. Though it's much easier to just use the game.ini to enable competitive instead. <pre>ExecStart=/home/steam/pavlovserver/PavlovServer.sh -COMPETITIVE=1</pre>
 
Change the user or paths as appropriate. After saving the service file, to start, restart, stop, or monitor the server:
 
<pre>
sudo systemctl start pavlovserver
sudo systemctl restart pavlovserver
sudo systemctl stop pavlovserver
sudo systemctl status pavlovserver
</pre>
 
To view the logs:
 
<pre>
sudo journalctl -u pavlovserver
# to live-tail the logs
sudo journalctl -u pavlovserver -f
</pre>
 
If you want to run the pavlov server as soon as your server boots (e.g. a VPS you turn on and off), add pavlov as a startup service:
 
<pre>
sudo systemctl enable pavlovserver
</pre>
 
 
 
----
 
== Advanced Server Administration ==
 
=== Running multiple servers on one host ===
 
* Pavlovserver is functionally single threaded (there are multiple threads, but vast majority of work occurs in the primary one). Make sure you have # of pavlovservers + 1 CPU available. More CPUs= more servers. Faster CPU = more players.
* Make multiple server installs by defining a separate install dir for each server.
* Run each server with a unique port. eg: '''./PavlovServer.sh -PORT="Desired Port"'''
* The Server will use the Desired Port and the Port 400 above (Example: You choose 8200 as Port. So Port 8600 will be used as well)
* If you are using RCON, each server will need a unique port defined in RconSettings.txt
* Ensure the ports are forwarded and opened in your firewall
 
To duplicate directories:
 
be in the steam home folder
<pre>
cp -r pavlovserver pavlovserver1
/home/steam/pavlovserver1/PavlovServer.sh -PORT=[Desired Port]
</pre>
 
=== Starting server in competitive mode ===
Competitive mode will prevent dead teammates from being able to see the match, to prevent ghosting.
You can either enable this via Game.ini (described in Game.ini file), or using the -COMPETITIVE=1 parameter.
 
<pre>
/home/steam/pavlovserver1/PavlovServer.sh -COMPETITIVE=1
</pre>
 
 
{| class="wikitable"
 
|}
 
=== Useful Linux Commands ===
List files / folders in directory, print current working directory,
<pre>ls -la                                    #list files/directories along with authorities and ownership
pwd                                      #print working directory
sudo chown <owner> <file/directory>      #change owner of file/directory.  If root created something and you need to change it to steam
sudo chgrp <group> <file/directory>      #change group of file/directory.
</pre>
 
 
Check if pavlov is running by checking process status.  If the only row you see is the grep command, pavlov server is not started.
<pre> ps -ef | grep pav </pre>
 
Sample output:
<pre>
steam      34044      1  0 16:52 ?        00:00:00 /bin/sh /home/steam/pavlovserver/PavlovServer.sh
steam      34066  34044 80 16:52 ?        00:00:04 /home/steam/pavlovserver/Pavlov/Binaries/Linux/PavlovServer
zombies+  34101  34013  0 16:52 pts/0    00:00:00 grep --color=auto pav
</pre>
 
Kill a process.  Note this command uses 34044, which is a process id from the command output above.
<pre> kill -9 34044          </pre>
 
Dump the log to the console so you can scroll through it:
<pre> cat /home/steam/pavlovserver/Pavlov/Saved/Logs/Pavlov.log </pre>
 
Search the log for a string - replace my_string with case-sensitive string
<pre> cat /home/steam/pavlovserver/Pavlov/Saved/Logs/Pavlov.log | grep my_string </pre>
 
 
 
 
 
[[Category:RCON automation]]

Latest revision as of 03:47, 6 July 2023

What does and does not belong on this page

If something describes in detail how an aspect of the implementation of Pavlov VR dedicated servers works, it belongs on this page.

If something is only tangentially related to dedicated servers, like how to get an MD5 checksum from text, how to use bash, execute files, use (s)ftp, port forwarding, file permissions, specific features of tools/libraries, do not belong on this page. That's what guides are for and wikis do not contain guides! Guides may be linked at the bottom of the article.

If something is a hack and not officially supported, such as having more than 10 max players on shack servers, does not belong on this page.

DO NOT REPLICATE INFORMATION THAT IS AVAILABLE IN OTHER PAGES OR WIKIS. LINK TO THEM INSTEAD!

Users are expected to have a certain brain capacity to be able to google for things to figure them out. This is not an IT help forum that explains in detail how to use computers. All it must contain is information specific to dedicated server software.

Grammar and syntax

The user/reader is never to be referred to directly. Reflexive and personal pronouns are to be avoided.

Bad: You can run the command.

Good: This command can be run.

Bad: If this does not work, try something else.

Good: There are alternatives, should this not work.

Bad: Note: I don't think this is accurate

Good: Note: The accuracy of this information may be questionable.