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
7b8ddd2c
Commit
7b8ddd2c
authored
Nov 08, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data class SessionKeyResponse
parent
2f1df3b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Session.kt
....mamoe.mirai/network/protocol/tim/packet/login/Session.kt
+12
-13
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Session.kt
View file @
7b8ddd2c
...
@@ -59,30 +59,29 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
...
@@ -59,30 +59,29 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
}
}
}
}
class
SessionKeyResponse
:
Packet
{
data class
SessionKeyResponse
(
va
r
sessionKey
:
SessionKey
?
=
null
va
l
sessionKey
:
SessionKey
,
lateinit
var
tlv0105
:
ByteReadPacket
val
tlv0105
:
ByteReadPacket
?
=
null
}
)
:
Packet
override
suspend
fun
ByteReadPacket
.
decode
(
id
:
PacketId
,
sequenceId
:
UShort
,
handler
:
BotNetworkHandler
<
*
>):
SessionKeyResponse
=
override
suspend
fun
ByteReadPacket
.
decode
(
id
:
PacketId
,
sequenceId
:
UShort
,
handler
:
BotNetworkHandler
<
*
>):
SessionKeyResponse
{
SessionKeyResponse
().
apply
{
when
(
remaining
)
{
when
(
remaining
)
{
407L
->
{
407L
->
{
discardExact
(
25
)
//todo test
discardExact
(
25
)
//todo test
sessionKey
=
SessionKey
(
readBytes
(
16
))
return
SessionKeyResponse
(
SessionKey
(
readBytes
(
16
)
))
}
}
439L
->
{
439L
->
{
discardExact
(
63
)
discardExact
(
63
)
sessionKey
=
SessionKey
(
readBytes
(
16
))
return
SessionKeyResponse
(
SessionKey
(
readBytes
(
16
)
))
}
}
502L
,
//?
502L
,
//?
512L
,
512L
,
527L
->
{
527L
->
{
discardExact
(
63
)
//00 00 0D 00 06 00 01 00 00 00 00 00 1F 00 22 00 01 D7 EC FC 38 1B 74 6F 91 42 00 B9 DB 69 32 43 EC 8C 02 DC E0 07 35 58 8C 6C FE 43 5D AA 6A 88 E0 00 14 00 04 00 01 00 3C 01 0C 00 73 00 01
discardExact
(
63
)
//00 00 0D 00 06 00 01 00 00 00 00 00 1F 00 22 00 01 D7 EC FC 38 1B 74 6F 91 42 00 B9 DB 69 32 43 EC 8C 02 DC E0 07 35 58 8C 6C FE 43 5D AA 6A 88 E0 00 14 00 04 00 01 00 3C 01 0C 00 73 00 01
sessionKey
=
SessionKey
(
readBytes
(
16
))
val
sessionKey
=
SessionKey
(
readBytes
(
16
))
tlv0105
=
buildPacket
{
val
tlv0105
=
buildPacket
{
writeHex
(
"01 05 00 88 00 01 01 02 00 40 02 01 03 3C 01 03 00 00"
)
writeHex
(
"01 05 00 88 00 01 01 02 00 40 02 01 03 3C 01 03 00 00"
)
discardExact
(
remaining
-
122
-
1
)
discardExact
(
remaining
-
122
-
1
)
writeFully
(
readIoBuffer
(
56
))
writeFully
(
readIoBuffer
(
56
))
...
@@ -90,7 +89,7 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
...
@@ -90,7 +89,7 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
discardExact
(
11
)
discardExact
(
11
)
writeFully
(
readIoBuffer
(
56
))
writeFully
(
readIoBuffer
(
56
))
}
//todo 这个 tlv0105似乎可以保存起来然后下次登录时使用.
}
//todo 这个 tlv0105似乎可以保存起来然后下次登录时使用.
return
SessionKeyResponse
(
sessionKey
,
tlv0105
)
/*
/*
Discarded(63) =00 00 0D 00 06 00 01 00 00 00 00 00 1F 00 22 00 01 F7 AB 01 4B 23 B5 47 FC 79 02 09 E0 19 EF 61 91 14 AD 8F 38 2E 8B D7 47 39 DE FE 84 A7 E5 6E 3D 00 14 00 04 00 01 00 3C 01 0C 00 73 00 01
Discarded(63) =00 00 0D 00 06 00 01 00 00 00 00 00 1F 00 22 00 01 F7 AB 01 4B 23 B5 47 FC 79 02 09 E0 19 EF 61 91 14 AD 8F 38 2E 8B D7 47 39 DE FE 84 A7 E5 6E 3D 00 14 00 04 00 01 00 3C 01 0C 00 73 00 01
sessionKey=7E 8C 1D AC 52 64 B8 D0 9A 55 3A A6 DF 53 88 C8
sessionKey=7E 8C 1D AC 52 64 B8 D0 9A 55 3A A6 DF 53 88 C8
...
@@ -100,7 +99,7 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
...
@@ -100,7 +99,7 @@ object RequestSessionPacket : PacketFactory<RequestSessionPacket.SessionKeyRespo
*/
*/
}
}
else
->
throw
IllegalArgumentException
(
remaining
.
toString
())
else
->
throw
IllegalArgumentException
(
remaining
.
toString
())
}
}
}
}
}
}
\ 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