Commit a849119f authored by jiahua.liu's avatar jiahua.liu

Friend List Complete

parent 579e3496
......@@ -103,6 +103,7 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
}
override suspend fun init() {
delay(5000)
bot.logger.info("开始加载好友信息")
this@QQAndroidBotNetworkHandler.subscribeAlways<ForceOfflineEvent> {
......
package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.atomicfu.AtomicInt
import kotlinx.atomicfu.atomic
import kotlinx.serialization.SerialId
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.JceStruct
......@@ -12,14 +14,20 @@ internal class RequestPacket(
@SerialId(1) val iVersion: Short = 3,
@SerialId(2) val cPacketType: Byte = 0,
@SerialId(3) val iMessageType: Int = 0,
@SerialId(4) val iRequestId: Int = 0,
@SerialId(4) val iRequestId: Int = nextRequestPacketRequestId(),
@SerialId(5) val sServantName: String = "",
@SerialId(6) val sFuncName: String = "",
@SerialId(7) val sBuffer: ByteArray = EMPTY_BYTE_ARRAY,
@SerialId(8) val iTimeout: Int = 0,
@SerialId(9) val context: Map<String, String> = EMPTY_MAP,
@SerialId(10) val status: Map<String, String> = EMPTY_MAP
) : JceStruct
) : JceStruct {
}
private val requestPacketRequestId: AtomicInt = atomic(10000000)
internal fun nextRequestPacketRequestId(): Int = requestPacketRequestId.getAndAdd(1)
@Serializable
internal class RequestDataVersion3(
......
......@@ -118,16 +118,15 @@ internal class FriendList {
iVersion = 3,
cPacketType = 0x003,
iMessageType = 0x00000,
iRequestId = 1921334514,
sBuffer = jceRequestSBuffer(
"FL",
GetFriendListReq.serializer(),
GetFriendListReq(
reqtype = 3,
ifReflush = if (friendListStartIndex <= 0) {
0
} else {
ifReflush = if (friendListStartIndex == 0) {
1
} else {
0
},
uin = client.uin,
startIndex = friendListStartIndex.toShort(),
......
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