Commit 9c318601 authored by Him188's avatar Him188

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
#	mirai-core-qqandroid/src/jvmTest/kotlin/test/ProtoBufDataClassGenerator.kt
parents 35dca403 4d192d97
import kotlinx.serialization.SerialId
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.ProtoBuf
@Serializable
class Common : ProtoBuf {
@Serializable
class BindInfo(
@SerialId(1) val friUin: Long = 0L,
@SerialId(2) val friNick: String = "",
@SerialId(3) val time: Long = 0L,
@SerialId(4) val bindStatus: Int = 0
) : ProtoBuf
@Serializable
class MedalInfo(
@SerialId(1) val id: Int = 0,
@SerialId(2) val type: Int = 0,
@SerialId(4) val seq: Long = 0,
@SerialId(5) val name: String = "",
@SerialId(6) val newflag: Int = 0,
@SerialId(7) val time: Long = 0L,
@SerialId(8) val msgBindFri: Common.BindInfo? = null,
@SerialId(11) val desc: String = "",
@SerialId(31) val level: Int = 0,
@SerialId(36) val taskinfos: List<Common.MedalTaskInfo>? = null,
@SerialId(40) val point: Int = 0,
@SerialId(41) val pointLevel2: Int = 0,
@SerialId(42) val pointLevel3: Int = 0,
@SerialId(43) val seqLevel2: Long = 0,
@SerialId(44) val seqLevel3: Long = 0,
@SerialId(45) val timeLevel2: Long = 0L,
@SerialId(46) val timeLevel3: Long = 0L,
@SerialId(47) val descLevel2: String = "",
@SerialId(48) val descLevel3: String = "",
@SerialId(49) val endtime: Int = 0,
@SerialId(50) val detailUrl: String = "",
@SerialId(51) val detailUrl2: String = "",
@SerialId(52) val detailUrl3: String = "",
@SerialId(53) val taskDesc: String = "",
@SerialId(54) val taskDesc2: String = "",
@SerialId(55) val taskDesc3: String = "",
@SerialId(56) val levelCount: Int = 0,
@SerialId(57) val noProgress: Int = 0,
@SerialId(58) val resource: String = "",
@SerialId(59) val fromuinLevel: Int = 0,
@SerialId(60) val unread: Int = 0,
@SerialId(61) val unread2: Int = 0,
@SerialId(62) val unread3: Int = 0
) : ProtoBuf
@Serializable
class MedalTaskInfo(
@SerialId(1) val taskid: Int = 0,
@SerialId(32) val int32TaskValue: Int = 0,
@SerialId(33) val tarValue: Int = 0,
@SerialId(34) val tarValueLevel2: Int = 0,
@SerialId(35) val tarValueLevel3: Int = 0
) : ProtoBuf
}
package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.SerialId
import kotlinx.serialization.Serializable
import net.mamoe.mirai.qqandroid.io.ProtoBuf
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
@Serializable
class GroupLabel : ProtoBuf {
@Serializable
class Label(
@SerialId(1) val name: ByteArray = EMPTY_BYTE_ARRAY,
@SerialId(2) val enumType: Int /* enum */ = 1,
@SerialId(3) val textColor: GroupLabel.Color? = null,
@SerialId(4) val edgingColor: GroupLabel.Color? = null,
@SerialId(5) val labelAttr: Int = 0,
@SerialId(6) val labelType: Int = 0
) : ProtoBuf
@Serializable
class RspBody(
@SerialId(1) val error: ByteArray = EMPTY_BYTE_ARRAY,
@SerialId(2) val groupInfo: List<GroupLabel.GroupInfo>? = null
) : ProtoBuf
@Serializable
class SourceId(
@SerialId(1) val sourceId: Int = 0
) : ProtoBuf
@Serializable
class GroupInfo(
@SerialId(1) val int32Result: Int = 0,
@SerialId(2) val groupCode: Long = 0L,
@SerialId(3) val groupLabel: List<GroupLabel.Label>? = null
) : ProtoBuf
@Serializable
class Color(
@SerialId(1) val r: Int = 0,
@SerialId(2) val g: Int = 0,
@SerialId(3) val b: Int = 0
) : ProtoBuf
@Serializable
class ReqBody(
@SerialId(1) val sourceId: GroupLabel.SourceId? = null,
@SerialId(2) val uinInfo: GroupLabel.UinInfo? = null,
@SerialId(3) val numberLabel: Int = 5,
@SerialId(4) val groupCode: List<Long>? = null,
@SerialId(5) val labelStyle: Int = 0
) : ProtoBuf
@Serializable
class UinInfo(
@SerialId(1) val int64Longitude: Long = 0L,
@SerialId(2) val int64Latitude: Long = 0L
) : ProtoBuf
}
\ No newline at end of file
...@@ -123,7 +123,10 @@ internal object KnownPacketFactories { ...@@ -123,7 +123,10 @@ internal object KnownPacketFactories {
FriendList.GetTroopMemberList, FriendList.GetTroopMemberList,
ImgStore.GroupPicUp, ImgStore.GroupPicUp,
ImageUpPacket, ImageUpPacket,
LongConn.OffPicDown LongConn.OffPicDown,
TroopManagement.EditNametag,
TroopManagement.Mute,
TroopManagement.MuteAll
) )
object IncomingFactories : List<IncomingPacketFactory<*>> by mutableListOf( object IncomingFactories : List<IncomingPacketFactory<*>> by mutableListOf(
......
package net.mamoe.mirai.qqandroid.network.protocol.packet.chat
import kotlinx.io.core.ByteReadPacket
import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.login.LoginPacket
internal class TroopManagement {
internal object Mute : OutgoingPacketFactory<LoginPacket.LoginPacketResponse>("OidbSvc.0x570_8") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): LoginPacket.LoginPacketResponse {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
internal object MuteAll : OutgoingPacketFactory<LoginPacket.LoginPacketResponse>("OidbSvc.0x89a_0") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): LoginPacket.LoginPacketResponse {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
internal object EditNametag : OutgoingPacketFactory<LoginPacket.LoginPacketResponse>("OidbSvc.0x8fc_2") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): LoginPacket.LoginPacketResponse {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
/*
internal object Recall: OutgoingPacketFactory<LoginPacket.LoginPacketResponse>("wtlogin.login"){
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): LoginPacket.LoginPacketResponse {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
*/
}
\ No newline at end of file
...@@ -6,9 +6,7 @@ import java.io.File ...@@ -6,9 +6,7 @@ import java.io.File
fun main() { fun main() {
println( println(
File(""" File("""/Users/jiahua.liu/Desktop/QQAndroid-F/app/src/main/java/tencent/im/s2c/msgtype0x210/submsgtype0xc7/bussinfo/mutualmark""")
E:\Projects\QQAndroidFF\app\src\main\java\com\tencent\mobileqq\highway\protocol
""".trimIndent())
.generateUnarrangedClasses().toMutableList().arrangeClasses().joinToString("\n\n") .generateUnarrangedClasses().toMutableList().arrangeClasses().joinToString("\n\n")
) )
} }
......
...@@ -15,9 +15,12 @@ dependencies { ...@@ -15,9 +15,12 @@ dependencies {
implementation 'org.jsoup:jsoup:1.12.1' implementation 'org.jsoup:jsoup:1.12.1'
} }
mainClassName = "demo.gentleman.MainKt" run{
standardInput = System.in
mainClassName = "demo.gentleman.MainKt"
}
compileKotlin { compileKotlin {
kotlinOptions { kotlinOptions {
freeCompilerArgs = ["-XXLanguage:+InlineClasses"] freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment