mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-26 16:10:11 +08:00
PushNotify
This commit is contained in:
parent
e5261cd757
commit
016cc16b55
@ -3,24 +3,17 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
|
|||||||
import kotlinx.io.core.ByteReadPacket
|
import kotlinx.io.core.ByteReadPacket
|
||||||
import net.mamoe.mirai.data.Packet
|
import net.mamoe.mirai.data.Packet
|
||||||
import net.mamoe.mirai.qqandroid.QQAndroidBot
|
import net.mamoe.mirai.qqandroid.QQAndroidBot
|
||||||
import net.mamoe.mirai.qqandroid.network.io.JceInput
|
import net.mamoe.mirai.qqandroid.network.io.*
|
||||||
import net.mamoe.mirai.qqandroid.network.io.JceOutput
|
|
||||||
import net.mamoe.mirai.qqandroid.network.io.JceStruct
|
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.jce.RequestPacket
|
import net.mamoe.mirai.qqandroid.network.protocol.jce.RequestPacket
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
|
||||||
import net.mamoe.mirai.utils.io.discardExact
|
import net.mamoe.mirai.utils.io.discardExact
|
||||||
import net.mamoe.mirai.utils.io.readIoBuffer
|
|
||||||
import net.mamoe.mirai.utils.io.toReadPacket
|
|
||||||
import net.mamoe.mirai.utils.io.toUHexString
|
import net.mamoe.mirai.utils.io.toUHexString
|
||||||
|
|
||||||
internal object PushNotify : PacketFactory<PushNotify.MessageNotification>("MessageSvc.PushNotify") {
|
internal object PushNotify : PacketFactory<PushNotify.MessageNotification>("MessageSvc.PushNotify") {
|
||||||
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): MessageNotification {
|
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): MessageNotification {
|
||||||
val pk = RequestPacket.newInstanceFrom(JceInput(this.apply { discardExact(4) }.readIoBuffer()))
|
val request = RequestPacket.newInstanceFrom(this.apply { discardExact(4) }.asJceInput(CharsetUTF8))
|
||||||
println(pk.sFuncName)
|
return MessageNotification.newInstanceFrom(request.sBuffer.asJceInput(CharsetUTF8))
|
||||||
println(pk.sServantName)
|
|
||||||
println(pk.sBuffer.toUHexString())
|
|
||||||
return MessageNotification.newInstanceFrom(JceInput(pk.sBuffer.toReadPacket(4)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user