Commit ff6403cd authored by Him188's avatar Him188

Merge remote-tracking branch 'origin/master'

parents 5292b224 f7cdbbde
...@@ -126,19 +126,11 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler { ...@@ -126,19 +126,11 @@ internal class TIMBotNetworkHandler(private val bot: Bot) : BotNetworkHandler {
if (ServerPacketReceivedEvent(bot, packet).broadcast().cancelled) { if (ServerPacketReceivedEvent(bot, packet).broadcast().cancelled) {
return return
} }
withContext(CoroutineExceptionHandler { _, e -> e.printStackTrace() }) { loginHandler.onPacketReceived(packet)
launch(this.coroutineContext) { packetHandlers.forEach {
loginHandler.onPacketReceived(packet) it.instance.onPacketReceived(packet)
} }
packetHandlers.forEach {
launch(this.coroutineContext) {
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