Commit 4ae589bb authored by jiahua.liu's avatar jiahua.liu

Troop List complete

parent 3cbd26e2
......@@ -138,23 +138,25 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
currentFriendCount++
})
}
bot.logger.verbose("正在加载好友信息 ${currentFriendCount}/${totalFriendCount}")
bot.logger.verbose("正在加载好友列表 ${currentFriendCount}/${totalFriendCount}")
if (currentFriendCount >= totalFriendCount) {
break
}
delay(200)
}
bot.logger.info("好友信息加载完成, 共 ${currentFriendCount}个")
bot.logger.info("好友列表加载完成, 共 ${currentFriendCount}个")
} catch (e: Exception) {
bot.logger.info("加载好友信息失败|一般这是由于加载过于频繁导致/将以热加载方式加载好友列表")
bot.logger.info("加载好友列表失败|一般这是由于加载过于频繁导致/将以热加载方式加载好友列表")
}
try {
bot.logger.info("开始加载组信息")
bot.logger.info("开始加载组列表")
val troopData = FriendList.GetTroopListSimplify(
bot.client
).sendAndExpect<FriendList.GetTroopListSimplify.Response>(10000)
println(troopData.contentToString())
println(troopData.groups.contentToString())
bot.logger.info("加载组列表成功")
} catch (e: Exception) {
bot.logger.info("加载组信息失败|一般这是由于加载过于频繁导致/将以热加载方式加载群列表")
}
......
......@@ -67,7 +67,6 @@ internal class FriendList {
internal object GetTroopListSimplify :
PacketFactory<GetTroopListSimplify.Response>("friendlist.GetTroopListReqV2") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): GetTroopListSimplify.Response {
this.discardExact(4)
val res = this.decodeUniPacket(GetTroopListRespV2.serializer())
return Response(res.vecTroopList.orEmpty())
}
......
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