简介
AutoStartStop 是一款 Velocity 插件,用于通过灵活、基于规则的系统实现服务器自动化管理。
你可以定义规则以响应触发器(如代理启动、玩家连接、定时任务等事件),并执行操作(启动/停止服务器、连接/断开玩家、记录日志消息等),同时可选择性地通过条件进行限制。
工作原理
AutoStartStop 将你的配置评估为:
- 设置 (Settings):插件的全局设置(超时时间、间隔等)。
- 服务器 (Servers):管理哪些后端服务器,以及如何控制它们(Shell、AMP 或 Pterodactyl API)。
- 规则 (Rules):在何种情况下应该发生什么。
- 触发器 (Triggers):规则何时触发?(例如
connection、proxy_start、cron、empty_server)
- 条件 (Conditions) (可选):现在是否应该运行?(例如“服务器离线”、“玩家数量 > 0”)
- 操作 (Actions):应该发生什么?(例如
start、stop、send_message、disconnect)
以下是整体 config.yml 结构的概览:
settings: { ... } # 插件全局设置(超时时间、间隔等)。
defaults: { ... } # 服务器配置的全局默认值。
servers: { ... } # 管理哪些后端服务器,以及如何控制它们。
rules: { ... } # 在何种情况下应该发生什么。
主要功能
- 基于规则的自动化:定义响应触发器并执行操作的规则
- 多种控制 API:支持 Shell 命令、AMP API 和 Pterodactyl Panel API
- 灵活的触发器:代理生命周期、玩家连接、定时任务、空服检测、Ping/MOTD 请求
- 内置模板:预配置的常见自动化模式模板
示例用例
- 按需自动启动:当玩家尝试连接且服务器处于离线状态时启动服务器。
- 空闲时自动停止:在游戏服务器空闲一段时间后停止其运行。
- 计划任务:通过 cron 规则执行每晚重启、备份或维护操作。
- 更智能的服务器列表:在服务器在线/离线时调整 Ping/MOTD 行为。
- 优雅关闭:在代理关闭时,向玩家发送警告消息并停止选定的服务器。
- 定时奖励:使用 cron 触发器每小时向玩家发送奖励或消息。
要求
- Velocity 3.4.0 或更高版本
- Java 21 或更高版本
安装
-
从以下可用平台下载 AutoStartStop JAR 文件:
-
将 JAR 文件放入 Velocity 服务器的 plugins/ 文件夹中
-
重启 Velocity(如果尚未运行则启动它)
-
插件将在 plugins/autostartstop/config.yml 处创建默认配置文件
文档
完整文档位于:
AI 友好型文档
文档还提供符合 llms.txt 标准的 LLM 友好格式。你可以将这些文件与任何 AI 助手配合使用,以提问或生成配置:
统计信息
本插件使用 bStats 收集匿名使用统计数据。你可以通过编辑 plugins/bStats/config.txt 选择退出。
许可证
本项目基于 GNU通用公共许可证第三版(GPL-3.0) 授权。详情请参阅 LICENSE。
Introduction
AutoStartStop is a Velocity plugin for automated server management using a flexible, rule-based system.
You define rules that react to triggers (events like proxy start, player connect, cron schedules, etc.) and execute actions (start/stop servers, connect/disconnect players, log messages, and more), optionally gated by conditions.
How it works
AutoStartStop evaluates your configuration as:
- Settings: Global plugin settings (timeouts, intervals, etc.).
- Servers: Which backend servers are managed, and how to control them (Shell, AMP, or Pterodactyl API).
- Rules: What should happen under which circumstances.
- Triggers: When should a rule fire? (e.g.
connection, proxy_start, cron, empty_server)
- Conditions (optional): Should it run right now? (e.g. “server is offline”, “player count > 0”)
- Actions: What should happen? (e.g.
start, stop, send_message, disconnect)
Here’s the overall config.yml shape at a glance:
settings: { ... } # Global plugin settings (timeouts, intervals, etc.).
defaults: { ... } # Global defaults for server configurations.
servers: { ... } # Which backend servers are managed, and how to control them.
rules: { ... } # What should happen under which circumstances.
Key Features
- Rule-based automation: Define rules that react to triggers and execute actions
- Multiple control APIs: Support for Shell commands, AMP API, and Pterodactyl Panel API
- Flexible triggers: Proxy lifecycle, player connections, cron schedules, empty server detection, ping/MOTD requests
- Built-in templates: Pre-configured templates for common automation patterns
Example Use Cases
- Auto-start on demand: Start a server when a player tries to connect and it’s offline.
- Auto-stop when idle: Stop game servers after they’ve been empty for a duration.
- Scheduled tasks: Nightly restart, backups, or maintenance actions via cron rules.
- Smarter server list: Adjust ping/MOTD behavior while a server is online/offline.
- Graceful shutdown: On proxy shutdown, stop selected servers with warning messages to players.
- Scheduled rewards: Send hourly rewards or messages to players using cron triggers.
Requirements
- Velocity 3.4.0 or higher
- Java 21 or higher
Installation
-
Download the AutoStartStop JAR from one of the available platforms:
-
Place the JAR file in your Velocity server's plugins/ folder
-
Restart Velocity (or start it if not running)
-
The plugin will create a default configuration file at plugins/autostartstop/config.yml
Documentation
Full documentation is available at:
AI-friendly documentation
The documentation is also available in an LLM-friendly format following the llms.txt standard. Use these files with any AI assistant to ask questions or generate configurations:
- llms.txt — Structured index of all documentation pages
- llms-full.txt — Full documentation content in a single file
Statistics
This plugin uses bStats to collect anonymous usage statistics. You can opt out by editing plugins/bStats/config.txt.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for more information.
评论 0
登录后参与评分
还没有评论,来抢沙发吧