游戏优化-第三方优化patch
# 定义初始变量 steam_user=steam log_path=/tmp/pal_server.log steam_user_path=~steam steamcmd_path=$(whereis steamcmd|awk '{print $2}') # 定义Binaries路径 bindir=`find /home/ -name Pal`/Binaries/Linux # 下载并替换文件 sudo systemctl stop pal-server sudo cp $bindir/PalServer-Linux-Test $bindir/PalServer-Linux-Test.bak sudo wget -O $bindir/PalServer-Linux-Test https://github.com/VeroFess/PalWorld-Server-Unoffical-Fix/releases/download/1.3.0-Update-3/PalServer-Linux-Test-Patch-Update-3 sudo chmod 775 $bindir/PalServer-Linux-Test sudo systemctl restart pal-server
备份及恢复
备份游戏
# 定义初始变量 steam_user=steam log_path=/tmp/pal_server.log steam_user_path=~steam steamcmd_path=$(whereis steamcmd|awk '{print $2}') # 安装zip/unzip命令 sudo apt install zip unzip # 定义Saved路径 sd=`find /home/steam/ -name 'Pal'|awk '{print $1}'`/Saved # 以时间为文件名打包,存储在当前目录下 zip -r PalWorld-$(date +"%Y-%m-%d_%H-%M-%S").zip $sd
恢复存档
服务器恢复服务器存档(Linux)
请先确保您已成功上传备份的Saved压缩文件
# 定义初始变量 steam_user=steam log_path=/tmp/pal_server.log steam_user_path=~steam steamcmd_path=$(whereis steamcmd|awk '{print $2}') # 安装unzip命令 sudo apt install unzip # 定义Saved路径 sd=`find /home/steam/ -name 'Pal'|awk '{print $1}'`/Saved # 解压您的PalWorldSave压缩包到Saved,其中需要替换为您自己的PalWorld.zip unzip -o PalWorld-xxx.zip -d $sd # 替换LinuxServer LSN=$(ls -tr $sd/SaveGames/0/|awk 'NR==1{print $1}') sed -i "s/^DedicatedServerName=.*/DedicatedServerName=$LSN/" $sd/Config/LinuxServer/GameUserSettings.ini chmod 777 -R $sd # 更新并重启游戏 sudo -u $steam_user $steamcmd_path +login anonymous +app_update 1007 validate +quit >> $log_path sudo -u $steam_user $steamcmd_path +login anonymous +app_update 2394010 validate +quit >> $log_path sudo -u $steam_user $steamcmd_path +login anonymous +app_update 1007 +quit >> $log_path sudo cp $steam_user_path/Steam/steamapps/common/Steamworks\ SDK\ Redist/linux64/steamclient.so $steam_user_path/.steam/sdk64/ systemctl restart pal-server