- 版权类型
- 转载
- 插件中文名称
- 翼手龙 PowerAction
- 插件英文名称
- PterodactylPowerAction
- 支持的核心
- Velocity
- 资源语言
- 英语
- 其他
- 适配版本
- 1.17
- 1.18
- 1.19
- 1.20
- 1.20.6
- 1.21
在x时间后关闭服务器,节约能源
代码:
翼手龙面板
如果您有翼手龙面板来管理您的服务器,您可以使用此方法。
首先,创建一个客户端 API 密钥,该密钥可以在“Account Settings”和“API Credentials”下找到,URL 路径应为 是。/account/api
在文件中配置等待服务器,例如:velocity.toml
[servers]
limbo = "127.0.0.1:30066"
在您的 Velocity 代理上安装插件,代理启动时将创建一个默认配置文件。 最后,编辑插件的配置文件以包含您的 Pterodactyl 凭据。
type: "pterodactyl" # Can also be "shell", see the README for more information
# Create a new client API key which can be found under "Account Settings" then " API Credentials", the URL path should be https://pterodactyl.test/account/api.
pterodactyl_api_key: "ptlc_xxx"
pterodactyl_client_api_base_url: "https://pterodactyl.test/api/client" # No trailing slash
servers:
# "survival" is the name of the configured server in your "velocity.toml" file
# "abc" should be replaced with the identifier of your server in Pterodactyl
# this can be found in the URL such as: https://pterodactyl.test/server/:server_id
# where ":server_id" is the identifier of the server
survival: "abc"
waiting_server_name: "limbo" # "limbo" is the name of the configured server in your "velocity.toml" file
maximum_ping_duration: 60 # in seconds
shutdown_after_duration: 3600 # in seconds
redirect_to_waiting_server_on_kick: true
Shell 命令
如果您没有翼手龙面板,并且直接从 Linux shell 运行服务器,则可以修改 plugin 的配置来运行 shell 命令。
这尚未在 Windows 上进行测试,请注意,该命令将不起作用,您必须改用该设置。cdworking_directory
以下是使用 docker compose 管理器服务器的示例:
type: "shell"
servers:
survival:
# "working_directory" can be omitted and the current working directory will be used instead
working_directory: /path/to/docker/compose
start: docker compose start survival
stop: docker compose stop survival
waiting_server_name: "limbo"
maximum_ping_duration: 60 # in seconds
shutdown_after_duration: 3600 # in seconds
redirect_to_waiting_server_on_kick: true