Package com.github.theword.queqiao.tool
Class GlobalContext
java.lang.Object
com.github.theword.queqiao.tool.GlobalContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexecuteReloadCommand(Object commandReturner, boolean isModServer) 执行全局重载命令static Configstatic com.google.gson.GsongetGson()static HandleApiServicestatic org.slf4j.Loggerstatic com.google.gson.JsonObject获取消息前缀 JsonObjectstatic Stringstatic Stringstatic WebsocketManagerstatic voidinit(boolean isModServer, String serverVersion, String serverType, HandleApiService handleApiImpl, HandleCommandReturnMessageService handleCommandReturnMessageImpl) static com.google.gson.JsonObjectinitMessagePrefixJsonObject(String messagePrefixText) 初始化消息前缀 JsonObjectstatic void同时向所有已连接的 WebSocket 客户端和服务端广播事件static StringsendRconCommand(String command) 发送 Rcon 命令static voidstatic voidsetLogger(org.slf4j.Logger logger) static voidshutdown()关闭鹊桥
-
Constructor Details
-
GlobalContext
public GlobalContext()
-
-
Method Details
-
init
public static void init(boolean isModServer, String serverVersion, String serverType, HandleApiService handleApiImpl, HandleCommandReturnMessageService handleCommandReturnMessageImpl) -
executeReloadCommand
执行全局重载命令1. 先重新读取配置文件
2. 再重新连接所有 Websocket Client
3. 重连 Rcon
- Parameters:
commandReturner- 命令返回者isModServer- 是否为模组服
-
shutdown
public static void shutdown()关闭鹊桥 -
sendEvent
同时向所有已连接的 WebSocket 客户端和服务端广播事件- Parameters:
baseEvent- 事件对象
-
sendRconCommand
发送 Rcon 命令- Parameters:
command- 命令- Returns:
- 命令返回结果
- Throws:
IOException
-
initMessagePrefixJsonObject
初始化消息前缀 JsonObject- Returns:
- JsonObject 消息前缀
- Since:
- 0.4.2
-
getConfig
-
setConfig
-
getLogger
public static org.slf4j.Logger getLogger() -
setLogger
public static void setLogger(org.slf4j.Logger logger) -
getWebsocketManager
-
getHandleApiService
-
getHandleCommandReturnMessageService
-
getServerVersion
-
getServerType
-
getGson
public static com.google.gson.Gson getGson() -
getMessagePrefixJsonObject
public static com.google.gson.JsonObject getMessagePrefixJsonObject()获取消息前缀 JsonObject- Returns:
- JsonObject 消息前缀
- Since:
- 0.4.2
-