Commit 7838ccf0 authored by Him188's avatar Him188

Adjust file names

parent 57dfd0f1
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
@file:JvmName("SerializationUtils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.io.serialization package net.mamoe.mirai.qqandroid.io.serialization
import kotlinx.io.core.* import kotlinx.io.core.*
...@@ -20,7 +23,8 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3 ...@@ -20,7 +23,8 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket
import net.mamoe.mirai.utils.firstValue import net.mamoe.mirai.utils.firstValue
import net.mamoe.mirai.utils.io.read import net.mamoe.mirai.utils.io.read
import net.mamoe.mirai.utils.io.toUHexString import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
fun <T : JceStruct> ByteArray.loadAs(deserializer: DeserializationStrategy<T>, c: JceCharset = JceCharset.UTF8): T { fun <T : JceStruct> ByteArray.loadAs(deserializer: DeserializationStrategy<T>, c: JceCharset = JceCharset.UTF8): T {
......
...@@ -20,7 +20,7 @@ import net.mamoe.mirai.utils.io.hexToBytes ...@@ -20,7 +20,7 @@ import net.mamoe.mirai.utils.io.hexToBytes
import net.mamoe.mirai.utils.io.read import net.mamoe.mirai.utils.io.read
import net.mamoe.mirai.utils.io.toByteArray import net.mamoe.mirai.utils.io.toByteArray
private val AT_BUF_1 = byteArrayOf(0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00) private val AT_BUF_1 = byteArrayOf(0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00) // groupCard = 0x07; nick = 0x0A
private val AT_BUF_2 = ByteArray(2) private val AT_BUF_2 = ByteArray(2)
internal fun At.toJceData(): ImMsgBody.Text { internal fun At.toJceData(): ImMsgBody.Text {
...@@ -328,8 +328,9 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(message: MessageChain) { ...@@ -328,8 +328,9 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(message: MessageChain) {
if (it.text.attr6Buf.isEmpty()) { if (it.text.attr6Buf.isEmpty()) {
message.add(it.text.str.toMessage()) message.add(it.text.str.toMessage())
} else { } else {
//00 01 00 00 00 05 01 00 00 00 00 00 00 all // 00 01 00 00 00 05 01 00 00 00 00 00 00 all
//00 01 00 00 00 0A 00 3E 03 3F A2 00 00 one // 00 01 00 00 00 0A 00 3E 03 3F A2 00 00 one/nick
// 00 01 00 00 00 07 00 44 71 47 90 00 00 one/groupCard
val id: Long val id: Long
it.text.attr6Buf.read { it.text.attr6Buf.read {
discardExact(7) discardExact(7)
......
...@@ -7,9 +7,13 @@ ...@@ -7,9 +7,13 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils package net.mamoe.mirai.qqandroid.utils
import net.mamoe.mirai.utils.md5 import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic import kotlin.jvm.JvmStatic
/** /**
......
...@@ -7,8 +7,14 @@ ...@@ -7,8 +7,14 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils package net.mamoe.mirai.qqandroid.utils
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
inline class MacOrAndroidIdChangeFlag(val value: Long = 0) { inline class MacOrAndroidIdChangeFlag(val value: Long = 0) {
fun macChanged(): MacOrAndroidIdChangeFlag = fun macChanged(): MacOrAndroidIdChangeFlag =
MacOrAndroidIdChangeFlag(this.value or 0x1) MacOrAndroidIdChangeFlag(this.value or 0x1)
......
...@@ -7,11 +7,16 @@ ...@@ -7,11 +7,16 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils package net.mamoe.mirai.qqandroid.utils
import kotlin.contracts.ExperimentalContracts import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind import kotlin.contracts.InvocationKind
import kotlin.contracts.contract import kotlin.contracts.contract
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
/** /**
* Inline the block * Inline the block
......
...@@ -7,10 +7,16 @@ ...@@ -7,10 +7,16 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE * https://github.com/mamoe/mirai/blob/master/LICENSE
*/ */
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils package net.mamoe.mirai.qqandroid.utils
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
fun Int.toIpV4AddressString(): String { internal fun Int.toIpV4AddressString(): String {
@Suppress("NAME_SHADOWING") @Suppress("NAME_SHADOWING")
var var0 = this.toLong() and 0xFFFFFFFF var var0 = this.toLong() and 0xFFFFFFFF
return buildString { return buildString {
......
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai
actual object MiraiEnvironment {
actual val platform: Platform get() = Platform.ANDROID
}
\ No newline at end of file
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai
/**
* 平台相关环境属性
*/
expect object MiraiEnvironment {
val platform: Platform
}
/**
* 可用平台列表
*/
enum class Platform {
ANDROID,
JVM
}
\ No newline at end of file
...@@ -17,7 +17,6 @@ import kotlinx.io.core.readUInt ...@@ -17,7 +17,6 @@ import kotlinx.io.core.readUInt
import kotlinx.io.core.readULong import kotlinx.io.core.readULong
import net.mamoe.mirai.utils.MiraiDebugAPI import net.mamoe.mirai.utils.MiraiDebugAPI
import net.mamoe.mirai.utils.MiraiExperimentalAPI import net.mamoe.mirai.utils.MiraiExperimentalAPI
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.io.* import net.mamoe.mirai.utils.io.*
import kotlin.jvm.JvmStatic import kotlin.jvm.JvmStatic
......
...@@ -14,7 +14,6 @@ package net.mamoe.mirai.utils ...@@ -14,7 +14,6 @@ package net.mamoe.mirai.utils
import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
import kotlin.time.seconds
// 临时使用, 待 Kotlin Duration 稳定后使用 Duration. // 临时使用, 待 Kotlin Duration 稳定后使用 Duration.
// 内联属性, 则将来删除这些 API 将不会导致二进制不兼容. // 内联属性, 则将来删除这些 API 将不会导致二进制不兼容.
......
...@@ -29,13 +29,13 @@ internal val factory: BotFactory = run { ...@@ -29,13 +29,13 @@ internal val factory: BotFactory = run {
""" """
No BotFactory found. Please ensure that you've added dependency of protocol modules. No BotFactory found. Please ensure that you've added dependency of protocol modules.
Available modules: Available modules:
- net.mamoe:mirai-core-timpc - net.mamoe:mirai-core-timpc (stays at 0.12.0)
- net.mamoe:mirai-core-qqandroid (recommended) - net.mamoe:mirai-core-qqandroid (recommended)
You should have at lease one protocol module installed. You should have at lease one protocol module installed.
------------------------------------------------------- -------------------------------------------------------
找不到 BotFactory. 请确保你依赖了至少一个协议模块. 找不到 BotFactory. 请确保你依赖了至少一个协议模块.
可用的协议模块: 可用的协议模块:
- net.mamoe:mirai-core-timpc - net.mamoe:mirai-core-timpc (0.12.0 后停止更新)
- net.mamoe:mirai-core-qqandroid (推荐) - net.mamoe:mirai-core-qqandroid (推荐)
请添加上述任一模块的依赖(与 mirai-core 版本相同) 请添加上述任一模块的依赖(与 mirai-core 版本相同)
""".trimIndent() """.trimIndent()
......
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("MayBeConstant", "unused")
package net.mamoe.mirai
actual object MiraiEnvironment {
@JvmStatic
actual val platform: Platform
get() = Platform.JVM
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment