Class SendRconCommandHandler
java.lang.Object
io.github.theword.queqiao.core.protocol.AbstractProtocolHandler<CommandPayload,String>
io.github.theword.queqiao.core.protocol.handler.SendRconCommandHandler
-
Field Summary
Fields inherited from class io.github.theword.queqiao.core.protocol.AbstractProtocolHandler
handleApiService, logger -
Constructor Summary
ConstructorsConstructorDescriptionSendRconCommandHandler(org.slf4j.Logger logger, HandleApiService handleApiService, RconCommandExecutor rconCommandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringhandlePayload(CommandPayload payload) 执行 Rcon 命令Methods inherited from class io.github.theword.queqiao.core.protocol.AbstractProtocolHandler
handle
-
Constructor Details
-
SendRconCommandHandler
public SendRconCommandHandler(org.slf4j.Logger logger, HandleApiService handleApiService, RconCommandExecutor rconCommandExecutor)
-
-
Method Details
-
handlePayload
执行 Rcon 命令状态码语义(不同失败原因不再统一归为 400):
- 命令为空 → 400(调用方请求不合法)
- Rcon 未启用 / 未连接 → 503(服务暂不可用)
- 命令已下发但执行失败 → 500(服务端错误)
日志:不在 INFO 级别记录完整命令内容,因为命令可能包含密码、token 或玩家隐私; 完整内容仅在显式开启 debug 时输出。
- Specified by:
handlePayloadin classAbstractProtocolHandler<CommandPayload,String> - Parameters:
payload- 命令负载- Returns:
- Rcon 执行结果
- Throws:
ProtocolException- 见上方状态码语义
-