Shamrock: fix #114

This commit is contained in:
WhiteChi 2023-12-01 14:47:33 +08:00
parent 2fdcfe332b
commit b2ad4438ab

View File

@ -33,16 +33,21 @@ internal class InitRemoteService : IAction {
if (!PlatformUtils.isMqqPackage()) return if (!PlatformUtils.isMqqPackage()) return
if (ShamrockConfig.allowWebHook()) { if (ShamrockConfig.allowWebHook()) {
HttpService.initTransmitter() HttpService.initTransmitter()
} }
val runtime = AppRuntimeFetcher.appRuntime
if (!runtime.isLogin) {
LogCenter.log("未登录不启动任何WebSocket服务登录完成后请重新启动QQ。", Level.WARN)
return
}
if (ShamrockConfig.openWebSocket()) { if (ShamrockConfig.openWebSocket()) {
startWebSocketServer() startWebSocketServer()
} }
if (ShamrockConfig.openWebSocketClient()) { if (ShamrockConfig.openWebSocketClient()) {
val runtime = AppRuntimeFetcher.appRuntime
val curUin = runtime.currentAccountUin val curUin = runtime.currentAccountUin
val defaultToken = ShamrockConfig.getToken() val defaultToken = ShamrockConfig.getToken()
ShamrockConfig.getWebSocketClientAddress().forEach { conn -> ShamrockConfig.getWebSocketClientAddress().forEach { conn ->