Gaming: Difference between revisions

From MalinWiKi
Jump to navigation Jump to search
No edit summary
(Replaced content with "* Vrising Dedicated Server")
Tag: Replaced
Line 1: Line 1:
* [[Vrising Dedicated Server]]
* [[Vrising Dedicated Server]]
=VRising Dedicated Server=
==Prerequisites==
Add non-free and contrib to /etc/apt/sources.list after main
so this line:
<pre>deb http://deb.debian.org/debian bullseye main</pre>
looks like this one
<pre>deb http://deb.debian.org/debian bullseye main non-free contrib</pre>
Add winehq repo for Debian
<pre>sudo echo "deb https://dl.winehq.org/wine-builds/debian/ bullseye main" >> /etc/apt/sources.list.d/winehq.list</pre>
Download apt key
<pre>wget -nc https://dl.winehq.org/wine-builds/winehq.key</pre>
Add key
<pre>sudo apt-key add winehq.key</pre>
Add 32-bit architecture support
<pre>sudo dpkg --add-architecture i386</pre>
Update apt and install packages
<pre>sudo apt update
sudo apt install winehq-stable winetricks steamcmd:i386</pre>
create user steam
<pre>useradd steam -m -s /bin/bash</pre>
==Make WINE headless==
For this server to run, we need to make wine headless
source: https://superuser.com/questions/902175/run-wine-totally-headless
source: https://serverdiary.com/linux/how-to-install-xvfb-and-create-systemd-xvfb-service-on-centos-7-8-or-rhel-7-8/
Install Xvfb a fake X11 server
<pre>sudo apt install xvfb</pre>
Create a systemd script to run it with in /etc/systemd/system/xvfb.service:
<pre>
[Unit]                                           
Description=Xvfb headless fake X server         
After=network.target                             
                                                 
[Service]                                       
User=root                                       
ExecStart=/usr/bin/Xvfb :0 -screen 0 1024x768x16 
                                                 
[Install]                                       
WantedBy=multi=user.target                       
Alias=Xvfb.service                                                             
</pre>
To enable and start the script:
<pre>sudo systemctl enable xvfb.service
sudo systemctl start xvfb.service</pre>
Install the allfonts winepackage as user steam with winetricks
login as user steam
<pre>su - steam</pre>
<pre>winetricks allfonts</pre>
==Install VRising dedicated server==
Run steamcmd to install the server software
<pre>steamcmd</pre>
you will now get a Steam> prompt
In the Steam> prompt login as anonymous
<pre>login anonymous</pre>
First, tell SteamCMD to use windows as the platform, as there's currently a Windows version of VRising Server currently:
<pre>@sSteamCmdForcePlatformType windows</pre>
Optional: If you want to install the server to a specific directory in the /home/steam folder:
<pre>force_install_dir ./<name of folder></pre>
Proceed with the installation app_update and steamID
<pre>app_update 1829350</pre>
When the server software is finished with the installation, exit steamcmd with pressing ctrl + c
To logout from steam user, press ctrl + d
==Run the server with systemd==
Make a systemd script to run the server from.
Add this snippet to /etc/systemd/system/vrising.service
<pre>
[Unit]                                                                                                                 
Description=VRising server service                                                                                     
Wants=network-online.target                                                                                             
Requires=xvfb.service                                                                                                   
                                                                                                                       
[Service]                                                                                                               
Environment=DISPLAY=:0.0                                                                                               
ExecStart=wine VRisingServer.exe -persistentDataPath .\save-data -serverName "Malinux V Rising Server" -saveName "MyWorld
-1" -logFile ".\logs\VRisingServer.log"                                                                                 
WorkingDirectory=/home/steam/Steam/steamapps/common/VRisingDedicatedServer/                                             
user=steam                                                                                                             
group=steam                                                                                                             
                                                                                                                       
[Install]                                                                                                               
WantedBy=multi-user.target                                                                                             
</pre>
Set the WorkingDirectory to where your VRisingServer.exe is located if you put it in a custom location
==Forward ports==
enable and open ports in ufw
<pre>
ufw allow 9876 comment 'Comment that describes this ufw rule game-traffic and rcon'
ufw allow 9877 comment 'Comment that describe this ufw rule query-port' </pre>
==configure the server==
I'll add more later

Revision as of 09:39, 18 June 2022