Class GetStatusApi
java.lang.Object
io.github.theword.queqiao.core.api.Api<EmptyPayload,Map<String,Object>>
io.github.theword.queqiao.core.api.GetStatusApi
查询服务器状态
协议名:get_status。无负载。
该 Api 与平台无关——它只读取 Runtime 实例级的状态采集器,
因此不继承 PlatformApi,也不要求平台上下文。
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGetStatusApi(org.slf4j.Logger logger, ServerStatusCollector serverStatusCollector) -
Method Summary
Methods inherited from class io.github.theword.queqiao.core.api.Api
aliases, execute, mapPlatformResult, requireSuccess
-
Constructor Details
-
GetStatusApi
-
-
Method Details
-
name
Description copied from class:Api协议api字段的主名字,例如"broadcast" -
doExecute
返回服务器状态快照Runtime 启动后由后台任务按配置间隔采集完整快照,正常情况下本 Api 只读取最近一次 已发布的快照,不在连接处理线程中发起 Ping。
但"不发起 Ping"并非绝对:当首轮采集尚未完成时,会等待共享的首轮结果 (等待上限见
ServerStatusCollector的INITIAL_SNAPSHOT_WAIT_MILLIS), 而该首轮采集本身包含一次 Minecraft Server List Ping(socket 超时 3 秒)。 因此最坏情况下连接读线程会被阻塞至等待上限,而不是"永不执行 Ping"。日志级别为 debug:该接口可能被高频轮询,INFO 级别会造成日志刷屏。
-