Fix package

This commit is contained in:
Him188 2020-12-26 20:50:49 +08:00
parent 9eaccfca2a
commit ade169253b
84 changed files with 159 additions and 152 deletions

View File

@ -31,6 +31,7 @@ import net.mamoe.mirai.internal.network.protocol.packet.chat.*
import net.mamoe.mirai.internal.network.protocol.packet.chat.voice.PttStore
import net.mamoe.mirai.internal.network.protocol.packet.list.FriendList
import net.mamoe.mirai.internal.network.protocol.packet.login.StatSvc
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.action.Nudge
import net.mamoe.mirai.message.data.*
@ -39,7 +40,6 @@ import net.mamoe.mirai.message.data.Image.Key.FRIEND_IMAGE_ID_REGEX_2
import net.mamoe.mirai.message.data.Image.Key.GROUP_IMAGE_ID_REGEX
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.ExternalResource.Companion.toExternalResource
import net.mamoe.mirai.utils.serialization.toByteArray
import java.util.concurrent.atomic.AtomicBoolean
import kotlin.math.absoluteValue
import kotlin.random.Random

View File

@ -13,11 +13,11 @@ package net.mamoe.mirai.internal.message
import net.mamoe.mirai.internal.network.protocol.data.proto.HummerCommelem
import net.mamoe.mirai.internal.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.message.data.FlashImage
import net.mamoe.mirai.message.data.isFriendImage
import net.mamoe.mirai.message.data.isGroupImage
import net.mamoe.mirai.message.data.md5
import net.mamoe.mirai.utils.serialization.toByteArray
internal fun FlashImage.toJceData(): ImMsgBody.Elem {

View File

@ -24,10 +24,10 @@ import net.mamoe.mirai.contact.Group
import net.mamoe.mirai.internal.network.protocol.data.proto.*
import net.mamoe.mirai.internal.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.internal.utils.*
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.loadAs
import net.mamoe.mirai.utils.serialization.toByteArray
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -14,12 +14,12 @@ import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import net.mamoe.mirai.internal.network.protocol.data.proto.HummerCommelem
import net.mamoe.mirai.internal.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.message.code.internal.appendAsMiraiCode
import net.mamoe.mirai.message.data.Face
import net.mamoe.mirai.message.data.MarketFace
import net.mamoe.mirai.utils.MiraiExperimentalApi
import net.mamoe.mirai.utils.hexToBytes
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.utils.toByteArray
internal val FACE_BUF = "00 01 00 04 52 CC F5 D0".hexToBytes()

View File

@ -21,6 +21,7 @@ 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.Message
import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.message.data.MessageSource
@ -28,7 +29,6 @@ import net.mamoe.mirai.message.data.OnlineMessageSource
import net.mamoe.mirai.utils.encodeToBase64
import net.mamoe.mirai.utils.encodeToString
import net.mamoe.mirai.utils.mapToIntArray
import net.mamoe.mirai.utils.serialization.toByteArray
import java.util.concurrent.atomic.AtomicBoolean
internal interface MessageSourceInternal {

View File

@ -15,11 +15,11 @@ 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.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.mapToIntArray
import net.mamoe.mirai.utils.serialization.loadAs
import java.util.concurrent.atomic.AtomicBoolean

View File

@ -26,10 +26,10 @@ 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.chat.receive.OnlinePushPbPushGroupMsg.SendGroupMessageReceipt
import net.mamoe.mirai.internal.network.protocol.packet.chat.toLongUnsigned
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.message.data.MessageSource
import net.mamoe.mirai.message.data.OnlineMessageSource
import net.mamoe.mirai.utils.serialization.toByteArray
import java.util.concurrent.atomic.AtomicBoolean

View File

@ -27,10 +27,10 @@ import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.internal.utils.PlatformSocket
import net.mamoe.mirai.internal.utils.SocketException
import net.mamoe.mirai.internal.utils.addSuppressedMirai
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.internal.utils.toIpV4AddressString
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.toByteArray
import java.io.InputStream
import kotlin.math.roundToInt
import kotlin.time.ExperimentalTime

View File

@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.internal.network.Packet
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class BigDataChannel(

View File

@ -9,8 +9,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class DeviceItemDes(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class ModifyGroupCardReq(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class GroupMngReqJce(

View File

@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.contact.ClientKind
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal data class InstanceInfo(

View File

@ -11,8 +11,8 @@ 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.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class AddGroup(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
internal class OnlinePushPack {
@Serializable

View File

@ -12,8 +12,8 @@ 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.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Suppress("ArrayInDataClass")
@Serializable

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class RequestMSFForceOffline(

View File

@ -11,8 +11,8 @@ 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.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
private val EMPTY_MAP = mapOf<String, String>()

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class RequestPushForceOffline(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal data class SvcDevLoginInfo(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
// ANDROID PHONE QQ

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class SvcReqRegister(

View File

@ -12,8 +12,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class SvcRequestPushReadedNotify(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class SvcRspGetDevLoginInfo(

View File

@ -10,8 +10,8 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@Serializable
internal class GetTroopListReqV2Simplify(

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Cmd0x352 : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Cmd0x388 : ProtoBuf {

View File

@ -16,7 +16,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class GroupOpenSysMsg : ProtoBuf {
@Serializable

View File

@ -16,7 +16,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Oidb0x858 : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class Common : ProtoBuf {
@Serializable

View File

@ -14,7 +14,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Vec0xd50 : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class GroupLabel : ProtoBuf {

View File

@ -14,7 +14,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class BdhExtinfo : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class HummerCommelem : ProtoBuf {
@Serializable

View File

@ -13,7 +13,7 @@ package net.mamoe.mirai.internal.network.protocol.data.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class MarketFaceExtPb : ProtoBuf {

View File

@ -14,7 +14,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class HummerResv21 : ProtoBuf {

View File

@ -11,7 +11,7 @@ package net.mamoe.mirai.internal.network.protocol.data.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.utils.currentTimeSeconds
internal interface ImgReq : ProtoBuf

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class LongMsg : ProtoBuf {
@Serializable

View File

@ -14,8 +14,8 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
@Serializable
internal class ImCommon : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
/**
* msf.msgcomm.msg_comm

View File

@ -11,7 +11,7 @@ package net.mamoe.mirai.internal.network.protocol.data.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class MsgRevokeUserDef : ProtoBuf {
@Serializable

View File

@ -13,7 +13,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class MsgSvc : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class MsgTransmit : ProtoBuf {
@Serializable

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class MultiMsg : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Oidb0x8a0 : ProtoBuf {

View File

@ -14,7 +14,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class Oidb0x769 : ProtoBuf {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class MsgOnlinePush {

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class Generalflags : ProtoBuf {
@Serializable

View File

@ -11,7 +11,7 @@ package net.mamoe.mirai.internal.network.protocol.data.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class StatSvcGetOnline {
@Serializable

View File

@ -12,7 +12,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
internal class QPayReminderMsg : ProtoBuf {
@Serializable

View File

@ -11,7 +11,7 @@ package net.mamoe.mirai.internal.network.protocol.data.proto
import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import kotlin.math.absoluteValue
import kotlin.random.Random

View File

@ -16,7 +16,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable
internal class SubMsgType0x43 : ProtoBuf {

View File

@ -16,7 +16,7 @@ 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.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.ProtoBuf
@Serializable

View File

@ -27,13 +27,13 @@ import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.PacketLogger
import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.internal.utils._miraiContentToString
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.message.data.ForwardMessage
import net.mamoe.mirai.message.data.asMessageChain
import net.mamoe.mirai.utils.gzip
import net.mamoe.mirai.utils.md5
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.utils.serialization.writeProtoBuf
internal class MessageValidationData(
val data: ByteArray,

View File

@ -25,8 +25,8 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.Structmsg
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.internal.utils._miraiContentToString
import net.mamoe.mirai.utils.serialization.loadAs
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
internal class NewContact {

View File

@ -19,9 +19,9 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.OidbSso
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
import net.mamoe.mirai.utils.serialization.loadAs
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
internal object NudgePacket : OutgoingPacketFactory<NudgePacket.Response>("OidbSvc.0xed3") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {

View File

@ -20,10 +20,10 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.MsgSvc
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
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.toByteArray
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.utils.hexToBytes
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.utils.serialization.writeProtoBuf
internal class PbMessageSvc {
object PbMsgWithDraw : OutgoingPacketFactory<PbMsgWithDraw.Response>(

View File

@ -26,8 +26,8 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.*
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
import net.mamoe.mirai.internal.utils.io.serialization.*
import net.mamoe.mirai.utils.daysToSeconds
import net.mamoe.mirai.utils.serialization.*
import net.mamoe.mirai.data.GroupInfo as MiraiGroupInfo
@OptIn(LowLevelApi::class)

View File

@ -18,8 +18,8 @@ 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
import net.mamoe.mirai.internal.network.protocol.packet.chat.toLongUnsigned
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import kotlin.random.Random
import kotlin.random.nextInt

View File

@ -18,8 +18,8 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.GetImgUrlReq
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
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
internal class LongConn {

View File

@ -19,7 +19,7 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.MsgComm
import net.mamoe.mirai.internal.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
internal object MessageSvcPbDeleteMsg : OutgoingPacketFactory<Nothing?>("MessageSvc.PbDeleteMsg") {

View File

@ -46,12 +46,12 @@ import net.mamoe.mirai.internal.network.protocol.packet.chat.NewContact
import net.mamoe.mirai.internal.network.protocol.packet.chat.toLongUnsigned
import net.mamoe.mirai.internal.network.protocol.packet.list.FriendList
import net.mamoe.mirai.internal.utils.*
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.buildMessageChain
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.loadAs
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import kotlin.random.Random

View File

@ -32,10 +32,10 @@ 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
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.currentTimeSeconds
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.writeProtoBuf
import java.util.concurrent.atomic.AtomicReference
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

View File

@ -14,7 +14,7 @@ import net.mamoe.mirai.event.events.BotOfflineEvent
import net.mamoe.mirai.internal.QQAndroidBot
import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPushForceOffline
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.utils.serialization.readUniPacket
import net.mamoe.mirai.internal.utils.io.serialization.readUniPacket
/**

View File

@ -17,7 +17,7 @@ import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPushNotify
import net.mamoe.mirai.internal.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.utils.serialization.readUniPacket
import net.mamoe.mirai.internal.utils.io.serialization.readUniPacket
/**

View File

@ -33,9 +33,9 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.MsgOnlinePush
import net.mamoe.mirai.internal.network.protocol.data.proto.Oidb0x8fc
import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.internal.utils._miraiContentToString
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.loadAs
import net.mamoe.mirai.utils.serialization.readProtoBuf
/**
* 接受群消息

View File

@ -36,8 +36,8 @@ import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.internal.network.protocol.packet.buildResponseUniPacket
import net.mamoe.mirai.internal.utils._miraiContentToString
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.readProtoBuf
internal object OnlinePushPbPushTransMsg :

View File

@ -45,8 +45,9 @@ import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.internal.network.protocol.packet.buildResponseUniPacket
import net.mamoe.mirai.internal.utils.*
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.*
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.*
//0C 01 B1 89 BE 09 5E 3D 72 A6 00 01 73 68 FC 06 00 00 00 3C

View File

@ -18,9 +18,9 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.Cmd0x388
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
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.utils.encodeToString
import net.mamoe.mirai.utils.serialization.readProtoBuf
import net.mamoe.mirai.utils.serialization.writeProtoBuf
internal class PttStore {
object GroupPttUp : OutgoingPacketFactory<GroupPttUp.Response>("PttStore.GroupPttUp") {

View File

@ -19,10 +19,10 @@ 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
import net.mamoe.mirai.utils.serialization.jceRequestSBuffer
import net.mamoe.mirai.utils.serialization.readUniPacket
import net.mamoe.mirai.utils.serialization.toByteArray
import net.mamoe.mirai.utils.serialization.writeJceStruct
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
internal class FriendList {

View File

@ -19,9 +19,9 @@ import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPacket
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
import net.mamoe.mirai.utils.serialization.jceRequestSBuffer
import net.mamoe.mirai.utils.serialization.readUniPacket
import net.mamoe.mirai.utils.serialization.writeJceStruct
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.writeJceStruct
import net.mamoe.mirai.utils.toByteArray
internal class ProfileService {

View File

@ -22,8 +22,13 @@ import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPacket
import net.mamoe.mirai.internal.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.internal.network.protocol.packet.buildResponseUniPacket
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.jceRequestSBuffer
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.readUniPacket
import net.mamoe.mirai.internal.utils.io.serialization.writeJceStruct
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.serialization.*
import net.mamoe.mirai.internal.network.protocol.data.jce.PushReq as PushReqJceStruct

View File

@ -33,10 +33,10 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.StatSvcGetOnline
import net.mamoe.mirai.internal.network.protocol.packet.*
import net.mamoe.mirai.internal.utils.NetworkType
import net.mamoe.mirai.internal.utils._miraiContentToString
import net.mamoe.mirai.internal.utils.io.serialization.*
import net.mamoe.mirai.utils.currentTimeMillis
import net.mamoe.mirai.utils.encodeToString
import net.mamoe.mirai.utils.localIpAddress
import net.mamoe.mirai.utils.serialization.*
import net.mamoe.mirai.utils.toReadPacket
@Suppress("EnumEntryName", "unused")

View File

@ -7,6 +7,6 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils
package net.mamoe.mirai.internal.utils.io
internal interface JceStruct

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils
package net.mamoe.mirai.internal.utils.io
/**
* 仅有标示作用

View File

@ -9,7 +9,7 @@
@file:Suppress("DEPRECATION_ERROR")
package net.mamoe.mirai.utils.serialization
package net.mamoe.mirai.internal.utils.io.serialization
import kotlinx.serialization.*
import kotlinx.serialization.builtins.ByteArraySerializer
@ -26,8 +26,8 @@ import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.protobuf.ProtoBuf
import kotlinx.serialization.protobuf.ProtoIntegerType
import kotlinx.serialization.protobuf.ProtoType
import net.mamoe.mirai.utils.serialization.ProtoBufWithNullableSupport.Varint.encodeVarint
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.serialization.ProtoBufWithNullableSupport.Varint.encodeVarint
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
import java.nio.ByteOrder

View File

@ -9,7 +9,7 @@
@file:Suppress("MemberVisibilityCanBePrivate", "unused")
package net.mamoe.mirai.utils.serialization.tars
package net.mamoe.mirai.internal.utils.io.serialization.tars
import kotlinx.io.charsets.Charset
import kotlinx.io.charsets.Charsets
@ -17,9 +17,9 @@ import kotlinx.io.core.*
import kotlinx.serialization.*
import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.utils.serialization.tars.internal.TarsDecoder
import net.mamoe.mirai.utils.serialization.tars.internal.TarsInput
import net.mamoe.mirai.utils.serialization.tars.internal.TarsOld
import net.mamoe.mirai.internal.utils.io.serialization.tars.internal.TarsDecoder
import net.mamoe.mirai.internal.utils.io.serialization.tars.internal.TarsInput
import net.mamoe.mirai.internal.utils.io.serialization.tars.internal.TarsOld
/**
* The main entry point to work with Tars serialization.

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils.serialization.tars
package net.mamoe.mirai.internal.utils.io.serialization.tars
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialInfo

View File

@ -9,7 +9,7 @@
@file:Suppress("PrivatePropertyName")
package net.mamoe.mirai.utils.serialization.tars.internal
package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.InternalSerializationApi
@ -18,8 +18,9 @@ import kotlinx.serialization.encoding.AbstractDecoder
import kotlinx.serialization.encoding.CompositeDecoder
import kotlinx.serialization.internal.TaggedDecoder
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.utils.serialization.tars.Tars
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.serialization.tars.internal.*
@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)

View File

@ -7,11 +7,11 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils.serialization.tars.internal
package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
import kotlinx.io.charsets.Charset
import kotlinx.io.core.*
import net.mamoe.mirai.utils.serialization.tars.Tars
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars
/**

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils.serialization.tars.internal
package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
import kotlinx.io.charsets.Charset
import kotlinx.io.charsets.Charsets
@ -24,22 +24,22 @@ import kotlinx.serialization.internal.MapLikeSerializer
import kotlinx.serialization.internal.TaggedEncoder
import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.BYTE
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.DOUBLE
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.FLOAT
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.INT
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.LIST
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.LONG
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.MAP
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.SHORT
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.SIMPLE_LIST
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.STRING1
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.STRING4
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.STRUCT_BEGIN
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.STRUCT_END
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.Tars_MAX_STRING_LENGTH
import net.mamoe.mirai.utils.serialization.tars.Tars.Companion.ZERO_TYPE
import net.mamoe.mirai.utils.serialization.tars.TarsId
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.BYTE
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.DOUBLE
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.FLOAT
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.INT
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.LIST
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.LONG
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.MAP
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.SHORT
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.SIMPLE_LIST
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.STRING1
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.STRING4
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.STRUCT_BEGIN
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.STRUCT_END
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.Tars_MAX_STRING_LENGTH
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars.Companion.ZERO_TYPE
import net.mamoe.mirai.internal.utils.io.serialization.tars.TarsId
@OptIn(ExperimentalSerializationApi::class)
internal inline fun <reified A : Annotation> SerialDescriptor.findAnnotation(elementIndex: Int): A? {

View File

@ -7,12 +7,12 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.utils.serialization.tars.internal
package net.mamoe.mirai.internal.utils.io.serialization.tars.internal
import kotlinx.io.core.Output
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.descriptors.SerialDescriptor
import net.mamoe.mirai.utils.serialization.tars.Tars
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars
internal abstract class TarsTag {

View File

@ -10,7 +10,7 @@
@file:JvmName("SerializationUtils")
@file:JvmMultifileClass
package net.mamoe.mirai.utils.serialization
package net.mamoe.mirai.internal.utils.io.serialization
import kotlinx.io.core.*
import kotlinx.serialization.DeserializationStrategy
@ -19,11 +19,11 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import net.mamoe.mirai.internal.network.protocol.data.jce.RequestDataVersion2
import net.mamoe.mirai.internal.network.protocol.data.jce.RequestDataVersion3
import net.mamoe.mirai.internal.network.protocol.data.jce.RequestPacket
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.ProtoBuf
import net.mamoe.mirai.internal.utils.io.JceStruct
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.tars.Tars
import net.mamoe.mirai.utils.read
import net.mamoe.mirai.utils.readPacketExact
import net.mamoe.mirai.utils.serialization.tars.Tars
internal fun <T : JceStruct> ByteArray.loadWithUniPacket(
deserializer: DeserializationStrategy<T>,