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
9d9089dd
Commit
9d9089dd
authored
Feb 08, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Group Listener
parent
99d297d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
1 deletion
+76
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
...rai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
+0
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
...ndroid/network/protocol/packet/chat/receive/OnlinePush.kt
+76
-0
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/PushNotifyPack.kt
View file @
9d9089dd
...
@@ -25,7 +25,6 @@ internal data class RequestPushNotify(
...
@@ -25,7 +25,6 @@ internal data class RequestPushNotify(
@SerialId
(
13
)
val
svrip
:
Int
?
@SerialId
(
13
)
val
svrip
:
Int
?
)
:
JceStruct
,
Packet
)
:
JceStruct
,
Packet
@Suppress
(
"ArrayInDataClass"
)
@Serializable
@Serializable
internal
data class
MsgInfo
(
internal
data class
MsgInfo
(
@SerialId
(
0
)
val
lFromUin
:
Long
?
=
0L
,
@SerialId
(
0
)
val
lFromUin
:
Long
?
=
0L
,
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
View file @
9d9089dd
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.readBytes
import
kotlinx.io.core.readUInt
import
net.mamoe.mirai.contact.MemberPermission
import
net.mamoe.mirai.contact.MemberPermission
import
net.mamoe.mirai.data.NoPakcet
import
net.mamoe.mirai.data.NoPakcet
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.data.Packet
...
@@ -19,6 +21,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
...
@@ -19,6 +21,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.utils.cryptor.contentToString
import
net.mamoe.mirai.utils.cryptor.contentToString
import
net.mamoe.mirai.utils.io.discardExact
import
net.mamoe.mirai.utils.io.read
import
net.mamoe.mirai.utils.io.readString
import
net.mamoe.mirai.utils.io.toUHexString
internal
inline
class
GroupMessageOrNull
(
val
delegate
:
GroupMessage
?)
:
Packet
{
internal
inline
class
GroupMessageOrNull
(
val
delegate
:
GroupMessage
?)
:
Packet
{
override
fun
toString
():
String
{
override
fun
toString
():
String
{
...
@@ -76,14 +82,84 @@ internal class OnlinePush {
...
@@ -76,14 +82,84 @@ internal class OnlinePush {
}
}
}
}
//0C 01 B1 89 BE 09 5E 3D 72 A6 00 01 73 68 FC 06 00 00 00 3C
internal
object
ReqPush
:
IncomingPacketFactory
<
Packet
>(
"OnlinePush.ReqPush"
)
{
internal
object
ReqPush
:
IncomingPacketFactory
<
Packet
>(
"OnlinePush.ReqPush"
)
{
@ExperimentalUnsignedTypes
@UseExperimental
(
ExperimentalStdlibApi
::
class
)
@UseExperimental
(
ExperimentalStdlibApi
::
class
)
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
,
sequenceId
:
Int
):
Packet
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
,
sequenceId
:
Int
):
Packet
{
val
reqPushMsg
=
decodeUniPacket
(
OnlinePushPack
.
SvcReqPushMsg
.
serializer
(),
"req"
)
val
reqPushMsg
=
decodeUniPacket
(
OnlinePushPack
.
SvcReqPushMsg
.
serializer
(),
"req"
)
println
(
reqPushMsg
.
contentToString
())
println
(
reqPushMsg
.
contentToString
())
reqPushMsg
.
vMsgInfos
.
forEach
{
msgInfo
:
MsgInfo
->
reqPushMsg
.
vMsgInfos
.
forEach
{
msgInfo
:
MsgInfo
->
var
debug
=
""
msgInfo
.
vMsg
!!
.
read
{
if
(
msgInfo
.
shMsgType
.
toInt
()
==
732
)
{
val
groupCode
=
this
.
readUInt
().
toLong
()
debug
=
"群 $groupCode "
when
(
val
internalType
=
this
.
readShort
().
toInt
())
{
3073
->
{
val
operatorUin
=
this
.
readUInt
().
toLong
()
debug
+=
" 管理员 $operatorUin"
val
operationTime
=
this
.
readUInt
().
toLong
()
debug
+=
" 禁言 "
this
.
discardExact
(
2
)
val
target
=
this
.
readUInt
().
toLong
()
val
time
=
this
.
readUInt
().
toLong
()
if
(
target
==
0L
)
{
debug
+=
"全群"
}
else
{
debug
+=
target
}
if
(
time
==
0L
)
{
debug
+=
" 解除 "
}
else
{
debug
+=
" "
+
time
+
"s"
}
}
3585
->
{
val
operatorUin
=
this
.
readUInt
().
toLong
()
debug
+=
" 管理员 $operatorUin"
debug
+=
" 匿名聊天 "
if
(
this
.
readInt
()
==
0
)
{
debug
+=
" 开启 "
}
else
{
debug
+=
" 关闭 "
}
}
4096
->
{
val
dataBytes
=
this
.
readBytes
(
26
)
val
message
=
this
.
readString
(
this
.
readByte
().
toInt
())
if
(
dataBytes
[
0
].
toInt
()
!=
59
)
{
println
(
"更改群名为$message"
)
}
else
{
println
(
message
+
":"
+
dataBytes
.
toUHexString
())
debug
+=
message
when
(
message
)
{
"管理员已关闭群聊坦白说"
->
{
}
"管理员已开启群聊坦白说"
->
{
}
else
->
{
println
(
"Unknown server messages $message"
)
}
}
}
}
else
->
{
println
(
"unknown group internal type $internalType , data: "
+
this
.
readBytes
().
toUHexString
()
+
" "
)
}
}
}
else
{
println
(
"unknown shtype ${msgInfo.shMsgType.toInt()}"
)
}
}
println
(
debug
)
}
}
return
NoPakcet
return
NoPakcet
}
}
...
...
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