Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
dccd4dae
Commit
dccd4dae
authored
Jan 27, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PushNotify
parent
43a9ef42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
1 deletion
+91
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
.../mirai/qqandroid/network/protocol/packet/PacketFactory.kt
+3
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
...ork/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
+88
-0
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
View file @
dccd4dae
...
...
@@ -7,6 +7,7 @@ import net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.io.JceInput
import
net.mamoe.mirai.qqandroid.network.protocol.jce.RequestPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.OnlinePush
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.PushNotify
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.StatSvc
import
net.mamoe.mirai.utils.DefaultLogger
...
...
@@ -51,7 +52,8 @@ internal val PacketLogger: MiraiLogger = DefaultLogger("Packet")
internal
object
KnownPacketFactories
:
List
<
PacketFactory
<
*
>>
by
mutableListOf
(
LoginPacket
,
StatSvc
.
Register
,
OnlinePush
.
PbPushGroupMsg
OnlinePush
.
PbPushGroupMsg
,
PushNotify
)
{
fun
findPacketFactory
(
commandName
:
String
):
PacketFactory
<
*
>?
=
this
.
firstOrNull
{
it
.
commandName
==
commandName
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PushNotify.kt
0 → 100644
View file @
dccd4dae
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
import
kotlinx.io.core.ByteReadPacket
import
net.mamoe.mirai.data.Packet
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.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.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
()))
}
class
MessageNotification
(
val
luni
:
Long
,
val
ctype
:
Byte
,
val
strService
:
String
,
val
strCmd
:
String
,
val
vNotifyCookie
:
ByteArray
,
val
usMsgType
:
Int
,
val
wUserActive
:
Int
,
val
wGeneralFlag
:
Int
,
val
lBindedUni
:
Long
)
:
Packet
,
JceStruct
()
{
init
{
println
(
this
.
luni
)
println
(
this
.
ctype
)
println
(
this
.
strService
)
println
(
this
.
strCmd
)
println
(
this
.
vNotifyCookie
.
toUHexString
())
println
(
this
.
usMsgType
)
println
(
this
.
wUserActive
)
println
(
this
.
wGeneralFlag
)
println
(
this
.
lBindedUni
)
}
override
fun
writeTo
(
builder
:
JceOutput
)
{
//not needed
}
companion
object
:
Factory
<
MessageNotification
>
{
override
fun
newInstanceFrom
(
input
:
JceInput
):
MessageNotification
{
return
MessageNotification
(
input
.
read
(
0L
,
0
),
input
.
read
(
0
.
toByte
(),
1
),
input
.
readString
(
2
),
input
.
readString
(
3
),
input
.
read
(
EMPTY_BYTE_ARRAY
,
4
),
input
.
read
(
0
,
5
),
input
.
read
(
0
,
6
),
input
.
read
(
0
,
7
),
input
.
read
(
0L
,
8
)
)
}
}
}
class
MsgInfo
(
val
lFromUin
:
Long
,
val
uMsgTime
:
Long
,
val
shMsgType
:
Short
,
val
shMsgSeq
:
Short
,
val
strMsg
:
String
,
val
uRealMsgTime
:
Int
,
val
vMsg
:
ByteArray
,
val
uAppShareID
:
Long
,
val
vMsgCookies
:
ByteArray
,
val
vAppShareCookie
:
ByteArray
,
val
lMsgUid
:
Long
,
val
lLastChangeTime
:
Long
,
//val vCPicInfo: List<CPicInfo?>,
//val stShareData: shareData,
val
lFromInstId
:
Long
,
val
vRemarkOfSender
:
ByteArray
,
val
strFromMobile
:
String
,
val
strFromName
:
String
,
val
vNickName
:
List
<
String
>
//val stC2CTmpMsgHead: TempMsgHead
)
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment