Commit 68ba984f authored by Him188's avatar Him188

Simplify

parent 2b427173
...@@ -36,8 +36,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler ...@@ -36,8 +36,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
println("SessionTicketKey=${bot.client.wLoginSigInfo.wtSessionTicketKey.toUHexString()}") println("SessionTicketKey=${bot.client.wLoginSigInfo.wtSessionTicketKey.toUHexString()}")
} }
internal fun launchPacketProcessor(rawInput: ByteReadPacket): Job { internal fun launchPacketProcessor(rawInput: ByteReadPacket): Job = launch(CoroutineName("Incoming Packet handler")) {
return launch(CoroutineName("Incoming Packet handler")) {
rawInput.debugPrint("Received").use { input -> rawInput.debugPrint("Received").use { input ->
if (input.remaining == 0L) { if (input.remaining == 0L) {
bot.logger.error("Empty packet received. Consider if bad packet was sent.") bot.logger.error("Empty packet received. Consider if bad packet was sent.")
...@@ -55,7 +54,6 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler ...@@ -55,7 +54,6 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
} }
} }
} }
}
private suspend fun processReceive() { private suspend fun processReceive() {
while (channel.isOpen) { while (channel.isOpen) {
......
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