Adjust file names

This commit is contained in:
Him188 2020-02-20 11:23:37 +08:00
parent 57dfd0f1eb
commit 7838ccf042
22 changed files with 34 additions and 67 deletions

View File

@ -7,6 +7,9 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:JvmName("SerializationUtils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.io.serialization
import kotlinx.io.core.*
@ -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.utils.firstValue
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 {

View File

@ -20,7 +20,7 @@ import net.mamoe.mirai.utils.io.hexToBytes
import net.mamoe.mirai.utils.io.read
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)
internal fun At.toJceData(): ImMsgBody.Text {
@ -328,8 +328,9 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(message: MessageChain) {
if (it.text.attr6Buf.isEmpty()) {
message.add(it.text.str.toMessage())
} else {
//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 05 01 00 00 00 00 00 00 all
// 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
it.text.attr6Buf.read {
discardExact(7)

View File

@ -7,9 +7,13 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils
import net.mamoe.mirai.utils.md5
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic
/**

View File

@ -7,8 +7,14 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
inline class MacOrAndroidIdChangeFlag(val value: Long = 0) {
fun macChanged(): MacOrAndroidIdChangeFlag =
MacOrAndroidIdChangeFlag(this.value or 0x1)

View File

@ -7,11 +7,16 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:JvmName("Utils")
@file:JvmMultifileClass
package net.mamoe.mirai.qqandroid.utils
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
/**
* Inline the block

View File

@ -7,10 +7,16 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:JvmName("Utils")
@file:JvmMultifileClass
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")
var var0 = this.toLong() and 0xFFFFFFFF
return buildString {

View File

@ -1,14 +0,0 @@
/*
* 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
}

View File

@ -1,25 +0,0 @@
/*
* 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
}

View File

@ -17,7 +17,6 @@ import kotlinx.io.core.readUInt
import kotlinx.io.core.readULong
import net.mamoe.mirai.utils.MiraiDebugAPI
import net.mamoe.mirai.utils.MiraiExperimentalAPI
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.io.*
import kotlin.jvm.JvmStatic

View File

@ -14,7 +14,6 @@ package net.mamoe.mirai.utils
import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName
import kotlin.time.seconds
// 临时使用, 待 Kotlin Duration 稳定后使用 Duration.
// 内联属性, 则将来删除这些 API 将不会导致二进制不兼容.

View File

@ -29,13 +29,13 @@ internal val factory: BotFactory = run {
"""
No BotFactory found. Please ensure that you've added dependency of protocol modules.
Available modules:
- net.mamoe:mirai-core-timpc
- net.mamoe:mirai-core-timpc (stays at 0.12.0)
- net.mamoe:mirai-core-qqandroid (recommended)
You should have at lease one protocol module installed.
-------------------------------------------------------
找不到 BotFactory. 请确保你依赖了至少一个协议模块.
可用的协议模块:
- net.mamoe:mirai-core-timpc
- net.mamoe:mirai-core-timpc (0.12.0 后停止更新)
- net.mamoe:mirai-core-qqandroid (推荐)
请添加上述任一模块的依赖( mirai-core 版本相同)
""".trimIndent()

View File

@ -1,18 +0,0 @@
/*
* 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
}