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
f949175e
Commit
f949175e
authored
Feb 02, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to merge
parent
0d485059
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
10 deletions
+93
-10
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
...ommonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
+6
-5
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
...moe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
+10
-0
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
+63
-0
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt
...qandroid/network/protocol/packet/list/FriendListPacket.kt
+14
-5
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
View file @
f949175e
...
...
@@ -74,12 +74,13 @@ internal class MemberImpl(
@UseExperimental
(
MiraiInternalAPI
::
class
)
internal
class
GroupImpl
(
bot
:
QQAndroidBot
,
override
val
coroutineContext
:
CoroutineContext
,
override
val
id
:
Long
,
override
val
owner
:
Member
,
override
val
name
:
String
,
override
val
announcement
:
String
,
override
val
members
:
ContactList
<
Member
>
bot
:
QQAndroidBot
,
override
val
coroutineContext
:
CoroutineContext
,
override
val
id
:
Long
)
:
ContactImpl
(),
Group
{
override
lateinit
var
owner
:
Member
override
lateinit
var
name
:
String
override
lateinit
var
announcement
:
String
override
lateinit
var
members
:
ContactList
<
Member
>
override
val
internalId
:
GroupInternalId
=
GroupId
(
id
).
toInternalId
()
override
fun
getMember
(
id
:
Long
):
Member
=
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
View file @
f949175e
...
...
@@ -163,6 +163,16 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
}
suspend
fun
getTroopMemberList
(
groupUni
:
Long
)
{
bot
.
logger
.
info
(
"开始群[$groupUni]成员"
)
val
data
=
FriendList
.
GetTroopMemberList
(
bot
.
client
,
groupUni
,
0
).
sendAndExpect
<
FriendList
.
GetFriendGroupList
.
Response
>(
timeoutMillis
=
1000
)
println
(
data
.
contentToString
())
}
/**
* 缓存超时处理的 [Job]. 超时后将清空缓存, 以免阻碍后续包的处理
*/
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/TroopList.kt
View file @
f949175e
...
...
@@ -116,4 +116,67 @@ internal class GetTroopMemberListReq(
@SerialId
(
5
)
val
reqType
:
Long
?
=
null
,
@SerialId
(
6
)
val
getListAppointTime
:
Long
?
=
null
,
@SerialId
(
7
)
val
richCardNameVer
:
Byte
?
=
null
)
:
JceStruct
@Serializable
internal
class
GetTroopMemberListResp
(
@SerialId
(
0
)
val
uin
:
Long
,
@SerialId
(
1
)
val
groupCode
:
Long
,
@SerialId
(
2
)
val
groupUin
:
Long
,
@SerialId
(
3
)
val
vecTroopMember
:
List
<
st
TroopMemberInfo
>,
@SerialId
(
4
)
val
nextUin
:
Long
,
@SerialId
(
5
)
val
result
:
Int
,
@SerialId
(
6
)
val
errorCode
:
Short
?
=
null
,
@SerialId
(
7
)
val
officeMode
:
Long
?
=
null
,
@SerialId
(
8
)
val
nextGetTime
:
Long
?
=
null
)
:
JceStruct
@Serializable
internal
class
st
TroopMemberInfo
(
@SerialId
(
0
)
val
memberUin
:
Long
,
@SerialId
(
1
)
val
faceId
:
Short
,
@SerialId
(
2
)
val
age
:
Byte
,
@SerialId
(
3
)
val
gender
:
Byte
,
@SerialId
(
4
)
val
nick
:
String
=
""
,
@SerialId
(
5
)
val
status
:
Byte
=
20
,
@SerialId
(
6
)
val
sShowName
:
String
?
=
""
,
@SerialId
(
8
)
val
sName
:
String
?
=
""
,
@SerialId
(
9
)
val
cGender
:
Byte
?
=
null
,
@SerialId
(
10
)
val
sPhone
:
String
?
=
""
,
@SerialId
(
11
)
val
sEmail
:
String
?
=
""
,
@SerialId
(
12
)
val
sMemo
:
String
?
=
""
,
@SerialId
(
13
)
val
autoRemark
:
String
?
=
""
,
@SerialId
(
14
)
val
dwMemberLevel
:
Long
?
=
null
,
@SerialId
(
15
)
val
dwJoinTime
:
Long
?
=
null
,
@SerialId
(
16
)
val
dwLastSpeakTime
:
Long
?
=
null
,
@SerialId
(
17
)
val
dwCreditLevel
:
Long
?
=
null
,
@SerialId
(
18
)
val
dwFlag
:
Long
?
=
null
,
@SerialId
(
19
)
val
dwFlagExt
:
Long
?
=
null
,
@SerialId
(
20
)
val
dwPoint
:
Long
?
=
null
,
@SerialId
(
21
)
val
concerned
:
Byte
?
=
null
,
@SerialId
(
22
)
val
shielded
:
Byte
?
=
null
,
@SerialId
(
23
)
val
sSpecialTitle
:
String
?
=
""
,
@SerialId
(
24
)
val
dwSpecialTitleExpireTime
:
Long
?
=
null
,
@SerialId
(
25
)
val
job
:
String
?
=
""
,
@SerialId
(
26
)
val
apolloFlag
:
Byte
?
=
null
,
@SerialId
(
27
)
val
dwApolloTimestamp
:
Long
?
=
null
,
@SerialId
(
28
)
val
dwGlobalGroupLevel
:
Long
?
=
null
,
@SerialId
(
29
)
val
dwTitleId
:
Long
?
=
null
,
@SerialId
(
30
)
val
dwShutupTimestap
:
Long
?
=
null
,
@SerialId
(
31
)
val
dwGlobalGroupPoint
:
Long
?
=
null
,
@SerialId
(
32
)
val
qzusrinfo
:
QzoneUserInfo
?
=
null
,
@SerialId
(
33
)
val
richCardNameVer
:
Byte
?
=
null
,
@SerialId
(
34
)
val
dwVipType
:
Long
?
=
null
,
@SerialId
(
35
)
val
dwVipLevel
:
Long
?
=
null
,
@SerialId
(
36
)
val
dwBigClubLevel
:
Long
?
=
null
,
@SerialId
(
37
)
val
dwBigClubFlag
:
Long
?
=
null
,
@SerialId
(
38
)
val
dwNameplate
:
Long
?
=
null
,
@SerialId
(
39
)
val
vecGroupHonor
:
ByteArray
?
=
null
)
:
JceStruct
@Serializable
internal
class
QzoneUserInfo
(
@SerialId
(
0
)
val
eStarState
:
Int
?
=
null
,
@SerialId
(
1
)
val
extendInfo
:
Map
<
String
,
String
>?
=
null
)
:
JceStruct
\ No newline at end of file
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/list/FriendListPacket.kt
View file @
f949175e
...
...
@@ -16,7 +16,11 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList.GetFriendGroupList.decode
import
net.mamoe.mirai.utils.io.debugIfFail
import
net.mamoe.mirai.utils.io.debugPrintThis
import
net.mamoe.mirai.utils.io.debugPrintln
import
net.mamoe.mirai.utils.io.discardExact
internal
class
FriendList
{
...
...
@@ -24,7 +28,11 @@ internal class FriendList {
internal
object
GetTroopMemberList
:
OutgoingPacketFactory
<
GetTroopMemberList
.
Response
>(
"friendlist.GetTroopMemberListReq"
)
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
GetTroopMemberList
.
Response
{
TODO
()
this
.
discardExact
(
4
)
val
res
=
this
.
debugIfFail
{
this
.
decodeUniPacket
(
GetTroopMemberListResp
.
serializer
())
}
return
Response
(
res
.
vecTroopMember
)
}
operator
fun
invoke
(
...
...
@@ -47,7 +55,7 @@ internal class FriendList {
uin
=
client
.
uin
,
groupCode
=
GroupId
(
targetGroupId
).
toInternalId
().
value
,
groupUin
=
targetGroupId
,
nextUin
=
0
,
nextUin
=
nextUin
,
reqType
=
0
)
)
...
...
@@ -57,15 +65,16 @@ internal class FriendList {
}
class
Response
(
val
members
:
List
<
st
TroopMemberInfo
>
)
:
Packet
{
override
fun
toString
():
String
=
"Friend
List.GetFriendGroup
List.Response"
override
fun
toString
():
String
=
"Friend
list.GetTroopMember
List.Response"
}
}
internal
object
GetTroopListSimplify
:
OutgoingPacketFactory
<
GetTroopListSimplify
.
Response
>(
"friendlist.GetTroopListReqV2"
)
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
GetTroopListSimplify
.
Response
{
val
res
=
this
.
decodeUniPacket
(
GetTroopListRespV2
.
serializer
())
return
Response
(
res
.
vecTroopList
.
orEmpty
())
...
...
@@ -120,7 +129,7 @@ internal class FriendList {
}
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
Response
{
//
this.discardExact(4)
this
.
discardExact
(
4
)
val
res
=
this
.
debugIfFail
{
this
.
decodeUniPacket
(
GetFriendListResp
.
serializer
())
}
return
Response
(
res
.
totoalFriendCount
,
...
...
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