Commit f7cdbbde authored by Him188's avatar Him188 Committed by GitHub

Blocking pass packets to handlers

parent a64123bd
...@@ -125,19 +125,11 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler { ...@@ -125,19 +125,11 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler {
return return
} }
withContext(CoroutineExceptionHandler { _, e -> e.printStackTrace() }) {
launch(this.coroutineContext) {
loginHandler.onPacketReceived(packet) loginHandler.onPacketReceived(packet)
}
packetHandlers.forEach { packetHandlers.forEach {
launch(this.coroutineContext) {
it.instance.onPacketReceived(packet) it.instance.onPacketReceived(packet)
} }
} }
}//awaits all coroutines launched in this block
}
private var socket: DatagramSocket? = null private var socket: DatagramSocket? = null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment