Class InfoCommand<NCS>

java.lang.Object
io.github.theword.queqiao.core.command.CommandNode<NCS>
io.github.theword.queqiao.core.command.builtin.InfoCommand<NCS>

public class InfoCommand<NCS> extends CommandNode<NCS>
  • Constructor Details

    • InfoCommand

      public InfoCommand(org.slf4j.Logger logger, Config config, WebsocketManager websocketManager)
  • Method Details

    • getName

      public String getName()
      获取命令名称
      Specified by:
      getName in class CommandNode<NCS>
      Returns:
      info
    • getDescription

      public String getDescription()
      获取命令描述
      Specified by:
      getDescription in class CommandNode<NCS>
      Returns:
      获取 Websocket Server 信息
    • onExecute

      protected void onExecute(CommandExecutionContext<NCS> context, List<String> args)
      获取 WebSocket 服务端状态 整合游戏内命令调用

      连接集合只读取一次:此前 getConnections() 被调用三次 (判空 / 取数量 / 遍历),三次之间集合可能变化, 会出现"显示 N 个连接、却列出 M 条"的自相矛盾输出。

      Specified by:
      onExecute in class CommandNode<NCS>
      Parameters:
      context - 命令执行上下文
      args - 命令参数