备注写前边
操作系统:Centos7.9 服务器配置 腾讯云2h2g3m
手动启动服务
用steam用户手动启动游戏服务后台挂起启动服务 执行成功后可关闭ssh界面
命令如下:

cd /home/steam/Steam/steamapps/common/PalServer
nohup ./PalServer.sh &

配置低的小内存服务器首先设置下虚拟(交换)内存swapfile可以先设置6G试一下

手动部署从这里开始

安装PalServer

1.安装所需库

yum install glibc.i686 libstdc++.i686

2.创建用户

sudo useradd -m steam 
sudo passwd steam

sudo -u steam -s 
cd /home/steam

3.下载steamcmd

mkdir ~/Steam && cd ~/Steam

curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

4.下载PalServer

官方教程地址https://tech.palworldgame.com/dedicated-server-guide#linux

./steamcmd.sh +login anonymous +app_update 2394010 validate +quit

下载完成后 进入到游戏目录中 尝试运行

cd steamapps/common/PalServer
./PalServer.sh

如果出现 .steam/sdk64/steamclient.so: cannot open shared object file: No such file or directory报错
则回到steamcmd目录

cd /home/steam/Steam
mkdir -p ~/.steam/sdk64/
./steamcmd.sh +login anonymous +app_update 1007 +quit
cp ~/Steam/steamapps/common/Steamworks\ SDK\ Redist/linux64/steamclient.so ~/.steam/sdk64/

然后重新尝试运行即可

cd steamapps/common/PalServer
./PalServer.sh

运行后若出现下面的报错为正常情况

sh: xdg-user-dir: command not found
dlopen failed trying to load:
steamclient.so
with error:
steamclient.so: cannot open shared object file: No such file or directory
[S_API] SteamAPI_Init(): Loaded '/home/steam/.steam/sdk64/steamclient.so' OK.  (First tried local                 
'steamclient.so')
CAppInfoCacheReadFromDiskThread took 1 milliseconds to initialize
Setting breakpad minidump AppID = 2394010
[S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.
[S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.
[S_API FAIL] Tried to access Steam interface STEAMAPPS_INTERFACE_VERSION008 before SteamAPI_Init         
succeeded.
[S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.

5.编辑配置文件

默认配置文件位置/home/steam/Steam/steamapps/common/PalServer/DefaultPalWorldSettings.ini下面两行一起复制,不行的话就先复制第一行+空格+第二行 然后回车

cp /home/steam/Steam/steamapps/common/PalServer/DefaultPalWorldSettings.ini 
/home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini

编辑配置文件或者本地编辑完上传到配置文件目录

vim /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini

配置文件参数(使用OpenVPN,无需填写PublicIP):
双击查看大图
微信截图_20240123174057.png

在游戏中使用管理员命令
按下Enter调出聊天框,输入/adminpassword 你设置的管理员密码 即可获得管理员权限

管理员命令
微信截图_20240123181617.png

获取steamID
在获取管理员权限后,按下 ESC 后点击 选项 即可看到steamid,右键单击两次即可复制

6.将程序注册为服务

先Ctrl+C将服务停止,然后输入下方命令即可对程序进行挂起

切到root用户

sudo su
sudo usermod -aG wheel steam

然后切回steam用户

su steam
sudo vim /etc/systemd/system/palserver.service

填写以下配置

[Unit]
Description=PalServer
After=network.target

[Service]
ExecStart=/home/steam/Steam/steamapps/common/PalServer/PalServer.sh
Restart=always

[Install]
WantedBy=default.target

设置开机自启

sudo systemctl enable palserver

启动

sudo systemctl start palserver

查看状态

sudo systemctl status palserver

配置文件

Difficulty=None(难度None或Difficulty) 

DayTimeSpeedRate=1.000000 (日间速度倍率)

NightTimeSpeedRate=1.000000 (夜间速度倍率)

ExpRate=1.000000 (经验倍率)

PalCaptureRate=1.000000 (帕鲁捕获倍率)

PalSpawnNumRate=1.000000 (帕鲁生成数量倍率)

PalDamageRateAttack=1.000000 (帕鲁攻击伤害倍率)

PalDamageRateDefense=1.000000 (帕鲁防御伤害倍率)

PlayerDamageRateAttack=1.000000 (玩家攻击伤害倍率)

PlayerDamageRateDefense=1.000000 (玩家防御伤害倍率)

PlayerStomachDecreaceRate=1.000000 (玩家饥饿减少速率)

PlayerStaminaDecreaceRate=1.000000 (玩家体力减少速率)

PlayerAutoHPRegeneRate=1.000000 (玩家自动血量恢复倍率)

PlayerAutoHpRegeneRateInSleep=1.000000 (玩家睡眠中自动血量恢复倍率)

PalStomachDecreaceRate=1.000000 (帕鲁饥饿减少速率)

PalStaminaDecreaceRate=1.000000 (帕鲁体力减少速率)

PalAutoHPRegeneRate=1.000000 (帕鲁自动血量恢复倍率)

PalAutoHpRegeneRateInSleep=1.000000 (帕鲁睡眠中自动血量恢复倍率)

BuildObjectDamageRate=1.000000 (建筑物受损倍率)

BuildObjectDeteriorationDamageRate=1.000000 (建筑物劣化受损倍率)

CollectionDropRate=1.000000 (收集物掉落倍率)

CollectionObjectHpRate=1.000000 (收集物体生命值倍率)

CollectionObjectRespawnSpeedRate=1.000000 (收集物体重生速度倍率)

EnemyDropItemRate=1.000000 (敌人掉落物品倍率)

DeathPenalty=All (死亡掉落,填None就行)——

Death penalty 

None : No lost, 

Item : Lost item without equipment, 

ItemAndEquipment : Lost item and equipment,

All : Lost All item, equipment, pal(in inventory)

bEnablePlayerToPlayerDamage=False (允许玩家对玩家造成伤害)

bEnableFriendlyFire=False (允许友军伤害)

bEnableInvaderEnemy=True (允许入侵)

bActiveUNKO=False 

bEnableAimAssistPad=True (启用手柄瞄准辅助)

bEnableAimAssistKeyboard=False (启用键盘瞄准辅助)

DropItemMaxNum=3000 (掉落物品最大数量)

DropItemMaxNum_UNKO=100 (掉落物品最大数量_UNKO)

BaseCampMaxNum=128 (基地最大数量)

BaseCampWorkerMaxNum=15 (基地工人最大数量)

DropItemAliveMaxHours=1.000000 (掉落物品存活最长时间(小时)

bAutoResetGuildNoOnlinePlayers=False (自动重置公会无在线玩家)

AutoResetGuildTimeNoOnlinePlayers=72.000000 (无在线玩家时自动重置公会时间(小时)

GuildPlayerMaxNum=20 (公会最大玩家数量)

PalEggDefaultHatchingTime=72.000000 (伙伴蛋默认孵化时间(小时)

WorkSpeedRate=1.000000 (工作速度倍率)

bIsMultiplay=False (多人游戏)

bIsPvP=False (PvP模式)

bCanPickupOtherGuildDeathPenaltyDrop=False(可拾取其他公会的死亡掉落物)

bEnableNonLoginPenalty=True(启用不登录惩罚)

bEnableFastTravel=True(启用快速旅行)

bIsStartLocationSelectByMap=True(通过地图选择起始位置)

bExistPlayerAfterLogout=False(离线后玩家仍然存在)

bEnableDefenseOtherGuildPlayer=False(启用防御其他公会玩家功能)

CoopPlayerMaxNum=4(合作玩家最大人数)

ServerPlayerMaxNum=32(服务器玩家最大人数)

ServerName="Default Palworld Server"(服务器名称)

ServerDescription=""(服务器描述)

AdminPassword="",

ServerPassword="",

PublicPort=8211(服务器端口)

PublicIP=""(服务器ip)

RCONEnabled=False

RCONPort=25575

Region=""

bUseAuth=True

BanListURL="https://api.palworldgame.com/api/banlist.txt" 

如果您想要一键自动部署,可以参考一键自动化部署幻兽帕鲁 Linux 服务器