Class GlobalContext

java.lang.Object
com.github.theword.queqiao.tool.GlobalContext

public class GlobalContext extends Object
  • Constructor Details

    • GlobalContext

      public GlobalContext()
  • Method Details

    • init

      public static void init(boolean isModServer, String serverVersion, String serverType, HandleApiService handleApiImpl, HandleCommandReturnMessageService handleCommandReturnMessageImpl)
    • executeReloadCommand

      public static void executeReloadCommand(Object commandReturner, boolean isModServer)
      执行全局重载命令

      1. 先重新读取配置文件

      2. 再重新连接所有 Websocket Client

      3. 重连 Rcon

      Parameters:
      commandReturner - 命令返回者
      isModServer - 是否为模组服
    • shutdown

      public static void shutdown()
    • sendRconCommand

      public static String sendRconCommand(String command) throws IOException
      发送 Rcon 命令
      Parameters:
      command - 命令
      Returns:
      命令返回结果
      Throws:
      IOException
    • getConfig

      public static Config getConfig()
    • setConfig

      public static void setConfig(Config config)
    • getLogger

      public static org.slf4j.Logger getLogger()
    • setLogger

      public static void setLogger(org.slf4j.Logger logger)
    • getWebsocketManager

      public static WebsocketManager getWebsocketManager()
    • getHandleApiService

      public static HandleApiService getHandleApiService()
    • getHandleCommandReturnMessageService

      public static HandleCommandReturnMessageService getHandleCommandReturnMessageService()
    • getServerVersion

      public static String getServerVersion()
    • getServerType

      public static String getServerType()
    • getGson

      public static com.google.gson.Gson getGson()