mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 07:30:14 +08:00
PushNotify
This commit is contained in:
parent
c12e3ae15a
commit
154c91e73b
@ -6,17 +6,24 @@ import net.mamoe.mirai.qqandroid.QQAndroidBot
|
||||
import net.mamoe.mirai.qqandroid.network.io.JceInput
|
||||
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.packet.EMPTY_BYTE_ARRAY
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
|
||||
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
|
||||
|
||||
internal object PushNotify : PacketFactory<PushNotify.MessageNotification>("MessageSvc.PushNotify") {
|
||||
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): MessageNotification {
|
||||
return MessageNotification.newInstanceFrom(JceInput(this.apply { discardExact(4) }.readIoBuffer()))
|
||||
val pk = RequestPacket.newInstanceFrom(JceInput(this.apply { discardExact(4) }.readIoBuffer()))
|
||||
println(pk.sFuncName)
|
||||
println(pk.sServantName)
|
||||
println(pk.sBuffer.toUHexString())
|
||||
return MessageNotification.newInstanceFrom(JceInput(pk.sBuffer.toReadPacket(4)))
|
||||
}
|
||||
|
||||
|
||||
class MessageNotification(
|
||||
val luni: Long,
|
||||
val ctype: Byte,
|
||||
|
Loading…
Reference in New Issue
Block a user