From a8551fd3499fde1358ced83f5436896cae217e20 Mon Sep 17 00:00:00 2001 From: "jiahua.liu" Date: Thu, 30 Jan 2020 20:49:20 +0800 Subject: [PATCH] friendlist resp --- .../mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt | 6 ++++-- .../network/protocol/packet/list/FriendListPacket.kt | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt index 0db9bec14..06b9c143f 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt @@ -15,10 +15,12 @@ import net.mamoe.mirai.network.BotNetworkHandler import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.event.PacketReceivedEvent import net.mamoe.mirai.qqandroid.network.protocol.packet.* +import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList import net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket.LoginPacketResponse.* import net.mamoe.mirai.qqandroid.network.protocol.packet.login.StatSvc import net.mamoe.mirai.utils.* +import net.mamoe.mirai.utils.cryptor.contentToString import net.mamoe.mirai.utils.io.* import kotlin.coroutines.CoroutineContext @@ -96,9 +98,9 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler val data = FriendList.GetFriendGroupList( bot.client, 0, - 20, + 10, 0, - 10 + 0 ).sendAndExpect() println(data.contentToString()) } diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt index 01b5b062f..1f143331b 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt @@ -32,7 +32,9 @@ internal class FriendList { override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response { println(this - .apply { discardExact(4) } + .apply { + this.discardExact(4) + } .decodeUniPacket(GetFriendListResp.serializer()) .contentToString() )