Palworld

Palworld

Not enough ratings
5分钟搭建PalWorld(幻兽帕鲁)游戏服务器
By 猫哥
内含一键脚本 懒人福音
   
Award
Favorite
Favorited
Unfavorite
5分钟搭建PalWorld(幻兽帕鲁)游戏服务器

1.服务器要求

CPU
4核(推荐)
内存
16GB 建议使用 32GB 以上才能稳定运行。用8GB启动服务器是可以的,但是玩得越久,服务器就会因为内存不足而崩溃。
网络
UDP 端口 8211(默认)

作者使用的是腾讯云轻量应用服务器4C8G配置,选择Ubuntu镜像。

2.登录后运行下方脚本


运行完脚本后,程序会自动启动,下面是相关的命令

启动 sudo systemctl start pal-server 重启 sudo systemctl restart pal-server 停止 sudo systemctl stop pal-server 查看状态 sudo systemctl status pal-server

[size=3]3.修改游戏相关配置[/size]

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

可根据官方提供的参数对照进行修改[官方参数文档](https://tech.palworldgame.com/optimize-game-balance)

修改后记得重启服务

sudo systemctl restart pal-server

4.在游戏中使用管理员命令

按下`Enter`调出聊天框,输入/adminpassword 你设置的管理员密码 即可获得管理员权限

[size=3]管理员命令[/size]

命令
描述
机翻描述
/Shutdown {Seconds} {MessageText}
The server is shut down after the number of Seconds Will be notified of your MessageText.
服务器关闭后的秒数将通知您的 MessageText。
/DoExit
Force stop the server.
强制停止服务器。
/Broadcast {MessageText}
Send message to all player in the server.
向服务器中的所有玩家发送消息。
/KickPlayer {SteamID}
Kick player from the server.
将玩家从服务器中踢出。
/BanPlayer {SteamID}
BAN player from the server.
从服务器禁止玩家。
/TeleportToPlayer {SteamID}
Teleport to current location of target player.
传送到目标玩家的当前位置。
/TeleportToMe {SteamID}
Target player teleport to your current location
目标玩家传送到您当前的位置
/ShowPlayers
Show information on all connected players.
显示所有已连接玩家的信息。
/Info
Show server information.
显示服务器信息。
/Save
Save the world data.
保存世界数据。

5.获取steamID

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

[size=3]6.配置虚拟内存以及定时清理缓存[/size]

配置虚拟内存

查看当前虚拟内存空间

free -h

设置虚拟内存为12G,建议根据机型调整

> 内存小于等于 2GB: 设置为内存的两倍。
> 内存大于 2GB 且小于 8GB: 设置为内存的1.5倍。
> 内存大于 8GB 且小于 64GB:等于内存大小。
> 内存大于 64GB: 设置为64GB。

sudo fallocate -l 12G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

再次查看虚拟内存空间

free -h

配置定时清理缓存

vim clean.sh

#!/bin/bash sync echo 1 > /proc/sys/vm/drop_caches