Class CommandExecutionManager

java.lang.Object
com.ultikits.ultitools.manager.CommandExecutionManager

@Internal public class CommandExecutionManager extends Object
命令执行管理器 负责处理来自WebSocket的命令执行请求
  • Field Details

  • Constructor Details

    • CommandExecutionManager

      public CommandExecutionManager()
  • Method Details

    • setBlockedCommands

      public void setBlockedCommands(Set<String> commands)
      设置命令黑名单 Set the blocklist of commands that should not be executed remotely
      Parameters:
      commands - Set of command names to block (case-insensitive)
    • isCommandAllowed

      public boolean isCommandAllowed(String command)
      检查命令是否允许远程执行 Check if a command is allowed for remote execution. Extracts the base command (first word) and checks against blocklist.
      Parameters:
      command - The command to check (with or without leading slash)
      Returns:
      true if command is allowed, false if blocked or invalid
    • setWebSocketClient

      public void setWebSocketClient(UltiPanelWebSocketClient client)
      设置WebSocket客户端
      Parameters:
      client - WebSocket客户端
    • executeCommand

      public void executeCommand(com.google.gson.JsonObject commandData)
      执行命令
    • executeCommandInternal

      private void executeCommandInternal(String command, String executor, String commandId, long startTime)
      内部命令执行逻辑
    • sendCommandResult

      private void sendCommandResult(String commandId, boolean success, String output, long executionTime)
      发送命令执行结果