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
e1c4ff9c
Commit
e1c4ff9c
authored
Nov 22, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small improvements
parent
0ea95c33
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
20 deletions
+24
-20
mirai-api-http/src/main/kotlin/net.mamoe.mirai.api.http/MiraiHttpApplication.kt
...n/kotlin/net.mamoe.mirai.api.http/MiraiHttpApplication.kt
+0
-2
mirai-core/build.gradle.kts
mirai-core/build.gradle.kts
+12
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/PacketFactory.kt
....mamoe.mirai/network/protocol/tim/packet/PacketFactory.kt
+2
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/TypeConversion.kt
...monMain/kotlin/net.mamoe.mirai/utils/io/TypeConversion.kt
+0
-1
mirai-core/src/commonTest/kotlin/net.mamoe.mirai.utils.io/TypeConversionTest.kt
...est/kotlin/net.mamoe.mirai.utils.io/TypeConversionTest.kt
+10
-0
mirai-debug/src/main/kotlin/test/ProtoTest.kt
mirai-debug/src/main/kotlin/test/ProtoTest.kt
+0
-15
No files found.
mirai-api-http/src/main/kotlin/net.mamoe.mirai.api.http/MiraiHttpApplication.kt
View file @
e1c4ff9c
...
@@ -75,8 +75,6 @@ private fun Route.mirai(path: String, body: PipelineInterceptor<Unit, Applicatio
...
@@ -75,8 +75,6 @@ private fun Route.mirai(path: String, body: PipelineInterceptor<Unit, Applicatio
}
}
}
}
@Suppress
(
"NOTHING_TO_INLINE"
)
suspend
inline
fun
ApplicationCall
.
ok
()
=
this
.
respond
(
HttpStatusCode
.
OK
,
"OK"
)
suspend
inline
fun
ApplicationCall
.
ok
()
=
this
.
respond
(
HttpStatusCode
.
OK
,
"OK"
)
/**
/**
...
...
mirai-core/build.gradle.kts
View file @
e1c4ff9c
...
@@ -121,12 +121,23 @@ kotlin {
...
@@ -121,12 +121,23 @@ kotlin {
}
}
}
}
sourceSets
[
"commonTest"
].
apply
{
dependencies
{
kotlin
(
"kotlin-test-annotations-common"
)
kotlin
(
"kotlin-test-common"
)
}
kotlin
.
setSrcDirs
(
listOf
(
"src/$name/kotlin"
))
}
sourceSets
[
"jvmTest"
].
apply
{
sourceSets
[
"jvmTest"
].
apply
{
dependencies
{
dependencies
{
kotlin
(
"kotlin-test"
,
kotlinVersion
)
kotlin
(
"kotlin-test-annotations-common"
,
kotlinVersion
)
kotlin
(
"kotlin-test-junit5"
,
kotlinVersion
)
implementation
(
"org.junit.jupiter:junit-jupiter-api:5.5.2"
)
}
}
kotlin
.
outputDir
=
file
(
"build/classes/kotlin/jvm/test"
)
kotlin
.
outputDir
=
file
(
"build/classes/kotlin/jvm/test"
)
kotlin
.
setSrcDirs
(
listOf
(
"src/$name/kotlin"
))
kotlin
.
setSrcDirs
(
listOf
(
"src/$name/kotlin"
))
}
}
sourceSets
.
all
{
sourceSets
.
all
{
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/PacketFactory.kt
View file @
e1c4ff9c
...
@@ -11,7 +11,6 @@ import kotlinx.serialization.DeserializationStrategy
...
@@ -11,7 +11,6 @@ import kotlinx.serialization.DeserializationStrategy
import
kotlinx.serialization.protobuf.ProtoBuf
import
kotlinx.serialization.protobuf.ProtoBuf
import
net.mamoe.mirai.network.BotNetworkHandler
import
net.mamoe.mirai.network.BotNetworkHandler
import
net.mamoe.mirai.utils.io.ByteArrayPool
import
net.mamoe.mirai.utils.io.ByteArrayPool
import
net.mamoe.mirai.utils.io.debugPrint
import
net.mamoe.mirai.utils.io.read
import
net.mamoe.mirai.utils.io.read
import
net.mamoe.mirai.utils.io.toUHexString
import
net.mamoe.mirai.utils.io.toUHexString
import
net.mamoe.mirai.utils.readProtoMap
import
net.mamoe.mirai.utils.readProtoMap
...
@@ -35,6 +34,8 @@ abstract class PacketFactory<out TPacket : Packet, TDecrypter : Decrypter>(val d
...
@@ -35,6 +34,8 @@ abstract class PacketFactory<out TPacket : Packet, TDecrypter : Decrypter>(val d
get
()
=
(
this
::
class
.
annotations
.
firstOrNull
{
it
is
AnnotatedId
}
as
?
AnnotatedId
)
get
()
=
(
this
::
class
.
annotations
.
firstOrNull
{
it
is
AnnotatedId
}
as
?
AnnotatedId
)
?:
error
(
"Annotation AnnotatedId not found for class ${this::class.simpleName}"
)
?:
error
(
"Annotation AnnotatedId not found for class ${this::class.simpleName}"
)
// TODO: 2019/11/22 修改为参数
/**
/**
* 包 ID.
* 包 ID.
*/
*/
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/TypeConver
t
ion.kt
→
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/TypeConver
s
ion.kt
View file @
e1c4ff9c
...
@@ -8,7 +8,6 @@ import kotlinx.io.pool.ObjectPool
...
@@ -8,7 +8,6 @@ import kotlinx.io.pool.ObjectPool
import
kotlin.random.Random
import
kotlin.random.Random
import
kotlin.random.nextInt
import
kotlin.random.nextInt
/*
/*
* 类型转换 Utils.
* 类型转换 Utils.
* 这些函数为内部函数, 可能会改变
* 这些函数为内部函数, 可能会改变
...
...
mirai-core/src/commonTest/kotlin/net.mamoe.mirai.utils.io/TypeConversionTest.kt
0 → 100644
View file @
e1c4ff9c
package
net.mamoe.mirai.utils.io
class
TypeConversionTest
{
//@Test
fun
testConversions
()
{
}
}
\ No newline at end of file
mirai-debug/src/main/kotlin/test/ProtoTest.kt
View file @
e1c4ff9c
...
@@ -70,21 +70,6 @@ suspend fun deserializeTest() {
...
@@ -70,21 +70,6 @@ suspend fun deserializeTest() {
"""
.
trimIndent
().
replace
(
"\n"
,
" "
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
)
"""
.
trimIndent
().
replace
(
"\n"
,
" "
).
replace
(
"["
,
""
).
replace
(
"]"
,
""
)
.
hexToBytes
()
.
hexToBytes
()
/*
00 00 00 07 00 00 00 52 08 01 12 03 98 01 02
10 02
22 [4E] 08 A0 89 F7 B6 03 10 A2 FF 8C F0 03 18 BB 92 94 BF 08 22 10 64 CF BB 65 00 13 8D B5 58 E2 45 1E EA 65 88 E1 28 04 30 02 38 20 40 FF 01 48 00 50 01 5A 05 32 36 39 33 33 60 00 68 00 70 00 78 00 80 01 97 04 88 01 ED 03 90 01 04 A0 01 01
*/
/*
for (i in 0..bytes.size) {
try {
println(bytes.copyOfRange(i, bytes.size).read { readProtoMap() })
} catch (e: Exception) {
}
}*/
println
(
bytes
.
read
{
readProtoMap
()
})
println
(
bytes
.
read
{
readProtoMap
()
})
}
}
...
...
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