mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 22:30:47 +08:00
fix Jce Data Class generator when facing Map<T,\" \"K>
This commit is contained in:
parent
ed99f8f84c
commit
af4f6c4160
@ -14,14 +14,17 @@ import net.mamoe.mirai.event.broadcast
|
||||
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.data.jce.GetFriendListReq
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.PacketLogger
|
||||
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
|
||||
|
||||
@ -91,8 +94,20 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
||||
|
||||
println("d2key=${bot.client.wLoginSigInfo.d2Key.toUHexString()}")
|
||||
StatSvc.Register(bot.client).sendAndExpect<StatSvc.Register.Response>()
|
||||
|
||||
//start updating friend/group list
|
||||
bot.logger.info("Start updating friend/group list")
|
||||
val data = FriendList.GetFriendGroupList(
|
||||
bot.client,
|
||||
0,
|
||||
20,
|
||||
0,
|
||||
10
|
||||
).sendAndExpect<FriendList.GetFriendGroupList.Response>()
|
||||
println(data.contentToString())
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 单线程处理包的接收, 分割和连接.
|
||||
*/
|
||||
|
@ -26,3 +26,5 @@ internal class GetFriendListReq(
|
||||
@SerialId(17) val vec0xd6bReq: ByteArray? = null,
|
||||
@SerialId(18) val vecSnsTypelist: List<Long>? = null
|
||||
) : JceStruct
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -131,13 +131,13 @@ fun toJCEInfo(source:String):JCEInfo{
|
||||
info.className = var0
|
||||
}
|
||||
|
||||
(it.contains("public") && it.contains(";")) -> {
|
||||
val var1 = it.trim().split(" ")
|
||||
(it.contains("public") && it.contains(";") && (!it.contains("static"))) -> {
|
||||
val var1 = it.replace(", ",",").trim().split(" ")
|
||||
if(var1.size == 5){
|
||||
allProperties.put(var1[2],
|
||||
Property(
|
||||
var1[2],
|
||||
var1[1],
|
||||
var1[1].replace(",", ", "),
|
||||
var1[4].replace(";","")
|
||||
)
|
||||
)
|
||||
@ -146,7 +146,7 @@ fun toJCEInfo(source:String):JCEInfo{
|
||||
var1[2].replace(";",""),
|
||||
Property(
|
||||
var1[2].replace(";",""),
|
||||
var1[1]
|
||||
var1[1].replace(",", ", ")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user