diff --git a/mirai-core-utils/src/commonMain/kotlin/IO.kt b/mirai-core-utils/src/commonMain/kotlin/IO.kt index a837e4d78..383dd1635 100644 --- a/mirai-core-utils/src/commonMain/kotlin/IO.kt +++ b/mirai-core-utils/src/commonMain/kotlin/IO.kt @@ -19,7 +19,10 @@ import kotlinx.io.core.* import java.io.File import kotlin.text.Charsets +public val EMPTY_BYTE_ARRAY: ByteArray = ByteArray(0) + public val DECRYPTER_16_ZERO: ByteArray = ByteArray(16) +public val KEY_16_ZEROS: ByteArray = ByteArray(16) @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") public inline fun ByteReadPacket.useBytes( diff --git a/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt b/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt index 00779832e..fdc410149 100644 --- a/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt +++ b/mirai-core/src/commonMain/kotlin/QQAndroidBot.kt @@ -20,8 +20,6 @@ import net.mamoe.mirai.internal.contact.checkIsGroupImpl import net.mamoe.mirai.internal.contact.info.FriendInfoImpl import net.mamoe.mirai.internal.contact.info.StrangerInfoImpl import net.mamoe.mirai.internal.contact.uin -import net.mamoe.mirai.internal.message.ForwardMessageInternal -import net.mamoe.mirai.internal.message.LongMessageInternal import net.mamoe.mirai.internal.network.* import net.mamoe.mirai.internal.network.handler.BdhSessionSyncer import net.mamoe.mirai.internal.network.handler.NetworkHandler @@ -36,8 +34,6 @@ import net.mamoe.mirai.internal.utils.ScheduledJob import net.mamoe.mirai.internal.utils.crypto.TEA import net.mamoe.mirai.internal.utils.friendCacheFile import net.mamoe.mirai.internal.utils.io.serialization.toByteArray -import net.mamoe.mirai.message.data.ForwardMessage -import net.mamoe.mirai.message.data.RichMessage import net.mamoe.mirai.utils.* import java.io.File import java.net.InetSocketAddress @@ -207,67 +203,3 @@ internal class QQAndroidBot constructor( override val asStranger: Stranger by lazy { Mirai.newStranger(bot, StrangerInfoImpl(bot.id, bot.nick)) } override val strangers: ContactList = ContactList() } - -internal val EMPTY_BYTE_ARRAY = ByteArray(0) - -internal fun RichMessage.Key.longMessage(brief: String, resId: String, timeSeconds: Long): LongMessageInternal { - val limited: String = if (brief.length > 30) { - brief.take(30) + "…" - } else { - brief - } - - val template = """ - - - - $limited - - 点击查看完整消息 - - - - """.trimIndent().trim() - - return LongMessageInternal(template, resId) -} - - -internal fun RichMessage.Key.forwardMessage( - resId: String, - timeSeconds: Long, - forwardMessage: ForwardMessage, -): ForwardMessageInternal = with(forwardMessage) { - val template = """ - - - - ${title.take(50)} - ${ - when { - preview.size > 4 -> { - preview.take(3).joinToString("") { - """$it""" - } + """...""" - } - else -> { - preview.joinToString("") { - """$it""" - } - } - } - } - - ${summary.take(50)} - - - - """.trimIndent().replace("\n", " ").trim() - return ForwardMessageInternal(template, resId, null) -} \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/contact/AbstractUser.kt b/mirai-core/src/commonMain/kotlin/contact/AbstractUser.kt index aea2d7c81..b6834eaee 100644 --- a/mirai-core/src/commonMain/kotlin/contact/AbstractUser.kt +++ b/mirai-core/src/commonMain/kotlin/contact/AbstractUser.kt @@ -25,7 +25,6 @@ import net.mamoe.mirai.internal.network.highway.ResourceKind.PRIVATE_IMAGE import net.mamoe.mirai.internal.network.highway.postImage import net.mamoe.mirai.internal.network.highway.tryServersUpload import net.mamoe.mirai.internal.network.protocol.data.proto.Cmd0x352 -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.chat.image.ImgStore import net.mamoe.mirai.internal.network.protocol.packet.chat.image.LongConn import net.mamoe.mirai.internal.network.protocol.packet.sendAndExpect diff --git a/mirai-core/src/commonMain/kotlin/contact/GroupImpl.kt b/mirai-core/src/commonMain/kotlin/contact/GroupImpl.kt index 3f99e7878..24dafb2a6 100644 --- a/mirai-core/src/commonMain/kotlin/contact/GroupImpl.kt +++ b/mirai-core/src/commonMain/kotlin/contact/GroupImpl.kt @@ -31,7 +31,6 @@ import net.mamoe.mirai.internal.network.highway.ResourceKind.GROUP_VOICE import net.mamoe.mirai.internal.network.highway.postPtt import net.mamoe.mirai.internal.network.highway.tryServersUpload import net.mamoe.mirai.internal.network.protocol.data.proto.Cmd0x388 -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.chat.TroopEssenceMsgManager import net.mamoe.mirai.internal.network.protocol.packet.chat.image.ImgStore import net.mamoe.mirai.internal.network.protocol.packet.chat.voice.PttStore diff --git a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt index 5b3d4a788..dea0408e5 100644 --- a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt +++ b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt @@ -16,8 +16,6 @@ import net.mamoe.mirai.contact.* import net.mamoe.mirai.event.nextEventOrNull import net.mamoe.mirai.internal.MiraiImpl import net.mamoe.mirai.internal.asQQAndroidBot -import net.mamoe.mirai.internal.forwardMessage -import net.mamoe.mirai.internal.longMessage import net.mamoe.mirai.internal.message.* import net.mamoe.mirai.internal.network.Packet import net.mamoe.mirai.internal.network.QQAndroidClient @@ -27,8 +25,6 @@ import net.mamoe.mirai.internal.network.protocol.packet.chat.FileManagement import net.mamoe.mirai.internal.network.protocol.packet.chat.MusicSharePacket import net.mamoe.mirai.internal.network.protocol.packet.chat.image.ImgStore import net.mamoe.mirai.internal.network.protocol.packet.chat.receive.* -import net.mamoe.mirai.internal.network.protocol.packet.chat.receive.createToFriend -import net.mamoe.mirai.internal.network.protocol.packet.chat.receive.createToGroup import net.mamoe.mirai.internal.network.protocol.packet.sendAndExpect import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.data.* diff --git a/mirai-core/src/commonMain/kotlin/message/LongMessageInternal.kt b/mirai-core/src/commonMain/kotlin/message/LongMessageInternal.kt index bd1c75802..d59c98dcb 100644 --- a/mirai-core/src/commonMain/kotlin/message/LongMessageInternal.kt +++ b/mirai-core/src/commonMain/kotlin/message/LongMessageInternal.kt @@ -114,3 +114,65 @@ internal data class ForwardMessageInternal( } } + +internal fun RichMessage.Key.longMessage(brief: String, resId: String, timeSeconds: Long): LongMessageInternal { + val limited: String = if (brief.length > 30) { + brief.take(30) + "…" + } else { + brief + } + + val template = """ + + + + $limited + + 点击查看完整消息 + + + + """.trimIndent().trim() + + return LongMessageInternal(template, resId) +} + + +internal fun RichMessage.Key.forwardMessage( + resId: String, + timeSeconds: Long, + forwardMessage: ForwardMessage, +): ForwardMessageInternal = with(forwardMessage) { + val template = """ + + + + ${title.take(50)} + ${ + when { + preview.size > 4 -> { + preview.take(3).joinToString("") { + """$it""" + } + """...""" + } + else -> { + preview.joinToString("") { + """$it""" + } + } + } + } + + ${summary.take(50)} + + + + """.trimIndent().replace("\n", " ").trim() + return ForwardMessageInternal(template, resId) +} \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt b/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt index 520c9b795..fa3e89105 100644 --- a/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/incomingSourceImpl.kt @@ -22,12 +22,12 @@ import net.mamoe.mirai.internal.contact.newAnonymous import net.mamoe.mirai.internal.network.protocol.data.proto.ImMsgBody import net.mamoe.mirai.internal.network.protocol.data.proto.MsgComm import net.mamoe.mirai.internal.network.protocol.data.proto.SourceMsg -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils._miraiContentToString import net.mamoe.mirai.internal.utils.io.serialization.toByteArray import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.message.data.MessageSourceKind import net.mamoe.mirai.message.data.OnlineMessageSource +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY import net.mamoe.mirai.utils.encodeBase64 import net.mamoe.mirai.utils.encodeToString import net.mamoe.mirai.utils.mapToIntArray diff --git a/mirai-core/src/commonMain/kotlin/message/offlineSourceImpl.kt b/mirai-core/src/commonMain/kotlin/message/offlineSourceImpl.kt index 0c37daa29..6e9f2f2b3 100644 --- a/mirai-core/src/commonMain/kotlin/message/offlineSourceImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/offlineSourceImpl.kt @@ -20,6 +20,7 @@ import net.mamoe.mirai.internal.utils.io.serialization.loadAs import net.mamoe.mirai.message.data.MessageChain import net.mamoe.mirai.message.data.MessageSourceKind import net.mamoe.mirai.message.data.OfflineMessageSource +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY import net.mamoe.mirai.utils.mapToIntArray import java.util.concurrent.atomic.AtomicBoolean @@ -64,8 +65,8 @@ internal class OfflineMessageSourceImplData( ), type = 0, time = time, - pbReserve = net.mamoe.mirai.internal.EMPTY_BYTE_ARRAY, - srcMsg = net.mamoe.mirai.internal.EMPTY_BYTE_ARRAY + pbReserve = EMPTY_BYTE_ARRAY, + srcMsg = EMPTY_BYTE_ARRAY ).also { jceData = it } } diff --git a/mirai-core/src/commonMain/kotlin/network/AccountSecrets.kt b/mirai-core/src/commonMain/kotlin/network/AccountSecrets.kt index 859cd6f00..41660da19 100644 --- a/mirai-core/src/commonMain/kotlin/network/AccountSecrets.kt +++ b/mirai-core/src/commonMain/kotlin/network/AccountSecrets.kt @@ -12,10 +12,10 @@ package net.mamoe.mirai.internal.network import kotlinx.io.core.toByteArray import kotlinx.serialization.Serializable import net.mamoe.mirai.internal.BotAccount -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin.get_mpasswd import net.mamoe.mirai.internal.utils.io.ProtoBuf import net.mamoe.mirai.utils.DeviceInfo +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY import net.mamoe.mirai.utils.md5 import net.mamoe.mirai.utils.toByteArray import java.util.concurrent.CopyOnWriteArraySet diff --git a/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt b/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt index 843481f71..6b5baad56 100644 --- a/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt +++ b/mirai-core/src/commonMain/kotlin/network/QQAndroidClient.kt @@ -25,7 +25,6 @@ import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.net.protocol.LoginSessionAware import net.mamoe.mirai.internal.network.protocol.SyncingCacheList import net.mamoe.mirai.internal.network.protocol.data.jce.FileStoragePushFSSvcList -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.Tlv import net.mamoe.mirai.internal.utils.MiraiProtocolInternal import net.mamoe.mirai.internal.utils.NetworkType diff --git a/mirai-core/src/commonMain/kotlin/network/highway/Highway.kt b/mirai-core/src/commonMain/kotlin/network/highway/Highway.kt index fb20b2ff8..b8541ae00 100644 --- a/mirai-core/src/commonMain/kotlin/network/highway/Highway.kt +++ b/mirai-core/src/commonMain/kotlin/network/highway/Highway.kt @@ -24,7 +24,6 @@ import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.BdhSession import net.mamoe.mirai.internal.network.QQAndroidClient import net.mamoe.mirai.internal.network.protocol.data.proto.CSDataHighwayHead -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.subAppId import net.mamoe.mirai.internal.utils.PlatformSocket import net.mamoe.mirai.internal.utils.crypto.TEA diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/MsgType0x210.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/MsgType0x210.kt index c26886a7f..cb0ee4cd4 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/MsgType0x210.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/MsgType0x210.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -10,9 +10,9 @@ package net.mamoe.mirai.internal.network.protocol.data.jce import kotlinx.serialization.Serializable -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.JceStruct import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class AddGroup( diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/PushNotifyPack.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/PushNotifyPack.kt index e77fb8c1c..ba0c1562b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/PushNotifyPack.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/PushNotifyPack.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,9 +11,9 @@ package net.mamoe.mirai.internal.network.protocol.data.jce import kotlinx.serialization.Serializable import net.mamoe.mirai.internal.network.Packet -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.JceStruct import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Suppress("ArrayInDataClass") @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/RequestPacket.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/RequestPacket.kt index 78117e0c9..930300e8b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/RequestPacket.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/RequestPacket.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -10,9 +10,9 @@ package net.mamoe.mirai.internal.network.protocol.data.jce import kotlinx.serialization.Serializable -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.JceStruct import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY private val EMPTY_MAP = mapOf() diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x352.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x352.kt index 640ec1e6f..36effbb9a 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x352.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x352.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Cmd0x352 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x388.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x388.kt index ccc4b023e..3e9e2ea88 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x388.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x388.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Cmd0x388 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x857.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x857.kt index a3f3c0b66..36276dd5f 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x857.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x857.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -15,8 +15,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class GroupOpenSysMsg : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x858.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x858.kt index 7e8305173..1d70000b2 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x858.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Cmd0x858.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -15,8 +15,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Oidb0x858 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Define.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Define.kt index 95a6a0df0..5b43d767b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Define.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Define.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class Common : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/FriendListCommon.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/FriendListCommon.kt index 0a20e84f8..7be2d3fa8 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/FriendListCommon.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/FriendListCommon.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Vec0xd50 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Group.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Group.kt index 101080e72..9eb0c9fab 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Group.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Group.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class GroupLabel : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/GroupFileCommon.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/GroupFileCommon.kt index 0578c2712..63a54b15c 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/GroupFileCommon.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/GroupFileCommon.kt @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class GroupFileCommon : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Highway.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Highway.kt index 41020e677..4f6b5b62f 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Highway.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Highway.kt @@ -15,8 +15,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY /** diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerCommelem.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerCommelem.kt index 1cf5a51c9..aa94da815 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerCommelem.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerCommelem.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class HummerCommelem : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv21.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv21.kt index 100c6a8d0..f11ec821b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv21.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv21.kt @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class HummerResv21 : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt index 5d1be4c60..cf4f3e272 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY /** * v8.5.5 diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/LongMsg.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/LongMsg.kt index d46334d8d..31f6325d4 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/LongMsg.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/LongMsg.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class LongMsg : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Msg.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Msg.kt index ec9914d9f..02e5dff1c 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Msg.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Msg.kt @@ -13,8 +13,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class ImCommon : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgCommon.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgCommon.kt index c2fbf5276..414848532 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgCommon.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgCommon.kt @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY /** * msf.msgcomm.msg_comm diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt index a24b8b0ce..7aac78d1e 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -12,8 +12,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber import net.mamoe.mirai.internal.network.Packet -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class MsgSvc : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgTransmit.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgTransmit.kt index 5410cf75a..b4a26604b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgTransmit.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgTransmit.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class MsgTransmit : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MultiMsg.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MultiMsg.kt index 24c32811c..e83f6c4e2 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MultiMsg.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MultiMsg.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class MultiMsg : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OIDB.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OIDB.kt index 7992c4bda..54f114142 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OIDB.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OIDB.kt @@ -12,8 +12,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber import net.mamoe.mirai.internal.network.Packet -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class Oidb0x5d4 : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d6.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d6.kt index d6d9309d5..6d9246b52 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d6.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d6.kt @@ -13,9 +13,9 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.chat.CheckableStruct import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class Oidb0x6d6 : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d8.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d8.kt index ecbd996de..e48849d6c 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d8.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d8.kt @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class Oidb0x6d8 : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d9.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d9.kt index 283a6e441..dd8e7e751 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d9.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x6d9.kt @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class Oidb0x6d9 : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x769.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x769.kt index 7efcb52aa..f4682e54c 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x769.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0x769.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Oidb0x769 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0xeac.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0xeac.kt index fc20ac75e..d61265413 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0xeac.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/Oidb0xeac.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,10 +11,10 @@ package net.mamoe.mirai.internal.network.protocol.data.proto -import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber import net.mamoe.mirai.internal.utils.io.ProtoBuf -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class Oidb0xeac : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OnlinePush.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OnlinePush.kt index ff03ece3d..4cf391068 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OnlinePush.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/OnlinePush.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class MsgOnlinePush { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/PbReserve.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/PbReserve.kt index df36a37c6..aadf9c592 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/PbReserve.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/PbReserve.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class NotOnlineImage { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/StructMsg.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/StructMsg.kt index c9c8eaf8b..6e081aed3 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/StructMsg.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/StructMsg.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.proto import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class QPayReminderMsg : ProtoBuf { @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x210.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x210.kt index b02a1cb6f..fda156ebf 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x210.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x210.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -15,8 +15,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable internal class SubMsgType0x43 : ProtoBuf { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x211.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x211.kt index 7623c0fc0..ba0b37bf4 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x211.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/msgType0x211.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Mamoe Technologies and contributors. + * Copyright 2019-2021 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. @@ -15,8 +15,8 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoIntegerType import kotlinx.serialization.protobuf.ProtoNumber import kotlinx.serialization.protobuf.ProtoType -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.io.ProtoBuf +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY @Serializable diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt index 62afd5b85..58854e232 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt @@ -21,6 +21,8 @@ import net.mamoe.mirai.internal.network.handler.NetworkHandler import net.mamoe.mirai.internal.utils.io.encryptAndWrite import net.mamoe.mirai.internal.utils.io.writeHex import net.mamoe.mirai.internal.utils.io.writeIntLVPacket +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY +import net.mamoe.mirai.utils.KEY_16_ZEROS @kotlin.Suppress("unused") internal class OutgoingPacketWithRespType constructor( @@ -101,9 +103,6 @@ internal suspend inline fun OutgoingPacket.sendAndExpect( } -internal val KEY_16_ZEROS = ByteArray(16) -internal val EMPTY_BYTE_ARRAY = ByteArray(0) - @Suppress("DuplicatedCode") internal inline fun OutgoingPacketFactory.buildOutgoingUniPacket( client: QQAndroidClient, diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt index 408f907c2..e8a661de7 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/voice/PttStore.kt @@ -10,7 +10,6 @@ package net.mamoe.mirai.internal.network.protocol.packet.chat.voice import kotlinx.io.core.ByteReadPacket -import net.mamoe.mirai.internal.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.Packet import net.mamoe.mirai.internal.network.QQAndroidClient @@ -22,6 +21,7 @@ import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf import net.mamoe.mirai.internal.utils.toIpV4AddressString +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY import net.mamoe.mirai.utils.ExternalResource import net.mamoe.mirai.utils.encodeToString import net.mamoe.mirai.utils.toUHexString diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt index aaaab3cfc..0455198b8 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/list/FriendList.kt @@ -18,7 +18,6 @@ import net.mamoe.mirai.internal.network.QQAndroidClient import net.mamoe.mirai.internal.network.protocol.data.jce.* import net.mamoe.mirai.internal.network.protocol.data.proto.Vec0xd50 import net.mamoe.mirai.internal.network.protocol.data.proto.Vec0xd6b -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket @@ -26,6 +25,7 @@ import net.mamoe.mirai.internal.utils.io.serialization.jceRequestSBuffer import net.mamoe.mirai.internal.utils.io.serialization.readUniPacket import net.mamoe.mirai.internal.utils.io.serialization.toByteArray import net.mamoe.mirai.internal.utils.io.serialization.writeJceStruct +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY internal class FriendList { diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt index 2f052f100..cc822cb2e 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/wtlogin/WtLoginExt.kt @@ -14,7 +14,6 @@ import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.LoginExtraData import net.mamoe.mirai.internal.network.QQAndroidClient import net.mamoe.mirai.internal.network.WLoginSigInfo -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.network.protocol.packet.Tlv import net.mamoe.mirai.internal.network.protocol.packet.login.WtLogin import net.mamoe.mirai.internal.network.protocol.packet.t145 diff --git a/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt b/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt index d71865461..2c830dd1a 100644 --- a/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt +++ b/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt @@ -14,7 +14,6 @@ import kotlinx.coroutines.runBlocking import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.contact.Group import net.mamoe.mirai.contact.isOperator -import net.mamoe.mirai.internal.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.asQQAndroidBot import net.mamoe.mirai.internal.contact.groupCode import net.mamoe.mirai.internal.message.FileMessageImpl @@ -119,7 +118,7 @@ internal class RemoteFileImpl( get() { if (path == ROOT_PATH) return null val s = path.substringBeforeLast('/') - return RemoteFileImpl(contact, if (s.isEmpty()) ROOT_PATH else s) + return RemoteFileImpl(contact, s.ifEmpty { ROOT_PATH }) } /** diff --git a/mirai-core/src/commonTest/kotlin/network/sessionUtils.kt b/mirai-core/src/commonTest/kotlin/network/sessionUtils.kt index 342b9fc83..6c226f20f 100644 --- a/mirai-core/src/commonTest/kotlin/network/sessionUtils.kt +++ b/mirai-core/src/commonTest/kotlin/network/sessionUtils.kt @@ -12,10 +12,10 @@ package net.mamoe.mirai.internal.network import net.mamoe.mirai.event.events.BotOnlineEvent import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.net.protocol.LoginSessionAware -import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.internal.utils.crypto.ECDH import net.mamoe.mirai.internal.utils.io.serialization.loadAs import net.mamoe.mirai.internal.utils.io.serialization.toByteArray +import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY import net.mamoe.mirai.utils.debug import net.mamoe.mirai.utils.withUse import java.io.File