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
368abbe1
Commit
368abbe1
authored
Nov 11, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unknown statuses
parent
62088295
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
145 additions
and
95 deletions
+145
-95
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/OnlineStatus.kt
...c/commonMain/kotlin/net.mamoe.mirai/utils/OnlineStatus.kt
+9
-4
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt
...i-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt
+3
-0
mirai-debug/src/main/kotlin/PacketDebuger.kt
mirai-debug/src/main/kotlin/PacketDebuger.kt
+133
-91
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/OnlineStatus.kt
View file @
368abbe1
...
@@ -26,13 +26,18 @@ enum class OnlineStatus(
...
@@ -26,13 +26,18 @@ enum class OnlineStatus(
*/
*/
OFFLINE
(
0
x02u
),
OFFLINE
(
0
x02u
),
/**
UNKNOWN1
(
0
x20u
),
* ?
UNKNOWN2
(
0
x46u
),
*/
UNKNOWN3
(
0
x14u
),
UNKNOWN
(
0
x20u
)
UNKNOWN4
(
0
xC9u
),
UNKNOWN5
(
0
x1Eu
),
;
;
// TODO: 2019/10/29 what is 0x20u
// TODO: 2019/10/29 what is 0x20u
// TODO: 2019/11/11 what is 0x46u
// TODO: 2019/11/11 what is 0x14u
// TODO: 2019/11/11 0xC9u
// TODO: 2019/11/11 0x1Eu
companion
object
{
companion
object
{
fun
ofId
(
id
:
UByte
):
OnlineStatus
?
=
values
().
firstOrNull
{
it
.
id
==
id
}
fun
ofId
(
id
:
UByte
):
OnlineStatus
?
=
values
().
firstOrNull
{
it
.
id
==
id
}
}
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt
View file @
368abbe1
...
@@ -3,6 +3,7 @@ package net.mamoe.mirai.utils
...
@@ -3,6 +3,7 @@ package net.mamoe.mirai.utils
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.IoBuffer
import
kotlinx.io.core.IoBuffer
import
kotlinx.io.pool.useInstance
import
kotlinx.io.pool.useInstance
import
net.mamoe.mirai.network.protocol.tim.packet.Decrypter
import
net.mamoe.mirai.network.protocol.tim.packet.DecrypterByteArray
import
net.mamoe.mirai.network.protocol.tim.packet.DecrypterByteArray
import
net.mamoe.mirai.utils.io.*
import
net.mamoe.mirai.utils.io.*
import
kotlin.experimental.and
import
kotlin.experimental.and
...
@@ -123,6 +124,8 @@ fun ByteReadPacket.decryptBy(key: ByteArray): ByteReadPacket = decryptAsByteArra
...
@@ -123,6 +124,8 @@ fun ByteReadPacket.decryptBy(key: ByteArray): ByteReadPacket = decryptAsByteArra
fun
ByteReadPacket
.
decryptBy
(
key
:
IoBuffer
):
ByteReadPacket
=
decryptAsByteArray
(
key
)
{
data
->
ByteReadPacket
(
data
,
0
)
}
fun
ByteReadPacket
.
decryptBy
(
key
:
IoBuffer
):
ByteReadPacket
=
decryptAsByteArray
(
key
)
{
data
->
ByteReadPacket
(
data
,
0
)
}
fun
ByteReadPacket
.
decryptBy
(
key
:
Decrypter
):
ByteReadPacket
=
key
.
decrypt
(
this
)
fun
ByteReadPacket
.
decryptBy
(
keyHex
:
String
):
ByteReadPacket
=
decryptBy
(
keyHex
.
hexToBytes
())
fun
ByteReadPacket
.
decryptBy
(
keyHex
:
String
):
ByteReadPacket
=
decryptBy
(
keyHex
.
hexToBytes
())
inline
fun
<
R
>
ByteReadPacket
.
decryptAsByteArray
(
key
:
ByteArray
,
consumer
:
(
ByteArray
)
->
R
):
R
=
inline
fun
<
R
>
ByteReadPacket
.
decryptAsByteArray
(
key
:
ByteArray
,
consumer
:
(
ByteArray
)
->
R
):
R
=
...
...
mirai-debug/src/main/kotlin/PacketDebuger.kt
View file @
368abbe1
This diff is collapsed.
Click to expand it.
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