diff --git a/src/main/kotlin/com/github/creeper123123321/viaaas/handler/MinecraftHandler.kt b/src/main/kotlin/com/github/creeper123123321/viaaas/handler/MinecraftHandler.kt index af43fe0..9f5a17e 100644 --- a/src/main/kotlin/com/github/creeper123123321/viaaas/handler/MinecraftHandler.kt +++ b/src/main/kotlin/com/github/creeper123123321/viaaas/handler/MinecraftHandler.kt @@ -15,6 +15,7 @@ class MinecraftHandler( ) : SimpleChannelInboundHandler() { lateinit var remoteAddress: SocketAddress val other: Channel? get() = if (frontEnd) data.backChannel else data.frontChannel + var msgDisconnected = false override fun channelRead0(ctx: ChannelHandlerContext, packet: Packet) { if (ctx.channel().isActive) { diff --git a/src/main/kotlin/com/github/creeper123123321/viaaas/handler/state/MinecraftConnectionState.kt b/src/main/kotlin/com/github/creeper123123321/viaaas/handler/state/MinecraftConnectionState.kt index 96a25e3..7575fc7 100644 --- a/src/main/kotlin/com/github/creeper123123321/viaaas/handler/state/MinecraftConnectionState.kt +++ b/src/main/kotlin/com/github/creeper123123321/viaaas/handler/state/MinecraftConnectionState.kt @@ -14,7 +14,10 @@ interface MinecraftConnectionState { ) fun disconnect(handler: MinecraftHandler, msg: String) { - mcLogger.info("DC ${handler.remoteAddress}: $msg") + if (!handler.msgDisconnected) { + handler.msgDisconnected = true + mcLogger.info("DC ${handler.remoteAddress}: $msg") + } } fun onInactivated(handler: MinecraftHandler) {