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
224b8058
Commit
224b8058
authored
Feb 06, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `st` to `St`
parent
22096a9f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
31 deletions
+33
-31
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
...oe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
+17
-17
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
.../mirai/qqandroid/network/protocol/packet/PacketFactory.kt
+3
-5
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.kt
...ndroid/network/protocol/packet/chat/receive/MessageSvc.kt
+10
-6
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt
...qandroid/network/protocol/packet/list/FriendListPacket.kt
+2
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/Packet.kt
...core/src/commonMain/kotlin/net.mamoe.mirai/data/Packet.kt
+1
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
View file @
224b8058
...
@@ -9,7 +9,7 @@ internal class GetTroopListReqV2Simplify(
...
@@ -9,7 +9,7 @@ internal class GetTroopListReqV2Simplify(
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
1
)
val
getMSFMsgFlag
:
Byte
?
=
null
,
@SerialId
(
1
)
val
getMSFMsgFlag
:
Byte
?
=
null
,
@SerialId
(
2
)
val
vecCookies
:
ByteArray
?
=
null
,
@SerialId
(
2
)
val
vecCookies
:
ByteArray
?
=
null
,
@SerialId
(
3
)
val
vecGroupInfo
:
List
<
s
t
TroopNumSimplify
>?
=
null
,
@SerialId
(
3
)
val
vecGroupInfo
:
List
<
S
tTroopNumSimplify
>?
=
null
,
@SerialId
(
4
)
val
groupFlagExt
:
Byte
?
=
null
,
@SerialId
(
4
)
val
groupFlagExt
:
Byte
?
=
null
,
@SerialId
(
5
)
val
shVersion
:
Int
?
=
null
,
@SerialId
(
5
)
val
shVersion
:
Int
?
=
null
,
@SerialId
(
6
)
val
dwCompanyId
:
Long
?
=
null
,
@SerialId
(
6
)
val
dwCompanyId
:
Long
?
=
null
,
...
@@ -18,7 +18,7 @@ internal class GetTroopListReqV2Simplify(
...
@@ -18,7 +18,7 @@ internal class GetTroopListReqV2Simplify(
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
TroopNumSimplify
(
internal
class
S
tTroopNumSimplify
(
@SerialId
(
0
)
val
groupCode
:
Long
,
@SerialId
(
0
)
val
groupCode
:
Long
,
@SerialId
(
1
)
val
dwGroupInfoSeq
:
Long
?
=
null
,
@SerialId
(
1
)
val
dwGroupInfoSeq
:
Long
?
=
null
,
@SerialId
(
2
)
val
dwGroupFlagExt
:
Long
?
=
null
,
@SerialId
(
2
)
val
dwGroupFlagExt
:
Long
?
=
null
,
...
@@ -29,20 +29,20 @@ internal class stTroopNumSimplify(
...
@@ -29,20 +29,20 @@ internal class stTroopNumSimplify(
@Serializable
@Serializable
internal
class
GetTroopListRespV2
(
internal
class
GetTroopListRespV2
(
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
1
)
val
troop
c
ount
:
Short
,
@SerialId
(
1
)
val
troop
C
ount
:
Short
,
@SerialId
(
2
)
val
result
:
Int
,
@SerialId
(
2
)
val
result
:
Int
,
@SerialId
(
3
)
val
errorCode
:
Short
?
=
null
,
@SerialId
(
3
)
val
errorCode
:
Short
?
=
null
,
@SerialId
(
4
)
val
vecCookies
:
ByteArray
?
=
null
,
@SerialId
(
4
)
val
vecCookies
:
ByteArray
?
=
null
,
@SerialId
(
5
)
val
vecTroopList
:
List
<
s
t
TroopNum
>?
=
null
,
@SerialId
(
5
)
val
vecTroopList
:
List
<
S
tTroopNum
>?
=
null
,
@SerialId
(
6
)
val
vecTroopListDel
:
List
<
s
t
TroopNum
>?
=
null
,
@SerialId
(
6
)
val
vecTroopListDel
:
List
<
S
tTroopNum
>?
=
null
,
@SerialId
(
7
)
val
vecTroopRank
:
List
<
s
t
GroupRankInfo
>?
=
null
,
@SerialId
(
7
)
val
vecTroopRank
:
List
<
S
tGroupRankInfo
>?
=
null
,
@SerialId
(
8
)
val
vecFavGroup
:
List
<
s
t
FavoriteGroup
>?
=
null
,
@SerialId
(
8
)
val
vecFavGroup
:
List
<
S
tFavoriteGroup
>?
=
null
,
@SerialId
(
9
)
val
vecTroopListExt
:
List
<
s
t
TroopNum
>?
=
null
@SerialId
(
9
)
val
vecTroopListExt
:
List
<
S
tTroopNum
>?
=
null
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
TroopNum
(
internal
class
S
tTroopNum
(
@SerialId
(
0
)
val
groupUin
:
Long
,
@SerialId
(
0
)
val
groupUin
:
Long
,
@SerialId
(
1
)
val
groupCode
:
Long
,
@SerialId
(
1
)
val
groupCode
:
Long
,
@SerialId
(
2
)
val
flag
:
Byte
?
=
null
,
@SerialId
(
2
)
val
flag
:
Byte
?
=
null
,
...
@@ -52,8 +52,8 @@ internal class stTroopNum(
...
@@ -52,8 +52,8 @@ internal class stTroopNum(
@SerialId
(
6
)
val
dwGroupFlagExt
:
Long
?
=
null
,
@SerialId
(
6
)
val
dwGroupFlagExt
:
Long
?
=
null
,
@SerialId
(
7
)
val
dwGroupRankSeq
:
Long
?
=
null
,
@SerialId
(
7
)
val
dwGroupRankSeq
:
Long
?
=
null
,
@SerialId
(
8
)
val
dwCertificationType
:
Long
?
=
null
,
@SerialId
(
8
)
val
dwCertificationType
:
Long
?
=
null
,
@SerialId
(
9
)
val
dwShut
u
pTimestamp
:
Long
?
=
null
,
@SerialId
(
9
)
val
dwShut
U
pTimestamp
:
Long
?
=
null
,
@SerialId
(
10
)
val
dwMyShut
u
pTimestamp
:
Long
?
=
null
,
@SerialId
(
10
)
val
dwMyShut
U
pTimestamp
:
Long
?
=
null
,
@SerialId
(
11
)
val
dwCmdUinUinFlag
:
Long
?
=
null
,
@SerialId
(
11
)
val
dwCmdUinUinFlag
:
Long
?
=
null
,
@SerialId
(
12
)
val
dwAdditionalFlag
:
Long
?
=
null
,
@SerialId
(
12
)
val
dwAdditionalFlag
:
Long
?
=
null
,
@SerialId
(
13
)
val
dwGroupTypeFlag
:
Long
?
=
null
,
@SerialId
(
13
)
val
dwGroupTypeFlag
:
Long
?
=
null
,
...
@@ -81,11 +81,11 @@ internal class stTroopNum(
...
@@ -81,11 +81,11 @@ internal class stTroopNum(
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
GroupRankInfo
(
internal
class
S
tGroupRankInfo
(
@SerialId
(
0
)
val
dwGroupCode
:
Long
,
@SerialId
(
0
)
val
dwGroupCode
:
Long
,
@SerialId
(
1
)
val
groupRankSysFlag
:
Byte
?
=
null
,
@SerialId
(
1
)
val
groupRankSysFlag
:
Byte
?
=
null
,
@SerialId
(
2
)
val
groupRankUserFlag
:
Byte
?
=
null
,
@SerialId
(
2
)
val
groupRankUserFlag
:
Byte
?
=
null
,
@SerialId
(
3
)
val
vecRankMap
:
List
<
s
t
LevelRankPair
>?
=
null
,
@SerialId
(
3
)
val
vecRankMap
:
List
<
S
tLevelRankPair
>?
=
null
,
@SerialId
(
4
)
val
dwGroupRankSeq
:
Long
?
=
null
,
@SerialId
(
4
)
val
dwGroupRankSeq
:
Long
?
=
null
,
@SerialId
(
5
)
val
ownerName
:
String
?
=
""
,
@SerialId
(
5
)
val
ownerName
:
String
?
=
""
,
@SerialId
(
6
)
val
adminName
:
String
?
=
""
,
@SerialId
(
6
)
val
adminName
:
String
?
=
""
,
...
@@ -93,7 +93,7 @@ internal class stGroupRankInfo(
...
@@ -93,7 +93,7 @@ internal class stGroupRankInfo(
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
FavoriteGroup
(
internal
class
S
tFavoriteGroup
(
@SerialId
(
0
)
val
dwGroupCode
:
Long
,
@SerialId
(
0
)
val
dwGroupCode
:
Long
,
@SerialId
(
1
)
val
dwTimestamp
:
Long
?
=
null
,
@SerialId
(
1
)
val
dwTimestamp
:
Long
?
=
null
,
@SerialId
(
2
)
val
dwSnsFlag
:
Long
?
=
1L
,
@SerialId
(
2
)
val
dwSnsFlag
:
Long
?
=
1L
,
...
@@ -101,7 +101,7 @@ internal class stFavoriteGroup(
...
@@ -101,7 +101,7 @@ internal class stFavoriteGroup(
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
LevelRankPair
(
internal
class
S
tLevelRankPair
(
@SerialId
(
0
)
val
dwLevel
:
Long
?
=
null
,
@SerialId
(
0
)
val
dwLevel
:
Long
?
=
null
,
@SerialId
(
1
)
val
rank
:
String
?
=
""
@SerialId
(
1
)
val
rank
:
String
?
=
""
)
:
JceStruct
)
:
JceStruct
...
@@ -124,7 +124,7 @@ internal class GetTroopMemberListResp(
...
@@ -124,7 +124,7 @@ internal class GetTroopMemberListResp(
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
1
)
val
groupCode
:
Long
,
@SerialId
(
1
)
val
groupCode
:
Long
,
@SerialId
(
2
)
val
groupUin
:
Long
,
@SerialId
(
2
)
val
groupUin
:
Long
,
@SerialId
(
3
)
val
vecTroopMember
:
List
<
s
t
TroopMemberInfo
>,
@SerialId
(
3
)
val
vecTroopMember
:
List
<
S
tTroopMemberInfo
>,
@SerialId
(
4
)
val
nextUin
:
Long
,
@SerialId
(
4
)
val
nextUin
:
Long
,
@SerialId
(
5
)
val
result
:
Int
,
@SerialId
(
5
)
val
result
:
Int
,
@SerialId
(
6
)
val
errorCode
:
Short
?
=
null
,
@SerialId
(
6
)
val
errorCode
:
Short
?
=
null
,
...
@@ -133,7 +133,7 @@ internal class GetTroopMemberListResp(
...
@@ -133,7 +133,7 @@ internal class GetTroopMemberListResp(
)
:
JceStruct
)
:
JceStruct
@Serializable
@Serializable
internal
class
s
t
TroopMemberInfo
(
internal
class
S
tTroopMemberInfo
(
@SerialId
(
0
)
val
memberUin
:
Long
,
@SerialId
(
0
)
val
memberUin
:
Long
,
@SerialId
(
1
)
val
faceId
:
Short
,
@SerialId
(
1
)
val
faceId
:
Short
,
@SerialId
(
2
)
val
age
:
Byte
,
@SerialId
(
2
)
val
age
:
Byte
,
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
View file @
224b8058
...
@@ -15,13 +15,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
...
@@ -15,13 +15,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.ConfigPushSvc
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.ConfigPushSvc
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.StatSvc
import
net.mamoe.mirai.qqandroid.network.protocol.packet.login.StatSvc
import
net.mamoe.mirai.utils.DefaultLogger
import
net.mamoe.mirai.utils.*
import
net.mamoe.mirai.utils.MiraiLoggerWithSwitch
import
net.mamoe.mirai.utils.cryptor.adjustToPublicKey
import
net.mamoe.mirai.utils.cryptor.adjustToPublicKey
import
net.mamoe.mirai.utils.cryptor.decryptBy
import
net.mamoe.mirai.utils.cryptor.decryptBy
import
net.mamoe.mirai.utils.io.*
import
net.mamoe.mirai.utils.io.*
import
net.mamoe.mirai.utils.unzip
import
net.mamoe.mirai.utils.withSwitch
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.ExperimentalContracts
import
kotlin.contracts.contract
import
kotlin.contracts.contract
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
...
@@ -155,6 +152,7 @@ internal object KnownPacketFactories {
...
@@ -155,6 +152,7 @@ internal object KnownPacketFactories {
* full packet without length
* full packet without length
*/
*/
// do not inline. Exceptions thrown will not be reported correctly
// do not inline. Exceptions thrown will not be reported correctly
@UseExperimental
(
MiraiInternalAPI
::
class
)
@Suppress
(
"UNCHECKED_CAST"
)
@Suppress
(
"UNCHECKED_CAST"
)
suspend
fun
<
T
:
Packet
>
parseIncomingPacket
(
bot
:
QQAndroidBot
,
rawInput
:
Input
,
consumer
:
PacketConsumer
<
T
>)
=
with
(
rawInput
)
{
suspend
fun
<
T
:
Packet
>
parseIncomingPacket
(
bot
:
QQAndroidBot
,
rawInput
:
Input
,
consumer
:
PacketConsumer
<
T
>)
=
with
(
rawInput
)
{
// login
// login
...
@@ -250,7 +248,7 @@ internal object KnownPacketFactories {
...
@@ -250,7 +248,7 @@ internal object KnownPacketFactories {
/**
/**
* 解析 SSO 层包装
* 解析 SSO 层包装
*/
*/
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
,
MiraiInternalAPI
::
class
)
private
fun
parseSsoFrame
(
bot
:
QQAndroidBot
,
input
:
ByteReadPacket
):
IncomingPacket
{
private
fun
parseSsoFrame
(
bot
:
QQAndroidBot
,
input
:
ByteReadPacket
):
IncomingPacket
{
val
commandName
:
String
val
commandName
:
String
val
ssoSequenceId
:
Int
val
ssoSequenceId
:
Int
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.kt
View file @
224b8058
...
@@ -27,7 +27,6 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
...
@@ -27,7 +27,6 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.qqandroid.utils.toMessageChain
import
net.mamoe.mirai.qqandroid.utils.toRichTextElems
import
net.mamoe.mirai.qqandroid.utils.toRichTextElems
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.cryptor.contentToString
import
net.mamoe.mirai.utils.currentTimeSeconds
import
net.mamoe.mirai.utils.currentTimeSeconds
import
kotlin.math.absoluteValue
import
kotlin.math.absoluteValue
import
kotlin.random.Random
import
kotlin.random.Random
...
@@ -86,13 +85,13 @@ internal class MessageSvc {
...
@@ -86,13 +85,13 @@ internal class MessageSvc {
}
}
@UseExperimental
(
MiraiInternalAPI
::
class
)
@UseExperimental
(
MiraiInternalAPI
::
class
)
internal
class
GetMsgSuccess
(
delegate
:
Mutable
List
<
FriendMessage
>)
:
Response
(
MsgSvc
.
SyncFlag
.
STOP
,
delegate
)
internal
class
GetMsgSuccess
(
delegate
:
List
<
FriendMessage
>)
:
Response
(
MsgSvc
.
SyncFlag
.
STOP
,
delegate
)
/**
/**
* 不要直接 expect 这个 class. 它可能
* 不要直接 expect 这个 class. 它可能
*/
*/
@MiraiInternalAPI
@MiraiInternalAPI
open
class
Response
(
internal
val
syncFlagFromServer
:
MsgSvc
.
SyncFlag
,
delegate
:
Mutable
List
<
FriendMessage
>)
:
MultiPacket
<
FriendMessage
>(
delegate
),
open
class
Response
(
internal
val
syncFlagFromServer
:
MsgSvc
.
SyncFlag
,
delegate
:
List
<
FriendMessage
>)
:
MultiPacket
<
FriendMessage
>(
delegate
),
BroadcastControllable
{
BroadcastControllable
{
override
val
shouldBroadcast
:
Boolean
override
val
shouldBroadcast
:
Boolean
get
()
=
syncFlagFromServer
==
MsgSvc
.
SyncFlag
.
STOP
get
()
=
syncFlagFromServer
==
MsgSvc
.
SyncFlag
.
STOP
...
@@ -102,13 +101,15 @@ internal class MessageSvc {
...
@@ -102,13 +101,15 @@ internal class MessageSvc {
}
}
}
}
object
EmptyResponse
:
Response
(
MsgSvc
.
SyncFlag
.
STOP
,
emptyList
())
@UseExperimental
(
MiraiInternalAPI
::
class
)
@UseExperimental
(
MiraiInternalAPI
::
class
)
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
Response
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
Response
{
// 00 00 01 0F 08 00 12 00 1A 34 08 FF C1 C4 F1 05 10 FF C1 C4 F1 05 18 E6 ED B9 C3 02 20 89 FE BE A4 06 28 8A CA 91 D1 0C 48 9B A5 BD 9B 0A 58 DE 9D 99 F8 08 60 1D 68 FF C1 C4 F1 05 70 00 20 02 2A 9D 01 08 F3 C1 C4 F1 05 10 A2 FF 8C F0 03 18 01 22 8A 01 0A 2A 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 A6 01 20 0B 28 AE F9 01 30 F4 C1 C4 F1 05 38 A7 E3 D8 D4 84 80 80 80 01 B8 01 CD B5 01 12 08 08 01 10 00 18 00 20 00 1A 52 0A 50 0A 27 08 00 10 F4 C1 C4 F1 05 18 A7 E3 D8 D4 04 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 08 0A 06 0A 04 4E 4D 53 4C 12 15 AA 02 12 9A 01 0F 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 12 04 4A 02 08 00 30 01 2A 15 08 97 A2 C1 F1 05 10 95 A6 F5 E5 0C 18 01 30 01 40 01 48 81 01 2A 10 08 D3 F7 B5 F1 05 10 DD F1 92 B7 07 18 01 30 01 38 00 42 00 48 00
// 00 00 01 0F 08 00 12 00 1A 34 08 FF C1 C4 F1 05 10 FF C1 C4 F1 05 18 E6 ED B9 C3 02 20 89 FE BE A4 06 28 8A CA 91 D1 0C 48 9B A5 BD 9B 0A 58 DE 9D 99 F8 08 60 1D 68 FF C1 C4 F1 05 70 00 20 02 2A 9D 01 08 F3 C1 C4 F1 05 10 A2 FF 8C F0 03 18 01 22 8A 01 0A 2A 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 A6 01 20 0B 28 AE F9 01 30 F4 C1 C4 F1 05 38 A7 E3 D8 D4 84 80 80 80 01 B8 01 CD B5 01 12 08 08 01 10 00 18 00 20 00 1A 52 0A 50 0A 27 08 00 10 F4 C1 C4 F1 05 18 A7 E3 D8 D4 04 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 08 0A 06 0A 04 4E 4D 53 4C 12 15 AA 02 12 9A 01 0F 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 12 04 4A 02 08 00 30 01 2A 15 08 97 A2 C1 F1 05 10 95 A6 F5 E5 0C 18 01 30 01 40 01 48 81 01 2A 10 08 D3 F7 B5 F1 05 10 DD F1 92 B7 07 18 01 30 01 38 00 42 00 48 00
val
resp
=
readProtoBuf
(
MsgSvc
.
PbGetMsgResp
.
serializer
())
val
resp
=
readProtoBuf
(
MsgSvc
.
PbGetMsgResp
.
serializer
())
if
(
resp
.
result
!=
0
)
{
if
(
resp
.
result
!=
0
)
{
println
(
"!!! Result=${resp.result} !!!: "
+
resp
.
contentToString
())
//
println("!!! Result=${resp.result} !!!: " + resp.contentToString())
return
GetMsgSuccess
(
mutableListOf
())
return
GetMsgSuccess
(
mutableListOf
())
}
}
...
@@ -117,9 +118,12 @@ internal class MessageSvc {
...
@@ -117,9 +118,12 @@ internal class MessageSvc {
bot
.
client
.
c2cMessageSync
.
msgCtrlBuf
=
resp
.
msgCtrlBuf
bot
.
client
.
c2cMessageSync
.
msgCtrlBuf
=
resp
.
msgCtrlBuf
if
(
resp
.
uinPairMsgs
==
null
)
{
if
(
resp
.
uinPairMsgs
==
null
)
{
return
GetMsgSuccess
(
mutableListOf
())
return
EmptyResponse
}
}
if
(!
bot
.
firstLoginSucceed
)
return
EmptyResponse
val
messages
=
resp
.
uinPairMsgs
.
asSequence
().
filterNot
{
it
.
msg
==
null
}.
flatMap
{
it
.
msg
!!
.
asSequence
()
}.
mapNotNull
{
val
messages
=
resp
.
uinPairMsgs
.
asSequence
().
filterNot
{
it
.
msg
==
null
}.
flatMap
{
it
.
msg
!!
.
asSequence
()
}.
mapNotNull
{
when
(
it
.
msgHead
.
msgType
)
{
when
(
it
.
msgHead
.
msgType
)
{
166
->
FriendMessage
(
166
->
FriendMessage
(
...
@@ -132,7 +136,7 @@ internal class MessageSvc {
...
@@ -132,7 +136,7 @@ internal class MessageSvc {
}.
toMutableList
()
}.
toMutableList
()
if
(
resp
.
syncFlag
==
MsgSvc
.
SyncFlag
.
STOP
)
{
if
(
resp
.
syncFlag
==
MsgSvc
.
SyncFlag
.
STOP
)
{
messages
.
ifEmpty
{
messages
.
ifEmpty
{
return
GetMsgSuccess
(
messages
)
return
EmptyResponse
}
}
return
GetMsgSuccess
(
mutableListOf
(
messages
.
last
()))
return
GetMsgSuccess
(
mutableListOf
(
messages
.
last
()))
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt
View file @
224b8058
...
@@ -60,7 +60,7 @@ internal class FriendList {
...
@@ -60,7 +60,7 @@ internal class FriendList {
}
}
class
Response
(
class
Response
(
val
members
:
List
<
s
t
TroopMemberInfo
>,
val
members
:
List
<
S
tTroopMemberInfo
>,
val
nextUin
:
Long
val
nextUin
:
Long
)
:
Packet
{
)
:
Packet
{
override
fun
toString
():
String
=
"Friendlist.GetTroopMemberList.Response"
override
fun
toString
():
String
=
"Friendlist.GetTroopMemberList.Response"
...
@@ -76,7 +76,7 @@ internal class FriendList {
...
@@ -76,7 +76,7 @@ internal class FriendList {
}
}
class
Response
(
class
Response
(
val
groups
:
List
<
s
t
TroopNum
>
val
groups
:
List
<
S
tTroopNum
>
)
:
Packet
{
)
:
Packet
{
override
fun
toString
():
String
=
"FriendList.GetFriendGroupList.Response"
override
fun
toString
():
String
=
"FriendList.GetFriendGroupList.Response"
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/data/Packet.kt
View file @
224b8058
...
@@ -10,7 +10,7 @@ object NoPakcet : Packet
...
@@ -10,7 +10,7 @@ object NoPakcet : Packet
/**
/**
* PacketFactory 可以一次解析多个包出来. 它们将会被分别广播.
* PacketFactory 可以一次解析多个包出来. 它们将会被分别广播.
*/
*/
open
class
MultiPacket
<
P
:
Packet
>(
internal
val
delegate
:
Mutable
List
<
P
>)
:
List
<
P
>
by
delegate
,
Packet
{
open
class
MultiPacket
<
P
:
Packet
>(
internal
val
delegate
:
List
<
P
>)
:
List
<
P
>
by
delegate
,
Packet
{
override
fun
toString
():
String
{
override
fun
toString
():
String
{
return
"MultiPacket<${this.firstOrNull()?.let { it::class.simpleName } ?: "
?
"}>"
return
"MultiPacket<${this.firstOrNull()?.let { it::class.simpleName } ?: "
?
"}>"
}
}
...
...
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