LimboAutoServer
一个 Velocity 插件,能够在玩家连接时延迟启动后端服务器,并仅在玩家在线期间保持其运行——这一理念与 AutoServer 相同,但基于 LimboAPI 构建。
为什么需要它
AutoServer 会在后端服务器启动过程中拒绝初始连接,这会导致客户端卡在登录阶段。冷启动的 Fabric 服务器可能需要一段时间才能准备好,而客户端往往在服务器就绪之前就遇到了登录超时。
LimboAutoServer 通过将玩家放入 LimboAPI 虚拟世界(由代理直接提供服务的微型“等候室”)来解决此问题,与此同时后端正在启动。玩家完全连接——不会超时——可以看到状态消息,并在服务器恢复响应后无缝转移到真实服务器。
工作原理
- 在登录过程中,LimboAPI 触发
LoginLimboRegisterEvent。
- LimboAutoServer 解析玩家要前往的后端服务器(强制主机,否则为 Velocity
try 列表中的第一项)并向其发送 ping。
- 如果它在线,玩家正常连接。
- 如果它离线,玩家将被生成到 limbo 世界中,并执行后端的
start 命令。并发加入的玩家共享一次启动过程,并在服务器响应后同时释放。
- 当最后一名玩家离开后端服务器后,它在经过
autoShutdownDelay 时间后再次停止。
要求
- Velocity 3.4.x
- LimboAPI 安装在同一代理上(声明为插件依赖项,因此会优先加载)。
构建
./gradlew build
插件 jar 文件生成于 build/libs/limboautoserver-velocity-<version>.jar。
toml4j 和 Velocity/Adventure API 由 Velocity 在运行时提供,LimboAPI 类由 LimboAPI 插件提供,因此 jar 包体积很小(无需着色/shading)。
配置
首次运行时,config.toml 将写入 plugins/limboautoserver/。每个后端都是一个 [servers.<name>] 块,其名称与 velocity.toml 中的服务器名称匹配。请参阅内置的 config.toml 以获取完整选项集(启动/停止命令、工作目录、启动/关闭/空闲延迟)以及 [limbo] 部分(维度、游戏模式、出生点位置、世界时间)和 [messages]。
命令
/limboautoserver(别名 /las):
| 子命令 |
权限 |
描述 |
reload |
limboautoserver.command.reload |
重新加载配置并重建 limbo 世界 |
status [server] |
limboautoserver.command.status |
显示缓存的服务器状态 |
start <server> |
limboautoserver.command.start |
执行启动序列 |
stop <server> |
limboautoserver.command.stop |
执行停止序列 |
致谢
源自 Artificial-720 的 AutoServer(MIT 协议)。基于 Elytrium 的 LimboAPI(MIT 协议)。
采用 MIT 许可证——详见 LICENSE。
LimboAutoServer
A Velocity plugin that lazy-starts backend
servers when a player connects and keeps them running only while players are present —
the same idea as AutoServer, but built on
top of LimboAPI.
Why
AutoServer denies the initial connection while the backend boots, which leaves the client
stuck in the login phase. A cold Fabric server can take a while to start, and clients often
hit a login timeout before it is ready.
LimboAutoServer fixes this by dropping the player into a LimboAPI virtual world (a tiny
"waiting room" served directly by the proxy) while the backend starts. The player is fully
connected — no timeout — sees a status message, and is seamlessly transferred to the
real server as soon as it is responsive.
How it works
- During login, LimboAPI fires
LoginLimboRegisterEvent.
- LimboAutoServer resolves the backend the player is heading to (forced host, else the
first entry of Velocity's
try list) and pings it.
- If it's online, the player connects normally.
- If it's offline, the player is spawned into the limbo world and the backend's
start command is run. Concurrent joiners share a single startup and are released
together once the server responds.
- When the last player leaves a backend, it is stopped again after
autoShutdownDelay.
Requirements
- Velocity 3.4.x
- LimboAPI installed on the same proxy (declared as
a plugin dependency, so it loads first).
Build
./gradlew build
The plugin jar is produced at build/libs/limboautoserver-velocity-<version>.jar.
toml4j and the Velocity/Adventure APIs are provided by Velocity at runtime, and the
LimboAPI classes are provided by the LimboAPI plugin, so the jar stays small (no shading).
Configuration
On first run config.toml is written to plugins/limboautoserver/. Each backend is a
[servers.<name>] block whose name matches the server in velocity.toml. See the bundled
config.toml for the full set of options (start/stop
commands, working directory, startup/shutdown/idle delays) and the [limbo] section
(dimension, gamemode, spawn position, world time) and [messages].
Commands
/limboautoserver (alias /las):
| Subcommand |
Permission |
Description |
reload |
limboautoserver.command.reload |
Reload config and rebuild the limbo world |
status [server] |
limboautoserver.command.status |
Show cached server status |
start <server> |
limboautoserver.command.start |
Run the start sequence |
stop <server> |
limboautoserver.command.stop |
Run the stop sequence |
Credits
Derived from AutoServer by Artificial-720
(MIT). Built on LimboAPI by Elytrium (MIT).
Licensed under the MIT License — see LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧