Steam搭建私服教程

0、设置服务器交换空间

dd if=/dev/zero of=/mnt/swap bs=1M count=4096

mkswap /mnt/swap

swapon /mnt/swap

vi /etc/fstab

/mnt/swap swap swap defaults 0 0

reboot

1、安装编译环境

yum update -y
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
yum install glibc.i686 libstdc++.i686 libcurl.i686 screen -y

2、下载 steamCMD,安装

useradd -m steam
su steam
mkdir ~/steamcmd
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz

./steamcmd.sh

quit

3、在steam 状态下匿名登录,安装⼯⼚服务器

./steamcmd.sh +login anonymous +force_install_dir ~/SatisfactoryDedicatedServer +app_update 1690800 validate +quit

yum -y install SDL2.i686 SDL2.x86_64

4、加载存档

mkdir -p ~/.config/Epic/FactoryGame/Saved/SaveGames/server
cd ~/.config/Epic/FactoryGame/Saved/SaveGames/server
#上传.sav存档⽂件⾄此处

5、服务器编译配置(以下内容需root权限)

vim /home/steam/SatisfactoryDedicatedServer/start_server.sh
#!/bin/bash
export InstallationDir=/home/steam/SatisfactoryDedicatedServer
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$InstallationDir/linux64:$LD_LIBRARY_PATH
# Install or update the server before launching it
/usr/games/steamcmd +login anonymous +force_install_dir $InstallationDir +app_update 1690800 validate +quit
# Launch the server
$InstallationDir/FactoryServer.sh
export LD_LIBRARY_PATH=$templdpath
chmod +x /home/steam/SatisfactoryDedicatedServer/start_server.sh

vim /etc/systemd/system/satisfactory.service
[Unit]
Description=Satisfactory Server
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
Restart=always
RestartSec=10
User=steam
WorkingDirectory=/home/steam/SatisfactoryDedicatedServer
ExecStart=/home/steam/SatisfactoryDedicatedServer/start_server.sh
[Install]
WantedBy=multi-user.target
systemctl enable satisfactory.service
systemctl start satisfactory.service

你可能感兴趣的:(Steam搭建私服教程)