Giter Club home page Giter Club logo

palworld-go's Introduction

palworld-go

一款解决了《幻兽帕鲁》内存泄漏问题的游戏服务器启动器。

特性

自动重启

80 秒检查一次内存,当内存达到阈值时,通过 RCON 通知所有在线玩家 60 秒后关闭服务器。

服务器关闭之后, 10 秒后重启服务器以达到清理内存的目的。

运行效果图1

运行效果图2

游戏内效果图

自动清理无用内存

在 Windows,Linux 皆可定时清理无用内存,完美解决《幻兽帕鲁》服务器的内存泄漏问题。

运行效果图3

Windows

通过调用微软的 RAMMap 释放无用内存。

Linux

通过 Linux 原生命令释放不再需要的缓存和清空交换空间,以回收内存资源。

自动备份

每经过配置好的时间间隔,对服务器所有数据进行备份,避免因为死档而导致游戏提前完结撒花。

运行效果图4

使用方法

前提条件: 按官方文档安装好所需文件

Windows Steam 客户端

程序中需要使用 fork/exec 命令, 这需要您使用管理员权限运行本程序

  1. 搜索 pal, 右键 Palworld Dedicated Server 如图所示 打开目录
  2. 将目录粘贴到 config.jsongamePath打开目录
  3. 管理员权限打开终端,运行下载好的可执行文件

Windows SteamCMD

程序中需要使用 fork/exec 命令, 这需要您使用管理员权限运行本程序

  1. 将服务器目录粘贴到 config.jsongamePath
  2. 管理员权限打开终端,运行下载好的可执行文件

Linux SteamCMD

wget https://mirror.ghproxy.com/https://github.com/Verthandii/palworld-go/releases/latest/download/palworld-go-linux-amd64
wget https://mirror.ghproxy.com/https://github.com/Verthandii/palworld-go/releases/latest/download/config.json
vim ./config.json
chmod u+x palworld-go-linux-amd64 
./palworld-go-linux-amd64

配置文件描述

配置项 Windows 推荐值 Linux 推荐值 备注
gamePath "D:\Program Files (x86)\Steam\steamapps\common\PalServer" "/home/steam/Steam/steamapps/common/PalServer" 游戏可执行文件路径 PalServer.exe 所处的位置
address "127.0.0.1:25575" "127.0.0.1:25575" 服务器地址 + RCON 端口
adminPassword "WqB6oY7IzMffxF17Q8La" "WqB6oY7IzMffxF17Q8La" RCON 管理员密码
processName "PalServer.exe" "PalServer.sh" 进程名称
processCheckInterval 5 5 进程存活检查间隔(秒)
memoryUsageThreshold 75 75 重启阈值(百分比)
memoryCleanupInterval 600 600 内存清理间隔(秒)0 表示不清理内存
backupPath "D:\Program Files (x86)\backup\PalServer" "/home/steam/backup" 备份路径
backupInterval 1800 1800 备份间隔(秒) 0 表示不备份
maintenanceWarningMessage Memory_Not_Enough_The_Server_Will_Reboot Memory_Not_Enough_The_Server_Will_Reboot 维护警告消息(不支持中文且不支持空格)
usePerfThreads true true 多线程优化

计划

  • 服务器进程保活
  • 服务器内存清理
  • 自动备份
  • 通过页面修改游戏配置(如经验值倍率)

特别鸣谢+推荐

https://gist.github.com/Bluefissure/b0fcb05c024ee60cad4e23eb55463062

https://github.com/Hoshinonyaruko/palworld-go

palworld-go's People

Contributors

piglig avatar verthandii avatar wangzeping722 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

palworld-go's Issues

建议备份按照日期归档

目前备份文件在一个目录下生成很多的备份文件如果备份过多就有很多文件夹不好定位,建议每天的备份归档日期文件夹下

Linux 下的内存清理问题

image
如图,我目前正在使用Linux系统,使用普通用户steam,当内存清理时,会需要我输入密码,期待的是不需要密码

因为steamcmd的特殊性质,使用root权限时无法启动steamcmd

通过宝塔的进程守护管理器来守护palworld-go 会导致服务器覆盖原档

通过宝塔的进程守护管理器来守护palworld-go 会导致服务器覆盖原档,这个有问题解决吗,没开守护之前,我恢复之前的档,一旦使用进程守护管理器 启动后就会重新创建一个新的档,并且覆盖原档,我本是想通过进程守护管理器实现服务器开机自启动的,结果启动后重新开新档了

游戏服务器重启后无法启动进程

服务器在首次执行脚本后如果游戏没有启动,可以正常启动进程
【Supervisor】启动成功,开始守护游戏进程
2024/01/29 17:53:37 【Memory】启动成功,定时清理服务器内存
2024/01/29 17:53:37 【Supervisor】健康检查失败【exit status 1】
2024/01/29 17:53:37 【Supervisor】正在尝试重新启动服务器
2024/01/29 17:53:37 【Supervisor】服务器启动成功

但是我遇到的问题是服务器自动重启后,在启动的时候 无法启动帕鲁进程
2024/01/29 17:54:57 【Supervisor】服务器即将重启, 重新设置轮询周期, 避免长时间等待服务器重
2024/01/29 17:56:07 【Supervisor】ALIVE
2024/01/29 17:56:17 【Supervisor】ALIVE

虽然程序判断已激活状态,但是进程就是没有启动
使用的steam用户执行的

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.