Merge branch 'dev'

This commit is contained in:
Him188
2020-08-19 10:44:41 +08:00
239 changed files with 14952 additions and 9613 deletions

View File

@@ -28,13 +28,10 @@ jobs:
run: ./gradlew build # if test's failed, don't publish run: ./gradlew build # if test's failed, don't publish
- name: Check keys - name: Check keys
run: ./gradlew :mirai-core:ensureBintrayAvailable :mirai-core-qqandroid:ensureBintrayAvailable -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }} run: ./gradlew :mirai-core:ensureBintrayAvailable :mirai-core-qqandroid:ensureBintrayAvailable -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-core:bintrayUpload - name: Gradle :mirai-core:publish
run: ./gradlew :mirai-core:bintrayUpload -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }} run: ./gradlew :mirai-core:publish -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-core-qqandroid:bintrayUpload - name: Gradle :mirai-core-qqandroid:publish
run: ./gradlew :mirai-core-qqandroid:bintrayUpload -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }} run: ./gradlew :mirai-core-qqandroid:publish -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
- name: Gradle :mirai-serialization:bintrayUpload
run: ./gradlew :mirai-serialization:bintrayUpload -Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }} -Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
# - name: Upload artifact # - name: Upload artifact
# uses: actions/upload-artifact@v1.0.0 # uses: actions/upload-artifact@v1.0.0

BIN
.idea/icon.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

View File

@@ -1,5 +1,51 @@
# Version 1.x # Version 1.x
## `1.2.0` 2020/8/19
### 新特性
- 初步语音支持: `Group.uploadVoice`, 支持 silk 或 arm 格式.
**注意**: 现阶段语音实现仅为临时方案, 在将来 (`2.0.0`) 一定会变动. 使用时请评估可能带来的不兼容性.
- 新增将日志转换为 log4j, JDK Logger, SLF4J 等框架的方法: `LoggerAdapters` (#498 by [@Karlatemp](https://github.com/Karlatemp))
- 支持解析好友输入状态: `FriendInputStatusChangedEvent` (by [@sandtechnology](https://github.com/sandtechnology))
- 支持解析好友昵称改变事件: `FriendNickChangedEvent` (#507 by [@Karlatemp](https://github.com/Karlatemp))
- `nextEvent``nextEventOrNull` 添加 `filter`
- 将 mirai 码相关内容从 mirai-serialization 集成到 mirai-core
- `GroupMessageEvent` 现在实现接口 `GroupEvent`
- `FriendMessageEvent` 现在实现接口 `FriendEvent` (#444)
### 依赖更新
- 更新 Kotlin 版本到 [`1.4.0`](https://blog.jetbrains.com/zh-hans/kotlin/2020/08/kotlin-1-4-released-with-a-focus-on-quality-and-performance-zh/)
- 更新 kotlinx-coroutines-core 到 `1.3.9`
- 使用者也需要更新到 `1.4.0`, 至少更新编译器 (Maven 和 Gradle 插件)
- **更新 kotlinx-serialization 到 `1.0.0-RC`**: kotlinx-serialization 在此版本做了较大的不兼容改动.
### API 弃用
- `String.toMessage`: 为避免和 mirai code 产生混乱.
- `URL.toExternalImage`
- `Input.toExternalImage`
### 优化和修复
- 显式 API
- mirai 的所有公开 API 均已经显式加上 `public` 修饰符, 遵循 [Koltin Explicit API mode](https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors) 规范. 如:
```kotlin
data class BotOnlineEvent internal constructor(
override val bot: Bot
) : BotActiveEvent, AbstractEvent()
```
- *调整了一些不应该公开的 API 为 `internal`, 这些调整在绝大多数情况下不影响现有代码*
- 修复群权限判断失败的问题 (#389)
- 修复 `syncFromEvent` 文档错误 (#427)
- 新增 `BotConfiguration.loadDeviceInfoJson(String)` (#450)
- 修复成员进群后第一次发言触发改名事件的问题 (#475 by [@cxy654849388](https://github.com/cxy654849388)
- 修复 `group.quit` 未正确执行的问题 (#472, #477 by [@Mr4s](https://github.com/Mrs4s)
- 修复初始化时 syncCookie 同步问题
- 修复 Network Protocol: java.lang.IllegalStateException: returnCode = -10008 (#470)
- 修复 `Member.isMuted`
- 修复 `Method.registerEvent` 相关问题 (#495 by @sandtechnology, #499 by @Karlatemp)
- 修复 Android 手表协议无法监听撤回事件的问题 (#448)
- 改进好友消息同步过程
## `1.1.3` 2020/7/17 ## `1.1.3` 2020/7/17
- 修复 ListenerHost Java 兼容性问题 (#443, #446 by [@Karlatemp](https://github.com/Karlatemp)) - 修复 ListenerHost Java 兼容性问题 (#443, #446 by [@Karlatemp](https://github.com/Karlatemp))

View File

@@ -19,7 +19,7 @@ mirai 欢迎一切形式的代码贡献。你可以通过以下几种途径向 m
### 注意事项 ### 注意事项
- 尽量不要引用新的库 - 尽量不要引用新的库
- 遵守 Kotlin 官方代码规范(提交前使用 IDE 格式化代码 (commit 时勾选 'Reformat code') - 遵守 Kotlin 官方代码规范(提交前使用 IDE 格式化代码 (commit 时勾选 'Reformat code')
- 不要手动拆解数据包. 请一定使用 `kotlinx.serialization` 拆解 ProtoBuf, 使用 [`jcekt`](https://github.com/him188/jcekt) 拆解 Tars 数据包, 使用 `kotlinx.serialization` 拆解 Json 数据. - 不要手动拆解数据包. 请一定使用 `kotlinx.serialization` 拆解 ProtoBuf, 使用 `net.mamoe.mirai.qqandroid.utils.io.serialization.Tars` 拆解 Tars 数据包, 使用 `kotlinx.serialization` 拆解 Json 数据.
## 社区 ## 社区

View File

@@ -9,15 +9,17 @@ buildscript {
mavenLocal() mavenLocal()
// maven(url = "https://mirrors.huaweicloud.com/repository/maven") // maven(url = "https://mirrors.huaweicloud.com/repository/maven")
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap") maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
maven(url = "https://kotlin.bintray.com/kotlinx")
jcenter() jcenter()
google() google()
mavenCentral()
} }
dependencies { dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:5.2.0") classpath("com.github.jengelman.gradle.plugins:shadow:5.2.0")
classpath("com.android.tools.build:gradle:${Versions.Android.androidGradlePlugin}") classpath("com.android.tools.build:gradle:${Versions.Android.androidGradlePlugin}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Kotlin.stdlib}") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Kotlin.compiler}")
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.Kotlin.stdlib}") classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.Kotlin.compiler}")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.Kotlin.atomicFU}") classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.Kotlin.atomicFU}")
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:${Versions.Kotlin.binaryValidator}") classpath("org.jetbrains.kotlinx:binary-compatibility-validator:${Versions.Kotlin.binaryValidator}")
} }
@@ -25,6 +27,7 @@ buildscript {
plugins { plugins {
id("org.jetbrains.dokka") version Versions.Kotlin.dokka apply false id("org.jetbrains.dokka") version Versions.Kotlin.dokka apply false
id("net.mamoe.kotlin-jvm-blocking-bridge") version Versions.blockingBridge apply false
// id("com.jfrog.bintray") version Versions.Publishing.bintray apply false // id("com.jfrog.bintray") version Versions.Publishing.bintray apply false
} }
@@ -60,8 +63,10 @@ allprojects {
mavenLocal() mavenLocal()
// maven(url = "https://mirrors.huaweicloud.com/repository/maven") // maven(url = "https://mirrors.huaweicloud.com/repository/maven")
maven(url = "https://dl.bintray.com/kotlin/kotlin-eap") maven(url = "https://dl.bintray.com/kotlin/kotlin-eap")
maven(url = "https://kotlin.bintray.com/kotlinx")
jcenter() jcenter()
google() google()
mavenCentral()
} }
} }

View File

@@ -9,15 +9,16 @@
object Versions { object Versions {
object Mirai { object Mirai {
const val version = "1.1.3" const val version = "1.2.0"
} }
object Kotlin { object Kotlin {
const val stdlib = "1.3.72" const val compiler = "1.4.0"
const val coroutines = "1.3.7" const val stdlib = "1.4.0"
const val atomicFU = "0.14.2" const val coroutines = "1.3.9"
const val serialization = "0.20.0" const val atomicFU = "0.14.4"
const val ktor = "1.3.2" const val serialization = "1.0.0-RC"
const val ktor = "1.3.2-1.4.0-rc"
const val binaryValidator = "0.2.3" const val binaryValidator = "0.2.3"
const val io = "0.1.16" const val io = "0.1.16"
@@ -25,7 +26,7 @@ object Versions {
const val dokka = "0.10.1" const val dokka = "0.10.1"
} }
const val jcekt = "1.0.0" val blockingBridge = "1.0.2"
object Android { object Android {
const val androidGradlePlugin = "3.5.3" const val androidGradlePlugin = "3.5.3"
@@ -35,10 +36,14 @@ object Versions {
const val bintray = "1.8.5" const val bintray = "1.8.5"
} }
object Logging {
const val slf4j = "1.7.30"
const val log4j = "2.13.3"
}
} }
@Suppress("unused") @Suppress("unused")
fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version" fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
@Suppress("unused") @Suppress("unused")
fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version" fun ktor(id: String, version: String = Versions.Kotlin.ktor) = "io.ktor:ktor-$id:$version"

View File

@@ -21,7 +21,7 @@ kotlin {
main { main {
dependencies { dependencies {
api(kotlin("stdlib")) api(kotlin("stdlib", Versions.Kotlin.stdlib))
runtimeOnly(project(":mirai-core-qqandroid")) runtimeOnly(project(":mirai-core-qqandroid"))
compileOnly("net.mamoe:mirai-core-qqandroid:0.38.0") compileOnly("net.mamoe:mirai-core-qqandroid:0.38.0")
} }
@@ -29,7 +29,7 @@ kotlin {
test { test {
dependencies { dependencies {
api(kotlin("stdlib")) api(kotlin("stdlib", Versions.Kotlin.stdlib))
api(kotlin("test")) api(kotlin("test"))
api(kotlin("test-junit")) api(kotlin("test-junit"))
runtimeOnly(project(":mirai-core-qqandroid")) runtimeOnly(project(":mirai-core-qqandroid"))

View File

@@ -121,15 +121,15 @@ Mirai 通过某种方式同时生成了桥梁方法 `public void sendMessage(Mes
`1.0.0` 及更新版本, mirai-core 通过 gradle 依赖的 `api` 方式暴露了如下依赖库: `1.0.0` 及更新版本, mirai-core 通过 gradle 依赖的 `api` 方式暴露了如下依赖库:
- `kotlin-stdlib`: Kotlin 标准库, 版本至少为 1.3.72 - `kotlin-stdlib`: Kotlin 标准库, 版本 1.4.0
- `kotlin-reflect`: Kotlin 反射, 版本至少为 1.3.72 - `kotlin-reflect`: Kotlin 反射, 版本 1.4.0
- `kotlinx-coroutines-core`: Kotlin 协程, 版本至少为 1.3.7 - `kotlinx-coroutines-core`: Kotlin 协程, 版本 1.3.9
- `kotlinx-serialization-runtime`: Kotlin 序列化运行时, 和 JSON 序列化, 版本至少为 0.20.0 - `kotlinx-serialization-core`: Kotlin 序列化运行时, 和 JSON 序列化, 版本 1.0.0-RC (此库不稳定, 请不要用新版本覆盖)
- `kotlinx-serialization-protobuf`: Kotlin ProtocolBuffers 序列化, 版本至少为 0.20.0 - `kotlinx-serialization-protobuf`: Kotlin ProtocolBuffers 序列化, 版本 1.0.0-RC (此库不稳定, 请不要用新版本覆盖)
- `kotlinx-io`: Kotlin IO, 版本至少为 0.1.16 (此库非常不稳定, 不建议使用它) - `kotlinx-io`: Kotlin IO, 版本至少为 0.1.16 (此库非常不稳定, 不建议使用它)
- `kotlinx-coroutines-io`: Kotlin 异步 IO, 版本至少为 0.1.16 (此库非常不稳定, 不建议使用它) - `kotlinx-coroutines-io`: Kotlin 异步 IO, 版本至少为 0.1.16 (此库非常不稳定, 不建议使用它)
- `kotlinx-atomicfu`: Kotlin 原子操作, 版本至少为 0.14.2 - `kotlinx-atomicfu`: Kotlin 原子操作, 版本至少为 0.14.4
- `ktor-client-core`, `ktor-network`, `ktor-client-cio`: Ktor HTTP, 版本至少为 1.3.2 - `ktor-client-core`, `ktor-network`, `ktor-client-cio`: Ktor HTTP, 版本至少为 1.3.2-1.4.0-rc
在 JVM, mirai 使用 `"org.bouncycastle:bcprov-jdk15on:1.64"` 进行密匙计算. 在 JVM, mirai 使用 `"org.bouncycastle:bcprov-jdk15on:1.64"` 进行密匙计算.

View File

@@ -4,4 +4,8 @@ kotlin.code.style=official
kotlin.incremental.multiplatform=true kotlin.incremental.multiplatform=true
kotlin.parallel.tasks.in.project=true kotlin.parallel.tasks.in.project=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8
org.gradle.parallel=true org.gradle.parallel=true
#kotlin.mpp.enableGranularSourceSetsMetadata=true
systemProp.org.gradle.internal.publish.checksums.insecure=true

12
gradle/bintray.gradle Normal file
View File

@@ -0,0 +1,12 @@
publishing {
repositories {
maven {
url = "https://api.bintray.com/maven/mamoe/mirai/mirai-core/;publish=0"
credentials {
username = upload.Bintray.getUser(project)
password = upload.Bintray.getKey(project)
}
}
}
}

View File

@@ -1,87 +1,42 @@
import upload.Bintray
// 部分源码来自 kotlinx.coroutines // 部分源码来自 kotlinx.coroutines
// Source code from kotlinx.coroutines // Source code from kotlinx.coroutines
task ensureBintrayAvailable() { tasks.register("ensureBintrayAvailable") {
doLast { doLast {
if (!Bintray.isBintrayAvailable(project)) { if (!upload.Bintray.isBintrayAvailable(project)) {
throw new IllegalStateException("bintray isn't available. ") throw new IllegalStateException("bintray isn't available. ")
} }
} }
} }
if (!Bintray.isBintrayAvailable(project)) { def vcs = "https://github.com/mamoe/mirai"
println("bintray isn't available. NO PUBLICATIONS WILL BE SET")
return
}
def miraiGitHubUrl = "https://github.com/mamoe/mirai" def pomConfig = {
licenses {
bintray { license {
user = Bintray.getUser(project) name "AGPLv3 with Mamoe Exceptions"
key = Bintray.getKey(project) url "https://github.com/mamoe/mirai/blob/master/LICENSE"
distribution "repo"
pkg {
repo = 'mirai'
name = "mirai-core"
licenses = ['AGPL']
vcsUrl = miraiGitHubUrl
websiteUrl = miraiGitHubUrl
githubRepo = miraiGitHubUrl
issueTrackerUrl = "$miraiGitHubUrl/issues"
/* version {
name = project.version
}*/
}
}
afterEvaluate {
project.publishing.publications.forEach { publication ->
publication.pom.withXml {
def root = asNode()
//root.appendNode('groupId', project.group)
//root.appendNode('artifactId', project.name)
//root.appendNode('version', project.version)
root.appendNode('name', project.name)
root.appendNode('description', project.description)
root.appendNode('url', miraiGitHubUrl)
root.children().last() + {
licenses {
license {
name "AGPL-V3"
url "https://www.gnu.org/licenses/agpl-3.0.txt"
distribution "repo"
}
}
developers {
developer {
id "mamoe"
name "Mamoe Technologies"
email "support@mamoe.net"
}
}
scm {
url miraiGitHubUrl
}
}
} }
} }
developers {
developer {
id "mamoe"
name "Mamoe Technologies"
email "support@mamoe.net"
}
}
scm {
url vcs
}
} }
bintrayUpload.doFirst { project.ext.configureMavenCentralMetadata = { pom ->
publications = project.publishing.publications def root = asNode()
} root.appendNode('name', project.name)
root.appendNode('description', project.description)
bintrayUpload.dependsOn { root.appendNode('url', vcs)
def list = new LinkedList<Task>() root.children().last() + pomConfig
list.add(tasks.getByName("build"))
list.addAll(tasks.findAll { task -> task.name.contains('Jar') })
list.addAll(tasks.findAll { task -> task.name.startsWith('generateMetadataFileFor') })
list.addAll(tasks.findAll { task -> task.name.startsWith('generatePomFileFor') })
list
} }
try { try {
@@ -90,40 +45,117 @@ try {
task javadocJar(type: Jar) { task javadocJar(type: Jar) {
archiveClassifier = 'javadoc' archiveClassifier = 'javadoc'
} }
} catch (Exception ignored) { } catch (Exception ignored) {
} }
publishing {
publications.all { try {
// add empty javadocs (no need for MPP root publication which publishes only pom file) task stubJavadoc(type: Jar) {
if (it.name != 'kotlinMultiplatform') { archiveClassifier = 'javadoc'
it.artifact(javadocJar) }
}catch (Exception ignored) {
}
/**
* Publish the platform JAR and POM so that consumers who depend on this module and can't read Gradle module
* metadata can still get the platform artifact and transitive dependencies from the POM
* (see details in https://youtrack.jetbrains.com/issue/KT-39184#focus=streamItem-27-4115233.0-0)
*/
project.ext.publishPlatformArtifactsInRootModule = { platformPublication ->
afterEvaluate {
def platformPomBuilder = null
platformPublication.pom.withXml { platformPomBuilder = asString() }
publishing.publications.kotlinMultiplatform {
platformPublication.artifacts.forEach {
artifact(it)
}
pom.withXml {
def pomStringBuilder = asString()
pomStringBuilder.setLength(0)
// The platform POM needs its artifact ID replaced with the artifact ID of the root module:
def platformPomString = platformPomBuilder.toString()
platformPomString.eachLine { line ->
if (!line.contains("<!--")) { // Remove the Gradle module metadata marker as it will be added anew
pomStringBuilder.append(line.replace(platformPublication.artifactId, artifactId))
pomStringBuilder.append("\n")
}
}
}
} }
// Rename MPP artifacts for backward compatibility tasks.matching { it.name == "generatePomFileForKotlinMultiplatformPublication" }.configureEach {
def type = it.name dependsOn(tasks["generatePomFileFor${platformPublication.name.capitalize()}Publication"])
switch (type) {
case 'kotlinMultiplatform':
it.artifactId = "$project.name-native"
break
case 'metadata':
it.artifactId = "$project.name-common"
break
case 'jvm':
it.artifactId = "$project.name"
break
case 'js':
case 'native':
it.artifactId = "$project.name-$type"
break
}
// disable metadata everywhere, but in native modules
if (type == 'maven' || type == 'metadata' || type == 'jvm' || type == 'js') {
moduleDescriptorGenerator = null
} }
} }
} }
// bintrayUpload.dependsOn publishToMavenLocal def isKotlin137x = false
afterEvaluate {
publishing {
def variantName = "${project.name}"
// Rename artifacts for backward compatibility
publications.all {
def type = it.name
logger.info("Configuring $type")
switch (type) {
case 'kotlinMultiplatform':
if (isKotlin137x) {
it.artifactId = "$variantName-native"
it.artifact sourcesJar
} else {
// With Kotlin 1.4.0, the root module ID has no suffix, but for compatibility with
// the consumers who can't read Gradle module metadata, we publish the JVM artifacts in it
it.artifactId = variantName
publishPlatformArtifactsInRootModule(publications["jvm"])
}
break
case 'metadata':
it.artifactId = isKotlin137x ? "$variantName-common" : "$variantName-metadata"
break
case 'jvm':
it.artifactId = isKotlin137x ? "$variantName" : "$variantName-jvm"
break
case 'js':
it.artifactId = "$variantName-$type"
break
}
logger.info("Artifact id = ${it.artifactId}")
pom.withXml(configureMavenCentralMetadata)
// The 'root' module publishes the JVM module's Javadoc JAR as per publishPlatformArtifactsInRootModule, and
if (name != "kotlinMultiplatform")
artifact stubJavadoc
}
if (isKotlin137x) {
disableMetadataPublication()
}
}
}
if (upload.Bintray.isBintrayAvailable(project)) {
apply from: rootProject.file("gradle/bintray.gradle")
}
/*
task bintrayUpload(dependsOn: publish)
// This is required for K/N publishing
bintrayUpload.dependsOn publishToMavenLocal
bintrayUpload.dependsOn generatePomFileForKotlinMultiplatformPublication
*/

129
gradle/publishOld.gradle Normal file
View File

@@ -0,0 +1,129 @@
import upload.Bintray
// 部分源码来自 kotlinx.coroutines
// Source code from kotlinx.coroutines
task ensureBintrayAvailable() {
doLast {
if (!Bintray.isBintrayAvailable(project)) {
throw new IllegalStateException("bintray isn't available. ")
}
}
}
if (!Bintray.isBintrayAvailable(project)) {
println("bintray isn't available. NO PUBLICATIONS WILL BE SET")
return
}
def miraiGitHubUrl = "https://github.com/mamoe/mirai"
bintray {
user = Bintray.getUser(project)
key = Bintray.getKey(project)
pkg {
repo = 'mirai'
name = "mirai-core"
licenses = ['AGPL']
vcsUrl = miraiGitHubUrl
websiteUrl = miraiGitHubUrl
githubRepo = miraiGitHubUrl
issueTrackerUrl = "$miraiGitHubUrl/issues"
/* version {
name = project.version
}*/
}
}
afterEvaluate {
project.publishing.publications.forEach { publication ->
publication.pom.withXml {
def root = asNode()
//root.appendNode('groupId', project.group)
//root.appendNode('artifactId', project.name)
//root.appendNode('version', project.version)
root.appendNode('name', project.name)
root.appendNode('description', project.description)
root.appendNode('url', miraiGitHubUrl)
root.children().last() + {
licenses {
license {
name "AGPL-V3"
url "https://www.gnu.org/licenses/agpl-3.0.txt"
distribution "repo"
}
}
developers {
developer {
id "mamoe"
name "Mamoe Technologies"
email "support@mamoe.net"
}
}
scm {
url miraiGitHubUrl
}
}
}
}
}
bintrayUpload.doFirst {
publications = project.publishing.publications
}
bintrayUpload.dependsOn {
def list = new LinkedList<Task>()
list.add(tasks.getByName("build"))
list.addAll(tasks.findAll { task -> task.name.contains('Jar') })
list.addAll(tasks.findAll { task -> task.name.startsWith('generateMetadataFileFor') })
list.addAll(tasks.findAll { task -> task.name.startsWith('generatePomFileFor') })
list
}
try {
// empty xxx-javadoc.jar
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
}
} catch (Exception ignored) {
}
publishing {
publications.all {
// add empty javadocs (no need for MPP root publication which publishes only pom file)
if (it.name != 'kotlinMultiplatform') {
it.artifact(javadocJar)
}
// Rename MPP artifacts for backward compatibility
def type = it.name
switch (type) {
case 'kotlinMultiplatform':
it.artifactId = "$project.name-native"
break
case 'metadata':
it.artifactId = "$project.name-common"
break
case 'jvm':
it.artifactId = "$project.name"
break
case 'js':
case 'native':
it.artifactId = "$project.name-$type"
break
}
// disable metadata everywhere, but in native modules
if (type == 'maven' || type == 'metadata' || type == 'jvm' || type == 'js') {
moduleDescriptorGenerator = null
}
}
}
// bintrayUpload.dependsOn publishToMavenLocal

View File

@@ -21,14 +21,14 @@ kotlin {
main { main {
dependencies { dependencies {
api(kotlin("stdlib")) api(kotlin("stdlib", Versions.Kotlin.stdlib))
api(project(":mirai-core-qqandroid")) api(project(":mirai-core-qqandroid"))
} }
} }
test { test {
dependencies { dependencies {
api(kotlin("stdlib")) api(kotlin("stdlib", Versions.Kotlin.stdlib))
api(kotlin("test")) api(kotlin("test"))
api(kotlin("test-junit")) api(kotlin("test-junit"))
api(project(":mirai-core-qqandroid")) api(project(":mirai-core-qqandroid"))

View File

@@ -19,22 +19,4 @@ dependencies {
implementation(project(":mirai-serialization")) implementation(project(":mirai-serialization"))
testImplementation(group = "junit", name = "junit", version = "4.12") testImplementation(group = "junit", name = "junit", version = "4.12")
implementation(kotlin("stdlib", null))
implementation(kotlin("serialization", null))
implementation(kotlin("reflect", null))
implementation(kotlinx("serialization-runtime-common", Versions.Kotlin.serialization))
implementation(kotlinx("serialization-protobuf-common", Versions.Kotlin.serialization))
implementation(kotlinx("io", Versions.Kotlin.io))
implementation(kotlinx("coroutines-io", Versions.Kotlin.coroutinesIo))
implementation(kotlinx("coroutines-core-common", Versions.Kotlin.coroutines))
implementation("org.jetbrains.kotlinx:atomicfu-common:${Versions.Kotlin.atomicFU}")
implementation(ktor("client-cio", Versions.Kotlin.ktor))
implementation(ktor("client-core", Versions.Kotlin.ktor))
implementation(ktor("network", Versions.Kotlin.ktor))
} }

View File

@@ -8,33 +8,33 @@
package net.mamoe.mirai.javatest; package net.mamoe.mirai.javatest;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext; import kotlin.coroutines.EmptyCoroutineContext;
import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.CoroutineScopeKt; import kotlinx.coroutines.CoroutineScopeKt;
import net.mamoe.mirai.event.*; import net.mamoe.mirai.event.*;
import org.jetbrains.annotations.NotNull;
import org.junit.Test; import org.junit.Test;
import java.util.concurrent.atomic.AtomicBoolean;
public class SimpleListenerHostTest { public class SimpleListenerHostTest {
@Test @Test
public void test() { public void testJavaSimpleListenerHostWork() {
AtomicBoolean called = new AtomicBoolean();
final SimpleListenerHost host = new SimpleListenerHost() { final SimpleListenerHost host = new SimpleListenerHost() {
@EventHandler @EventHandler
public void testListen( public void testListen(
AbstractEvent event AbstractEvent event
) { ) {
System.out.println(event); System.out.println(event);
} called.set(true);
@Override
public void handleException(@NotNull CoroutineContext context, @NotNull Throwable exception) {
exception.printStackTrace();
} }
}; };
CoroutineScope scope = CoroutineScopeKt.CoroutineScope(EmptyCoroutineContext.INSTANCE); CoroutineScope scope = CoroutineScopeKt.CoroutineScope(EmptyCoroutineContext.INSTANCE);
Events.registerEvents(scope, host); Events.registerEvents(scope, host);
EventKt.broadcast(new AbstractEvent() { EventKt.broadcast(new AbstractEvent() {
}); });
if (!called.get()) {
throw new AssertionError("JavaTest: SimpleListenerHost Failed.");
}
} }
} }

View File

@@ -4,6 +4,7 @@ plugins {
kotlin("multiplatform") kotlin("multiplatform")
id("kotlinx-atomicfu") id("kotlinx-atomicfu")
kotlin("plugin.serialization") kotlin("plugin.serialization")
id("net.mamoe.kotlin-jvm-blocking-bridge")
`maven-publish` `maven-publish`
id("com.jfrog.bintray") version Versions.Publishing.bintray id("com.jfrog.bintray") version Versions.Publishing.bintray
} }
@@ -36,7 +37,7 @@ kotlin {
jvm("jvm") { jvm("jvm") {
} }
sourceSets { sourceSets.apply {
all { all {
languageSettings.enableLanguageFeature("InlineClasses") languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.Experimental") languageSettings.useExperimentalAnnotation("kotlin.Experimental")
@@ -47,6 +48,9 @@ kotlin {
languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference") languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference")
languageSettings.useExperimentalAnnotation("kotlin.time.ExperimentalTime") languageSettings.useExperimentalAnnotation("kotlin.time.ExperimentalTime")
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.UnstableExternalImage")
languageSettings.progressiveMode = true languageSettings.progressiveMode = true
dependencies { dependencies {
@@ -56,13 +60,14 @@ kotlin {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
api(kotlin("stdlib", Versions.Kotlin.stdlib)) api(kotlinx("serialization-core", Versions.Kotlin.serialization))
api(kotlinx("serialization-runtime-common", Versions.Kotlin.serialization)) api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
api(kotlinx("serialization-protobuf-common", Versions.Kotlin.serialization)) implementation(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
api("moe.him188:jcekt-common:${Versions.jcekt}")
api("org.jetbrains.kotlinx:atomicfu:${Versions.Kotlin.atomicFU}") api("org.jetbrains.kotlinx:atomicfu:${Versions.Kotlin.atomicFU}")
api(kotlinx("io", Versions.Kotlin.io)) implementation(kotlinx("io", Versions.Kotlin.io)) {
api(kotlinx("coroutines-io", Versions.Kotlin.coroutinesIo)) exclude("org.jetbrains.kotlin", "kotlin-stdlib")
}
implementation(kotlinx("coroutines-io", Versions.Kotlin.coroutinesIo))
} }
} }
@@ -77,14 +82,13 @@ kotlin {
if (isAndroidSDKAvailable) { if (isAndroidSDKAvailable) {
val androidMain by getting { val androidMain by getting {
dependencies { dependencies {
api(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
} }
} }
val androidTest by getting { val androidTest by getting {
dependencies { dependencies {
implementation(kotlin("test", Versions.Kotlin.stdlib)) implementation(kotlin("test", Versions.Kotlin.compiler))
implementation(kotlin("test-junit", Versions.Kotlin.stdlib)) implementation(kotlin("test-junit", Versions.Kotlin.compiler))
implementation(kotlin("test-annotations-common")) implementation(kotlin("test-annotations-common"))
implementation(kotlin("test-common")) implementation(kotlin("test-common"))
} }
@@ -94,19 +98,19 @@ kotlin {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE
implementation("org.bouncycastle:bcprov-jdk15on:1.64")
implementation(kotlinx("io-jvm", Versions.Kotlin.io)) {
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
}
// api(kotlinx("coroutines-debug", Versions.Kotlin.coroutines)) // api(kotlinx("coroutines-debug", Versions.Kotlin.coroutines))
api("moe.him188:jcekt:${Versions.jcekt}")
api(kotlinx("serialization-runtime", Versions.Kotlin.serialization))
//api(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
} }
} }
val jvmTest by getting { val jvmTest by getting {
dependencies { dependencies {
dependsOn(commonTest) dependsOn(commonTest)
implementation(kotlin("test", Versions.Kotlin.stdlib)) implementation(kotlin("test", Versions.Kotlin.compiler))
implementation(kotlin("test-junit", Versions.Kotlin.stdlib)) implementation(kotlin("test-junit", Versions.Kotlin.compiler))
implementation("org.pcap4j:pcap4j-distribution:1.8.2") implementation("org.pcap4j:pcap4j-distribution:1.8.2")
runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE
@@ -117,3 +121,20 @@ kotlin {
} }
apply(from = rootProject.file("gradle/publish.gradle")) apply(from = rootProject.file("gradle/publish.gradle"))
tasks.withType<com.jfrog.bintray.gradle.tasks.BintrayUploadTask> {
doFirst {
publishing.publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
publication.artifact(object :
org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
}
}
}
}

View File

@@ -82,7 +82,8 @@ internal abstract class BotImpl<N : BotNetworkHandler> constructor(
when (event) { when (event) {
is BotOfflineEvent.MsfOffline, is BotOfflineEvent.MsfOffline,
is BotOfflineEvent.Dropped, is BotOfflineEvent.Dropped,
is BotOfflineEvent.RequireReconnect is BotOfflineEvent.RequireReconnect,
is BotOfflineEvent.PacketFactory10008
-> { -> {
if (!_network.isActive) { if (!_network.isActive) {
// normally closed // normally closed

View File

@@ -11,7 +11,6 @@
package net.mamoe.mirai.qqandroid package net.mamoe.mirai.qqandroid
import io.ktor.client.*
import io.ktor.client.request.* import io.ktor.client.request.*
import io.ktor.client.request.forms.* import io.ktor.client.request.forms.*
import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineName
@@ -19,6 +18,8 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import kotlinx.serialization.json.int import kotlinx.serialization.json.int
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import net.mamoe.mirai.Bot import net.mamoe.mirai.Bot
import net.mamoe.mirai.LowLevelAPI import net.mamoe.mirai.LowLevelAPI
import net.mamoe.mirai.contact.* import net.mamoe.mirai.contact.*
@@ -44,6 +45,7 @@ import net.mamoe.mirai.qqandroid.network.highway.HighwayHelper
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.LongMsg import net.mamoe.mirai.qqandroid.network.protocol.data.proto.LongMsg
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.* import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.*
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.voice.PttStore
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
import net.mamoe.mirai.qqandroid.utils.MiraiPlatformUtils import net.mamoe.mirai.qqandroid.utils.MiraiPlatformUtils
import net.mamoe.mirai.qqandroid.utils.encodeToString import net.mamoe.mirai.qqandroid.utils.encodeToString
@@ -248,7 +250,8 @@ internal abstract class QQAndroidBotBase constructor(
override val friends: ContactList<Friend> = ContactList(LockFreeLinkedList()) override val friends: ContactList<Friend> = ContactList(LockFreeLinkedList())
override val nick: String get() = selfInfo.nick @JvmField internal var cachedNick: String? = null
override val nick: String get() = cachedNick ?: selfInfo.nick.also { cachedNick = it }
internal lateinit var selfInfo: JceFriendInfo internal lateinit var selfInfo: JceFriendInfo
@@ -297,7 +300,7 @@ internal abstract class QQAndroidBotBase constructor(
} }
fun getGroupByUinOrNull(uin: Long): Group? { fun getGroupByUinOrNull(uin: Long): Group? {
return groups.asSequence().firstOrNull { it.checkIsGroupImpl(); it.uin == uin } return groups.firstOrNull { it.checkIsGroupImpl(); it.uin == uin }
} }
@OptIn(LowLevelAPI::class) @OptIn(LowLevelAPI::class)
@@ -487,7 +490,7 @@ internal abstract class QQAndroidBotBase constructor(
val rep = data.await() val rep = data.await()
// bot.network.logger.error(rep) // bot.network.logger.error(rep)
return json.parse(GroupAnnouncementList.serializer(), rep) return json.decodeFromString(GroupAnnouncementList.serializer(), rep)
} }
@LowLevelAPI @LowLevelAPI
@@ -503,7 +506,7 @@ internal abstract class QQAndroidBotBase constructor(
append("pinned", announcement.pinned) append("pinned", announcement.pinned)
append( append(
"settings", "settings",
json.stringify( json.encodeToString(
GroupAnnouncementSettings.serializer(), GroupAnnouncementSettings.serializer(),
announcement.settings ?: GroupAnnouncementSettings() announcement.settings ?: GroupAnnouncementSettings()
) )
@@ -521,8 +524,8 @@ internal abstract class QQAndroidBotBase constructor(
} }
} }
} }
val jsonObj = json.parseJson(rep) val jsonObj = json.parseToJsonElement(rep)
return jsonObj.jsonObject["new_fid"]?.primitive?.content return jsonObj.jsonObject["new_fid"]?.jsonPrimitive?.content
?: throw throw IllegalStateException("Send Announcement fail group:$groupId msg:${jsonObj.jsonObject["em"]} content:${announcement.msg.text}") ?: throw throw IllegalStateException("Send Announcement fail group:$groupId msg:${jsonObj.jsonObject["em"]} content:${announcement.msg.text}")
} }
@@ -549,8 +552,8 @@ internal abstract class QQAndroidBotBase constructor(
} }
} }
} }
val jsonObj = json.parseJson(data) val jsonObj = json.parseToJsonElement(data)
if (jsonObj.jsonObject["ec"]?.int ?: 1 != 0) { if (jsonObj.jsonObject["ec"]?.jsonPrimitive?.int ?: 1 != 0) {
throw throw IllegalStateException("delete Announcement fail group:$groupId msg:${jsonObj.jsonObject["em"]} fid:$fid") throw throw IllegalStateException("delete Announcement fail group:$groupId msg:${jsonObj.jsonObject["em"]} fid:$fid")
} }
} }
@@ -559,7 +562,7 @@ internal abstract class QQAndroidBotBase constructor(
@MiraiExperimentalAPI @MiraiExperimentalAPI
override suspend fun _lowLevelGetAnnouncement(groupId: Long, fid: String): GroupAnnouncement { override suspend fun _lowLevelGetAnnouncement(groupId: Long, fid: String): GroupAnnouncement {
val data = network.async { val data = network.async {
HttpClient().post<String> { MiraiPlatformUtils.Http.post<String> {
url("https://web.qun.qq.com/cgi-bin/announce/get_feed") url("https://web.qun.qq.com/cgi-bin/announce/get_feed")
body = MultiPartFormDataContent(formData { body = MultiPartFormDataContent(formData {
append("qid", groupId) append("qid", groupId)
@@ -578,7 +581,7 @@ internal abstract class QQAndroidBotBase constructor(
val rep = data.await() val rep = data.await()
// bot.network.logger.error(rep) // bot.network.logger.error(rep)
return json.parse(GroupAnnouncement.serializer(), rep) return json.decodeFromString(GroupAnnouncement.serializer(), rep)
} }
@@ -586,7 +589,7 @@ internal abstract class QQAndroidBotBase constructor(
@MiraiExperimentalAPI @MiraiExperimentalAPI
override suspend fun _lowLevelGetGroupActiveData(groupId: Long, page: Int): GroupActiveData { override suspend fun _lowLevelGetGroupActiveData(groupId: Long, page: Int): GroupActiveData {
val data = network.async { val data = network.async {
HttpClient().get<String> { MiraiPlatformUtils.Http.get<String> {
url("https://qqweb.qq.com/c/activedata/get_mygroup_data") url("https://qqweb.qq.com/c/activedata/get_mygroup_data")
parameter("bkn", bkn) parameter("bkn", bkn)
parameter("gc", groupId) parameter("gc", groupId)
@@ -602,7 +605,7 @@ internal abstract class QQAndroidBotBase constructor(
} }
} }
val rep = data.await() val rep = data.await()
return json.parse(GroupActiveData.serializer(), rep) return json.decodeFromString(GroupActiveData.serializer(), rep)
} }
@JvmSynthetic @JvmSynthetic
@@ -791,6 +794,25 @@ internal abstract class QQAndroidBotBase constructor(
} }
} }
@OptIn(ExperimentalStdlibApi::class)
@LowLevelAPI
override suspend fun _lowLevelQueryGroupVoiceDownloadUrl(
md5: ByteArray,
groupId: Long,
dstUin: Long
): String {
network.run {
val response: PttStore.GroupPttDown.Response.DownLoadInfo =
PttStore.GroupPttDown(client, groupId, dstUin, md5).sendAndExpect()
return "http://${response.strDomain}${response.downPara.encodeToString()}"
}
}
@LowLevelAPI
override suspend fun _lowLevelUploadVoice(md5: ByteArray, groupId: Long) {
}
@Suppress("DEPRECATION", "OverridingDeprecatedMember") @Suppress("DEPRECATION", "OverridingDeprecatedMember")
override suspend fun queryImageUrl(image: Image): String = when (image) { override suspend fun queryImageUrl(image: Image): String = when (image) {
is ConstOriginUrlAware -> image.originUrl is ConstOriginUrlAware -> image.originUrl

View File

@@ -49,14 +49,16 @@ import net.mamoe.mirai.utils.verbose
import kotlin.contracts.ExperimentalContracts import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.jvm.JvmField
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
import kotlin.math.roundToInt import kotlin.math.roundToInt
import kotlin.time.measureTime import kotlin.time.measureTime
internal inline class FriendInfoImpl( internal class FriendInfoImpl(
private val jceFriendInfo: net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo @JvmField private val jceFriendInfo: net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo
) : FriendInfo { ) : FriendInfo {
override val nick: String get() = jceFriendInfo.nick @JvmField internal var cachedNick: String? = null
override val nick: String get() = cachedNick ?: jceFriendInfo.nick.also { cachedNick = it }
override val uin: Long get() = jceFriendInfo.friendUin override val uin: Long get() = jceFriendInfo.friendUin
} }
@@ -73,7 +75,7 @@ internal class FriendImpl(
bot: QQAndroidBot, bot: QQAndroidBot,
coroutineContext: CoroutineContext, coroutineContext: CoroutineContext,
override val id: Long, override val id: Long,
private val friendInfo: FriendInfo internal val friendInfo: FriendInfo
) : Friend() { ) : Friend() {
override val coroutineContext: CoroutineContext = coroutineContext + SupervisorJob(coroutineContext[Job]) override val coroutineContext: CoroutineContext = coroutineContext + SupervisorJob(coroutineContext[Job])
@@ -122,7 +124,7 @@ internal class FriendImpl(
@Suppress("UNCHECKED_CAST", "DEPRECATION") @Suppress("UNCHECKED_CAST", "DEPRECATION")
when (response) { when (response) {
is LongConn.OffPicUp.Response.FileExists -> OfflineFriendImage(response.resourceId) is LongConn.OffPicUp.Response.FileExists -> net.mamoe.mirai.message.data.OfflineFriendImage(response.resourceId)
.also { .also {
ImageUploadEvent.Succeed(this@FriendImpl, image, it).broadcast() ImageUploadEvent.Succeed(this@FriendImpl, image, it).broadcast()
} }
@@ -156,7 +158,7 @@ internal class FriendImpl(
)*/ )*/
// 为什么不能 ?? // 为什么不能 ??
OfflineFriendImage(response.resourceId).also { net.mamoe.mirai.message.data.OfflineFriendImage(response.resourceId).also {
ImageUploadEvent.Succeed(this@FriendImpl, image, it).broadcast() ImageUploadEvent.Succeed(this@FriendImpl, image, it).broadcast()
} }
} }

View File

@@ -33,9 +33,13 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.TroopManagement
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvcPbSendMsg import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvcPbSendMsg
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.createToGroup import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.createToGroup
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.voice.PttStore
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.ProfileService import net.mamoe.mirai.qqandroid.network.protocol.packet.list.ProfileService
import net.mamoe.mirai.qqandroid.utils.MiraiPlatformUtils
import net.mamoe.mirai.qqandroid.utils.estimateLength import net.mamoe.mirai.qqandroid.utils.estimateLength
import net.mamoe.mirai.qqandroid.utils.toUHexString
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import java.io.InputStream
import kotlin.contracts.contract import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@@ -130,18 +134,18 @@ internal class GroupImpl(
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
//if (_announcement != newValue) { //if (_announcement != newValue) {
val oldValue = _announcement val oldValue = _announcement
_announcement = newValue _announcement = newValue
launch { launch {
bot.network.run { bot.network.run {
TroopManagement.GroupOperation.memo( TroopManagement.GroupOperation.memo(
client = bot.client, client = bot.client,
groupCode = id, groupCode = id,
newMemo = newValue newMemo = newValue
).sendWithoutExpect() ).sendWithoutExpect()
}
GroupEntranceAnnouncementChangeEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
GroupEntranceAnnouncementChangeEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
}
//} //}
} }
@@ -151,18 +155,18 @@ internal class GroupImpl(
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
//if (_allowMemberInvite != newValue) { //if (_allowMemberInvite != newValue) {
val oldValue = _allowMemberInvite val oldValue = _allowMemberInvite
_allowMemberInvite = newValue _allowMemberInvite = newValue
launch { launch {
bot.network.run { bot.network.run {
TroopManagement.GroupOperation.allowMemberInvite( TroopManagement.GroupOperation.allowMemberInvite(
client = bot.client, client = bot.client,
groupCode = id, groupCode = id,
switch = newValue switch = newValue
).sendWithoutExpect() ).sendWithoutExpect()
}
GroupAllowMemberInviteEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
GroupAllowMemberInviteEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
}
//} //}
} }
@@ -208,18 +212,18 @@ internal class GroupImpl(
set(newValue) { set(newValue) {
checkBotPermission(MemberPermission.ADMINISTRATOR) checkBotPermission(MemberPermission.ADMINISTRATOR)
//if (_muteAll != newValue) { //if (_muteAll != newValue) {
val oldValue = _muteAll val oldValue = _muteAll
_muteAll = newValue _muteAll = newValue
launch { launch {
bot.network.run { bot.network.run {
TroopManagement.GroupOperation.muteAll( TroopManagement.GroupOperation.muteAll(
client = bot.client, client = bot.client,
groupCode = id, groupCode = id,
switch = newValue switch = newValue
).sendWithoutExpect() ).sendWithoutExpect()
}
GroupMuteAllEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
} }
GroupMuteAllEvent(oldValue, newValue, this@GroupImpl, null).broadcast()
}
//} //}
} }
} }
@@ -363,7 +367,7 @@ internal class GroupImpl(
source = it source = it
}.sendAndExpect<MessageSvcPbSendMsg.Response>().let { }.sendAndExpect<MessageSvcPbSendMsg.Response>().let {
check(it is MessageSvcPbSendMsg.Response.SUCCESS) { check(it is MessageSvcPbSendMsg.Response.SUCCESS) {
"Send temp message failed: $it" "Send group message failed: $it"
} }
} }
@@ -371,8 +375,10 @@ internal class GroupImpl(
source.ensureSequenceIdAvailable() source.ensureSequenceIdAvailable()
} catch (e: Exception) { } catch (e: Exception) {
bot.network.logger.warning { bot.network.logger.warning {
"Timeout awaiting sequenceId for group message(${message.contentToString() "Timeout awaiting sequenceId for group message(${
.take(10)}). Some features may not work properly" message.contentToString()
.take(10)
}). Some features may not work properly"
} }
bot.network.logger.warning(e) bot.network.logger.warning(e)
} }
@@ -443,5 +449,46 @@ internal class GroupImpl(
(image.input as? Closeable)?.close() (image.input as? Closeable)?.close()
} }
/**
* 上传一个语音消息以备发送.
* 请注意这是一个实验性api且随时会被删除
* @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当语音文件过大而被服务器拒绝上传时. (最大大小约为 1 MB)
*/
@JvmSynthetic
@MiraiExperimentalAPI
@SinceMirai("1.2.0")
override suspend fun uploadVoice(input: InputStream): Voice {
val content = ByteArray(input.available())
input.read(content)
if (content.size > 1048576) {
throw OverFileSizeMaxException()
}
val md5 = MiraiPlatformUtils.md5(content)
val codec = with(content.copyOfRange(0, 10).toUHexString("")) {
when {
startsWith("2321414D52") -> 0 // amr
startsWith("02232153494C4B5F5633") -> 1 // silk V3
else -> 0 // use amr by default
}
}
return bot.network.run {
val response: PttStore.GroupPttUp.Response.RequireUpload =
PttStore.GroupPttUp(bot.client, bot.id, id, md5, content.size.toLong(), codec).sendAndExpect()
HighwayHelper.uploadPttToServers(
bot,
response.uploadIpList.zip(response.uploadPortList),
content,
md5,
response.uKey,
response.fileKey,
codec
)
Voice("${md5.toUHexString("")}.amr", md5, content.size.toLong(), "")
}
}
override fun toString(): String = "Group($id)" override fun toString(): String = "Group($id)"
} }

View File

@@ -259,7 +259,8 @@ internal class MemberInfoImpl(
) : MemberInfo { ) : MemberInfo {
override val uin: Long = jceInfo.memberUin override val uin: Long = jceInfo.memberUin
override val nameCard: String = jceInfo.sName ?: "" override val nameCard: String = jceInfo.sName ?: ""
override val nick: String = jceInfo.nick internal var _nick: String = jceInfo.nick
override val nick: String get() = _nick
override val permission: MemberPermission = when { override val permission: MemberPermission = when {
jceInfo.memberUin == groupOwnerId -> MemberPermission.OWNER jceInfo.memberUin == groupOwnerId -> MemberPermission.OWNER
jceInfo.dwFlag == 1L -> MemberPermission.ADMINISTRATOR jceInfo.dwFlag == 1L -> MemberPermission.ADMINISTRATOR

View File

@@ -62,7 +62,7 @@ internal suspend fun <T : User> Friend.sendMessageImpl(
source = it source = it
}.sendAndExpect<MessageSvcPbSendMsg.Response>().let { }.sendAndExpect<MessageSvcPbSendMsg.Response>().let {
check(it is MessageSvcPbSendMsg.Response.SUCCESS) { check(it is MessageSvcPbSendMsg.Response.SUCCESS) {
"Send temp message failed: $it" "Send friend message failed: $it"
} }
} }
friendReceiptConstructor(source) friendReceiptConstructor(source)

View File

@@ -33,7 +33,9 @@ import kotlin.contracts.contract
private val UNSUPPORTED_MERGED_MESSAGE_PLAIN = PlainText("你的QQ暂不支持查看[转发多条消息],请期待后续版本。") private val UNSUPPORTED_MERGED_MESSAGE_PLAIN = PlainText("你的QQ暂不支持查看[转发多条消息],请期待后续版本。")
private val UNSUPPORTED_POKE_MESSAGE_PLAIN = PlainText("[戳一戳]请使用最新版手机QQ体验新功能。") private val UNSUPPORTED_POKE_MESSAGE_PLAIN = PlainText("[戳一戳]请使用最新版手机QQ体验新功能。")
private val UNSUPPORTED_FLASH_MESSAGE_PLAIN = PlainText("[闪照]请使用新版手机QQ查看闪照。") private val UNSUPPORTED_FLASH_MESSAGE_PLAIN = PlainText("[闪照]请使用新版手机QQ查看闪照。")
private val UNSUPPORTED_VOICE_MESSAGE_PLAIN = PlainText("收到语音消息你需要升级到最新版QQ才能接收升级地址https://im.qq.com")
@OptIn(ExperimentalStdlibApi::class)
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: Boolean): MutableList<ImMsgBody.Elem> { internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: Boolean): MutableList<ImMsgBody.Elem> {
val elements = ArrayList<ImMsgBody.Elem>(this.size) val elements = ArrayList<ImMsgBody.Elem>(this.size)
@@ -157,7 +159,20 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: B
is VipFace -> { is VipFace -> {
transformOneMessage(PlainText(it.contentToString())) transformOneMessage(PlainText(it.contentToString()))
} }
is PttMessage, is PttMessage -> {
elements.add(
ImMsgBody.Elem(
extraInfo = ImMsgBody.ExtraInfo(flags = 16, groupMask = 1)
)
)
elements.add(
ImMsgBody.Elem(
elemFlags2 = ImMsgBody.ElemFlags2(
vipStatus = 1
)
)
)
}
is ForwardMessage, is ForwardMessage,
is MessageSource, // mirai metadata only is MessageSource, // mirai metadata only
is RichMessage // already transformed above is RichMessage // already transformed above
@@ -216,13 +231,13 @@ internal fun MsgComm.Msg.toMessageChain(
isTemp: Boolean = false isTemp: Boolean = false
): MessageChain { ): MessageChain {
val elements = this.msgBody.richText.elems val elements = this.msgBody.richText.elems
val ptt = this.msgBody.richText.ptt
val pptMsg = ptt?.run { val pptMsg = msgBody.richText.ptt?.run {
when(fileType) { // when (fileType) {
4 -> Voice(String(fileName), fileMd5, String(downPara)) // 4 -> Voice(String(fileName), fileMd5, fileSize.toLong(),String(downPara))
else -> null // else -> null
} // }
Voice(String(fileName), fileMd5, fileSize.toLong(), String(downPara))
} }
return buildMessageChain(elements.size + 1 + if (pptMsg == null) 0 else 1) { return buildMessageChain(elements.size + 1 + if (pptMsg == null) 0 else 1) {
@@ -275,13 +290,13 @@ private fun MessageChain.cleanupRubbishMessageElements(): MessageChain {
return@forEach return@forEach
} }
} }
if (last is FlashImage && element is PlainText) { // 解决tim发送的语音无法正常识别
if (element == UNSUPPORTED_FLASH_MESSAGE_PLAIN) { if (element is PlainText) {
if (element == UNSUPPORTED_VOICE_MESSAGE_PLAIN) {
last = element last = element
return@forEach return@forEach
} }
} }
add(element) add(element)
last = element last = element
} }
@@ -312,7 +327,7 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(groupIdOrZero: Long, bot: B
element.face != null -> list.add(Face(element.face.index)) element.face != null -> list.add(Face(element.face.index))
element.text != null -> { element.text != null -> {
if (element.text.attr6Buf.isEmpty()) { if (element.text.attr6Buf.isEmpty()) {
list.add(element.text.str.toMessage()) list.add(PlainText(element.text.str))
} else { } else {
val id: Long val id: Long
element.text.attr6Buf.read { element.text.attr6Buf.read {
@@ -432,7 +447,8 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(groupIdOrZero: Long, bot: B
.orEmpty(), .orEmpty(),
proto.pokeType, proto.pokeType,
proto.vaspokeId proto.vaspokeId
)) )
)
} }
3 -> { 3 -> {
val proto = element.commonElem.pbElem.loadAs(HummerCommelem.MsgElemInfoServtype3.serializer()) val proto = element.commonElem.pbElem.loadAs(HummerCommelem.MsgElemInfoServtype3.serializer())

View File

@@ -24,6 +24,8 @@ import net.mamoe.mirai.event.events.BotOfflineEvent
import net.mamoe.mirai.event.events.BotOnlineEvent import net.mamoe.mirai.event.events.BotOnlineEvent
import net.mamoe.mirai.event.events.BotReloginEvent import net.mamoe.mirai.event.events.BotReloginEvent
import net.mamoe.mirai.message.MessageEvent import net.mamoe.mirai.message.MessageEvent
import net.mamoe.mirai.network.ForceOfflineException
import net.mamoe.mirai.network.RetryLaterException
import net.mamoe.mirai.network.UnsupportedSMSLoginException import net.mamoe.mirai.network.UnsupportedSMSLoginException
import net.mamoe.mirai.network.WrongPasswordException import net.mamoe.mirai.network.WrongPasswordException
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
@@ -31,6 +33,7 @@ import net.mamoe.mirai.qqandroid.contact.*
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.StTroopNum import net.mamoe.mirai.qqandroid.network.protocol.data.jce.StTroopNum
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.qqandroid.network.protocol.packet.* import net.mamoe.mirai.qqandroid.network.protocol.packet.*
import net.mamoe.mirai.qqandroid.network.protocol.packet.KnownPacketFactories.PacketFactoryIllegalState10008Exception
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.GroupInfoImpl import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.GroupInfoImpl
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvcPbGetMsg import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvcPbGetMsg
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
@@ -176,8 +179,12 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
} }
} }
is WtLogin.Login.LoginPacketResponse.Error -> is WtLogin.Login.LoginPacketResponse.Error -> {
if (response.message.contains("0x9a")) { //Error(title=登录失败, message=请你稍后重试。(0x9a), errorInfo=)
throw RetryLaterException()
}
throw WrongPasswordException(response.toString()) throw WrongPasswordException(response.toString())
}
is WtLogin.Login.LoginPacketResponse.DeviceLockLogin -> { is WtLogin.Login.LoginPacketResponse.DeviceLockLogin -> {
response = WtLogin.Login.SubCommand20( response = WtLogin.Login.SubCommand20(
@@ -239,6 +246,7 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
// self info // self info
data.selfInfo?.run { data.selfInfo?.run {
bot.cachedNick = null
bot.selfInfo = this bot.selfInfo = this
// bot.remark = remark ?: "" // bot.remark = remark ?: ""
// bot.sex = sex // bot.sex = sex
@@ -406,7 +414,8 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
logger.info { "Syncing friend message history..." } logger.info { "Syncing friend message history..." }
withTimeoutOrNull(30000) { withTimeoutOrNull(30000) {
launch(CoroutineName("Syncing friend message history")) { syncFromEvent<MessageSvcPbGetMsg.GetMsgSuccess, Unit> { Unit } } launch(CoroutineName("Syncing friend message history")) { syncFromEvent<MessageSvcPbGetMsg.GetMsgSuccess, Unit> { Unit } }
MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, currentTimeSeconds).sendAndExpect<Packet>() MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, null).sendAndExpect<Packet>()
} ?: error("timeout syncing friend message history") } ?: error("timeout syncing friend message history")
logger.info { "Syncing friend message history: Success" } logger.info { "Syncing friend message history: Success" }
} }
@@ -449,7 +458,14 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
return this.launch( return this.launch(
start = CoroutineStart.ATOMIC start = CoroutineStart.ATOMIC
) { ) {
input.use { parsePacket(it) } input.use {
try {
parsePacket(it)
} catch (e: PacketFactoryIllegalState10008Exception) {
logger.warning { "Network force offline: ${e.message}" }
bot.launch { BotOfflineEvent.PacketFactory10008(bot, e).broadcast() }
}
}
} }
} }
@@ -459,6 +475,7 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
* *
* @param input 一个完整的包的内容, 去掉开头的 int 包长度 * @param input 一个完整的包的内容, 去掉开头的 int 包长度
*/ */
@Throws(ForceOfflineException::class)
suspend fun parsePacket(input: ByteReadPacket) { suspend fun parsePacket(input: ByteReadPacket) {
generifiedParsePacket<Packet>(input) generifiedParsePacket<Packet>(input)
} }

View File

@@ -11,6 +11,7 @@
package net.mamoe.mirai.qqandroid.network package net.mamoe.mirai.qqandroid.network
import kotlinx.atomicfu.AtomicBoolean
import kotlinx.atomicfu.AtomicInt import kotlinx.atomicfu.AtomicInt
import kotlinx.atomicfu.atomic import kotlinx.atomicfu.atomic
import kotlinx.io.core.* import kotlinx.io.core.*
@@ -27,6 +28,7 @@ import net.mamoe.mirai.qqandroid.utils.*
import net.mamoe.mirai.qqandroid.utils.cryptor.ECDH import net.mamoe.mirai.qqandroid.utils.cryptor.ECDH
import net.mamoe.mirai.qqandroid.utils.cryptor.TEA import net.mamoe.mirai.qqandroid.utils.cryptor.TEA
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import kotlin.jvm.Volatile
import kotlin.random.Random import kotlin.random.Random
internal val DeviceInfo.guid: ByteArray get() = generateGuid(androidId, macAddress) internal val DeviceInfo.guid: ByteArray get() = generateGuid(androidId, macAddress)
@@ -44,13 +46,13 @@ private fun generateGuid(androidId: ByteArray, macAddress: ByteArray): ByteArray
internal fun getRandomByteArray(length: Int): ByteArray = ByteArray(length) { Random.nextInt(0, 255).toByte() } internal fun getRandomByteArray(length: Int): ByteArray = ByteArray(length) { Random.nextInt(0, 255).toByte() }
internal object DefaultServerList : Set<Pair<String, Int>> by setOf( internal object DefaultServerList : Set<Pair<String, Int>> by setOf(
"msfwifi.3g.qq.com" to 8080,
"42.81.169.46" to 8080, "42.81.169.46" to 8080,
"42.81.172.81" to 80, "42.81.172.81" to 80,
"114.221.148.59" to 14000, "114.221.148.59" to 14000,
"42.81.172.147" to 443, "42.81.172.147" to 443,
"125.94.60.146" to 80, "125.94.60.146" to 80,
"114.221.144.215" to 80, "114.221.144.215" to 80,
"msfwifi.3g.qq.com" to 8080,
"42.81.172.22" to 80 "42.81.172.22" to 80
) )
@@ -131,7 +133,7 @@ internal open class QQAndroidClient(
throw NoServerAvailableException(null) throw NoServerAvailableException(null)
} }
retryCatching(bot.client.serverList.size, except = LoginFailedException::class) { retryCatching(bot.client.serverList.size, except = LoginFailedException::class) {
val pair = bot.client.serverList.random() val pair = bot.client.serverList[0]
kotlin.runCatching { kotlin.runCatching {
block(pair.first, pair.second) block(pair.first, pair.second)
return@retryCatching return@retryCatching
@@ -204,6 +206,9 @@ internal open class QQAndroidClient(
val protocolVersion: Short = 8001 val protocolVersion: Short = 8001
class C2cMessageSyncData { class C2cMessageSyncData {
val firstNotify: AtomicBoolean = atomic(true)
@Volatile
var syncCookie: ByteArray? = null var syncCookie: ByteArray? = null
var pubAccountCookie = EMPTY_BYTE_ARRAY var pubAccountCookie = EMPTY_BYTE_ARRAY
var msgCtrlBuf: ByteArray = EMPTY_BYTE_ARRAY var msgCtrlBuf: ByteArray = EMPTY_BYTE_ARRAY

View File

@@ -11,11 +11,17 @@
package net.mamoe.mirai.qqandroid.network.highway package net.mamoe.mirai.qqandroid.network.highway
import io.ktor.client.* import io.ktor.client.HttpClient
import io.ktor.client.request.* import io.ktor.client.request.parameter
import io.ktor.http.* import io.ktor.client.request.port
import io.ktor.http.content.* import io.ktor.client.request.post
import io.ktor.utils.io.* import io.ktor.client.request.url
import io.ktor.http.ContentType
import io.ktor.http.HttpStatusCode
import io.ktor.http.URLProtocol
import io.ktor.http.content.OutgoingContent
import io.ktor.http.userAgent
import io.ktor.utils.io.ByteWriteChannel
import kotlinx.coroutines.InternalCoroutinesApi import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.collect
@@ -26,8 +32,9 @@ import kotlinx.io.core.use
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.network.QQAndroidClient import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.CSDataHighwayHead import net.mamoe.mirai.qqandroid.network.protocol.data.proto.CSDataHighwayHead
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Cmd0x388
import net.mamoe.mirai.qqandroid.utils.*
import net.mamoe.mirai.qqandroid.utils.PlatformSocket import net.mamoe.mirai.qqandroid.utils.PlatformSocket
import net.mamoe.mirai.qqandroid.utils.SocketException
import net.mamoe.mirai.qqandroid.utils.addSuppressedMirai import net.mamoe.mirai.qqandroid.utils.addSuppressedMirai
import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.withUse import net.mamoe.mirai.qqandroid.utils.io.withUse
@@ -177,6 +184,54 @@ internal object HighwayHelper {
} }
} }
} }
suspend fun uploadPttToServers(
bot: QQAndroidBot,
servers: List<Pair<Int, Int>>,
content: ByteArray,
md5: ByteArray,
uKey: ByteArray,
fileKey: ByteArray,
codec: Int
) {
servers.retryWithServers(10 * 1000, {
throw IllegalStateException("cannot upload ptt, failed on all servers.", it)
}, { s: String, i: Int ->
bot.network.logger.verbose {
"[Highway] Uploading ptt to ${s}:$i, size=${content.size.toLong().sizeToString()}"
}
val time = measureTime {
uploadPttToServer(s, i, content, md5, uKey, fileKey, codec)
}
bot.network.logger.verbose {
"[Highway] Uploading ptt: succeed at ${(content.size.toDouble() / 1024 / time.inSeconds).roundToInt()} KiB/s"
}
})
}
private suspend fun uploadPttToServer(
serverIp: String,
serverPort: Int,
content: ByteArray,
md5: ByteArray,
uKey: ByteArray,
fileKey: ByteArray,
codec: Int
) {
MiraiPlatformUtils.Http.post<String> {
url("http://$serverIp:$serverPort")
parameter("ver", 4679)
parameter("ukey", uKey.toUHexString(""))
parameter("filekey", fileKey.toUHexString(""))
parameter("filesize", content.size)
parameter("bmd5", md5.toUHexString(""))
parameter("mType", "pttDu")
parameter("voice_encodec", codec)
body = content
}
}
} }

View File

@@ -9,7 +9,7 @@
package net.mamoe.mirai.qqandroid.network.protocol package net.mamoe.mirai.qqandroid.network.protocol
inline class LoginType( internal inline class LoginType(
val value: Int val value: Int
) { ) {
companion object { companion object {
@@ -17,6 +17,7 @@ inline class LoginType(
* 短信验证登录 * 短信验证登录
*/ */
val SMS = LoginType(3) val SMS = LoginType(3)
/** /**
* 密码登录 * 密码登录
*/ */

View File

@@ -1,173 +1,173 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.network.Packet import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class BigDataChannel( internal class BigDataChannel(
@JceId(0) @JvmField val vBigdataIplists: List<BigDataIpList>, @TarsId(0) @JvmField val vBigdataIplists: List<BigDataIpList>,
@JceId(1) @JvmField val sBigdataSigSession: ByteArray? = null, @TarsId(1) @JvmField val sBigdataSigSession: ByteArray? = null,
@JceId(2) @JvmField val sBigdataKeySession: ByteArray? = null, @TarsId(2) @JvmField val sBigdataKeySession: ByteArray? = null,
@JceId(3) @JvmField val uSigUin: Long? = null, @TarsId(3) @JvmField val uSigUin: Long? = null,
@JceId(4) @JvmField val iConnectFlag: Int? = 1, @TarsId(4) @JvmField val iConnectFlag: Int? = 1,
@JceId(5) @JvmField val vBigdataPbBuf: ByteArray? = null @TarsId(5) @JvmField val vBigdataPbBuf: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class BigDataIpInfo( internal class BigDataIpInfo(
@JceId(0) @JvmField val uType: Long, @TarsId(0) @JvmField val uType: Long,
@JceId(1) @JvmField val sIp: String = "", @TarsId(1) @JvmField val sIp: String = "",
@JceId(2) @JvmField val uPort: Long @TarsId(2) @JvmField val uPort: Long
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class BigDataIpList( internal class BigDataIpList(
@JceId(0) @JvmField val uServiceType: Long, @TarsId(0) @JvmField val uServiceType: Long,
@JceId(1) @JvmField val vIplist: List<BigDataIpInfo>, @TarsId(1) @JvmField val vIplist: List<BigDataIpInfo>,
@JceId(2) @JvmField val netSegConfs: List<NetSegConf>? = null, @TarsId(2) @JvmField val netSegConfs: List<NetSegConf>? = null,
@JceId(3) @JvmField val ufragmentSize: Long? = null @TarsId(3) @JvmField val ufragmentSize: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ClientLogConfig( internal class ClientLogConfig(
@JceId(1) @JvmField val type: Int, @TarsId(1) @JvmField val type: Int,
@JceId(2) @JvmField val timeStart: TimeStamp? = null, @TarsId(2) @JvmField val timeStart: TimeStamp? = null,
@JceId(3) @JvmField val timeFinish: TimeStamp? = null, @TarsId(3) @JvmField val timeFinish: TimeStamp? = null,
@JceId(4) @JvmField val loglevel: Byte? = null, @TarsId(4) @JvmField val loglevel: Byte? = null,
@JceId(5) @JvmField val cookie: Int? = null, @TarsId(5) @JvmField val cookie: Int? = null,
@JceId(6) @JvmField val lseq: Long? = null @TarsId(6) @JvmField val lseq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DomainIpChannel( internal class DomainIpChannel(
@JceId(0) @JvmField val vDomainIplists: List<DomainIpList> @TarsId(0) @JvmField val vDomainIplists: List<DomainIpList>
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DomainIpInfo( internal class DomainIpInfo(
@JceId(1) @JvmField val uIp: Int, @TarsId(1) @JvmField val uIp: Int,
@JceId(2) @JvmField val uPort: Int @TarsId(2) @JvmField val uPort: Int
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DomainIpList( internal class DomainIpList(
@JceId(0) @JvmField val uDomainType: Int, @TarsId(0) @JvmField val uDomainType: Int,
@JceId(1) @JvmField val vIplist: List<DomainIpInfo>, @TarsId(1) @JvmField val vIplist: List<DomainIpInfo>,
@JceId(2) @JvmField val unknown: ByteArray? = null, @TarsId(2) @JvmField val unknown: ByteArray? = null,
@JceId(4) @JvmField val int: Int? = null// added @TarsId(4) @JvmField val int: Int? = null// added
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class _340( internal class _340(
@JceId(1) @JvmField val field1315: List<_339>, @TarsId(1) @JvmField val field1315: List<_339>,
@JceId(3) @JvmField val field1316: List<_339>, @TarsId(3) @JvmField val field1316: List<_339>,
@JceId(4) @JvmField val field1317: Int, @TarsId(4) @JvmField val field1317: Int,
@JceId(5) @JvmField val field1318: Byte? = 0, @TarsId(5) @JvmField val field1318: Byte? = 0,
@JceId(6) @JvmField val field1319: Byte? = 0, @TarsId(6) @JvmField val field1319: Byte? = 0,
@JceId(7) @JvmField val field1320: Int? = 1, @TarsId(7) @JvmField val field1320: Int? = 1,
@JceId(8) @JvmField val field1321: List<_339>? = null, @TarsId(8) @JvmField val field1321: List<_339>? = null,
@JceId(9) @JvmField val field1322: List<_339>? = null, @TarsId(9) @JvmField val field1322: List<_339>? = null,
@JceId(10) @JvmField val field1323: List<_339>? = null, @TarsId(10) @JvmField val field1323: List<_339>? = null,
@JceId(11) @JvmField val field1324: List<_339>? = null, @TarsId(11) @JvmField val field1324: List<_339>? = null,
@JceId(12) @JvmField val field1325: List<_339>? = null, @TarsId(12) @JvmField val field1325: List<_339>? = null,
@JceId(13) @JvmField val field1326: List<_339>? = null, @TarsId(13) @JvmField val field1326: List<_339>? = null,
@JceId(14) @JvmField val netType: Byte? = 0, @TarsId(14) @JvmField val netType: Byte? = 0,
@JceId(15) @JvmField val heThreshold: Int? = 0, @TarsId(15) @JvmField val heThreshold: Int? = 0,
@JceId(16) @JvmField val policyId: String? = "" @TarsId(16) @JvmField val policyId: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class _339( internal class _339(
@JceId(1) @JvmField val field1298: String = "", @TarsId(1) @JvmField val field1298: String = "",
@JceId(2) @JvmField val field1299: Int = 0, @TarsId(2) @JvmField val field1299: Int = 0,
@JceId(3) @JvmField val field1300: Byte = 0, @TarsId(3) @JvmField val field1300: Byte = 0,
@JceId(4) @JvmField val field1301: Byte = 0, @TarsId(4) @JvmField val field1301: Byte = 0,
@JceId(5) @JvmField val field1302: Byte? = 0, @TarsId(5) @JvmField val field1302: Byte? = 0,
@JceId(6) @JvmField val field1303: Int? = 8, @TarsId(6) @JvmField val field1303: Int? = 8,
@JceId(7) @JvmField val field1304: Byte? = 0, @TarsId(7) @JvmField val field1304: Byte? = 0,
@JceId(8) @JvmField val field1305: String = "", @TarsId(8) @JvmField val field1305: String = "",
@JceId(9) @JvmField val field1306: String = "" @TarsId(9) @JvmField val field1306: String = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FileStoragePushFSSvcListFuckKotlin( internal class FileStoragePushFSSvcListFuckKotlin(
@JceId(0) @JvmField val vUpLoadList: List<FileStorageServerListInfo>? = listOf(), @TarsId(0) @JvmField val vUpLoadList: List<FileStorageServerListInfo>? = listOf(),
@JceId(1) @JvmField val vPicDownLoadList: List<FileStorageServerListInfo>? = listOf(), @TarsId(1) @JvmField val vPicDownLoadList: List<FileStorageServerListInfo>? = listOf(),
@JceId(2) @JvmField val vGPicDownLoadList: List<FileStorageServerListInfo>? = null, @TarsId(2) @JvmField val vGPicDownLoadList: List<FileStorageServerListInfo>? = null,
@JceId(3) @JvmField val vQzoneProxyServiceList: List<FileStorageServerListInfo>? = null, @TarsId(3) @JvmField val vQzoneProxyServiceList: List<FileStorageServerListInfo>? = null,
@JceId(4) @JvmField val vUrlEncodeServiceList: List<FileStorageServerListInfo>? = null, @TarsId(4) @JvmField val vUrlEncodeServiceList: List<FileStorageServerListInfo>? = null,
@JceId(5) @JvmField val bigDataChannel: BigDataChannel? = null, @TarsId(5) @JvmField val bigDataChannel: BigDataChannel? = null,
@JceId(6) @JvmField val vVipEmotionList: List<FileStorageServerListInfo>? = null, @TarsId(6) @JvmField val vVipEmotionList: List<FileStorageServerListInfo>? = null,
@JceId(7) @JvmField val vC2CPicDownList: List<FileStorageServerListInfo>? = null, @TarsId(7) @JvmField val vC2CPicDownList: List<FileStorageServerListInfo>? = null,
@JceId(8) @JvmField val fmtIPInfo: FmtIPInfo? = null, @TarsId(8) @JvmField val fmtIPInfo: FmtIPInfo? = null,
@JceId(9) @JvmField val domainIpChannel: DomainIpChannel? = null, @TarsId(9) @JvmField val domainIpChannel: DomainIpChannel? = null,
@JceId(10) @JvmField val pttlist: ByteArray? = null @TarsId(10) @JvmField val pttlist: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FileStorageServerListInfo( internal class FileStorageServerListInfo(
@JceId(1) @JvmField val sIP: String = "", @TarsId(1) @JvmField val sIP: String = "",
@JceId(2) @JvmField val iPort: Int @TarsId(2) @JvmField val iPort: Int
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FmtIPInfo( internal class FmtIPInfo(
@JceId(0) @JvmField val sGateIp: String = "", @TarsId(0) @JvmField val sGateIp: String = "",
@JceId(1) @JvmField val iGateIpOper: Long @TarsId(1) @JvmField val iGateIpOper: Long
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class NetSegConf( internal class NetSegConf(
@JceId(0) @JvmField val uint32NetType: Long? = null, @TarsId(0) @JvmField val uint32NetType: Long? = null,
@JceId(1) @JvmField val uint32Segsize: Long? = null, @TarsId(1) @JvmField val uint32Segsize: Long? = null,
@JceId(2) @JvmField val uint32Segnum: Long? = null, @TarsId(2) @JvmField val uint32Segnum: Long? = null,
@JceId(3) @JvmField val uint32Curconnnum: Long? = null @TarsId(3) @JvmField val uint32Curconnnum: Long? = null
) : JceStruct ) : JceStruct
@Suppress("ArrayInDataClass") @Suppress("ArrayInDataClass")
@Serializable @Serializable
internal class PushReq( internal class PushReq(
@JceId(1) @JvmField val type: Int, @TarsId(1) @JvmField val type: Int,
@JceId(2) @JvmField val jcebuf: ByteArray, @TarsId(2) @JvmField val jcebuf: ByteArray,
@JceId(3) @JvmField val seq: Long @TarsId(3) @JvmField val seq: Long
) : JceStruct, Packet ) : JceStruct, Packet
@Serializable @Serializable
internal class PushResp( internal class PushResp(
@JceId(1) @JvmField val type: Int, @TarsId(1) @JvmField val type: Int,
@JceId(2) @JvmField val seq: Long, @TarsId(2) @JvmField val seq: Long,
@JceId(3) @JvmField val jcebuf: ByteArray? = null @TarsId(3) @JvmField val jcebuf: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class SsoServerList( internal class SsoServerList(
@JceId(1) @JvmField val v2G3GList: List<SsoServerListInfo>, @TarsId(1) @JvmField val v2G3GList: List<SsoServerListInfo>,
@JceId(3) @JvmField val vWifiList: List<SsoServerListInfo>, @TarsId(3) @JvmField val vWifiList: List<SsoServerListInfo>,
@JceId(4) @JvmField val iReconnect: Int, @TarsId(4) @JvmField val iReconnect: Int,
@JceId(5) @JvmField val testSpeed: Byte? = null, @TarsId(5) @JvmField val testSpeed: Byte? = null,
@JceId(6) @JvmField val useNewList: Byte? = null, @TarsId(6) @JvmField val useNewList: Byte? = null,
@JceId(7) @JvmField val iMultiConn: Int? = 1, @TarsId(7) @JvmField val iMultiConn: Int? = 1,
@JceId(8) @JvmField val vHttp2g3glist: List<SsoServerListInfo>? = null, @TarsId(8) @JvmField val vHttp2g3glist: List<SsoServerListInfo>? = null,
@JceId(9) @JvmField val vHttpWifilist: List<SsoServerListInfo>? = null @TarsId(9) @JvmField val vHttpWifilist: List<SsoServerListInfo>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class SsoServerListInfo( internal class SsoServerListInfo(
@JceId(1) @JvmField val sIP: String = "", @TarsId(1) @JvmField val sIP: String = "",
@JceId(2) @JvmField val iPort: Int, @TarsId(2) @JvmField val iPort: Int,
@JceId(3) @JvmField val linkType: Byte, @TarsId(3) @JvmField val linkType: Byte,
@JceId(4) @JvmField val proxy: Byte, @TarsId(4) @JvmField val proxy: Byte,
@JceId(5) @JvmField val protocolType: Byte? = null, @TarsId(5) @JvmField val protocolType: Byte? = null,
@JceId(6) @JvmField val iTimeOut: Int? = 10 @TarsId(6) @JvmField val iTimeOut: Int? = 10
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class TimeStamp( internal class TimeStamp(
@JceId(1) @JvmField val year: Int, @TarsId(1) @JvmField val year: Int,
@JceId(2) @JvmField val month: Byte, @TarsId(2) @JvmField val month: Byte,
@JceId(3) @JvmField val day: Byte, @TarsId(3) @JvmField val day: Byte,
@JceId(4) @JvmField val hour: Byte @TarsId(4) @JvmField val hour: Byte
) : JceStruct ) : JceStruct

View File

@@ -1,175 +1,175 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class ModifyGroupCardReq( internal class ModifyGroupCardReq(
@JceId(0) @JvmField val dwZero: Long, @TarsId(0) @JvmField val dwZero: Long,
@JceId(1) @JvmField val dwGroupCode: Long, @TarsId(1) @JvmField val dwGroupCode: Long,
@JceId(2) @JvmField val dwNewSeq: Long, @TarsId(2) @JvmField val dwNewSeq: Long,
@JceId(3) @JvmField val vecUinInfo: List<stUinInfo> @TarsId(3) @JvmField val vecUinInfo: List<stUinInfo>
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class stUinInfo( internal class stUinInfo(
@JceId(0) @JvmField val dwuin: Long, @TarsId(0) @JvmField val dwuin: Long,
@JceId(1) @JvmField val dwFlag: Long, @TarsId(1) @JvmField val dwFlag: Long,
@JceId(2) @JvmField val sName: String = "", @TarsId(2) @JvmField val sName: String = "",
@JceId(3) @JvmField val gender: Byte, @TarsId(3) @JvmField val gender: Byte,
@JceId(4) @JvmField val sPhone: String = "", @TarsId(4) @JvmField val sPhone: String = "",
@JceId(5) @JvmField val sEmail: String = "", @TarsId(5) @JvmField val sEmail: String = "",
@JceId(6) @JvmField val sRemark: String = "" @TarsId(6) @JvmField val sRemark: String = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GetFriendListReq( internal class GetFriendListReq(
@JceId(0) @JvmField val reqtype: Int? = null, @TarsId(0) @JvmField val reqtype: Int? = null,
@JceId(1) @JvmField val ifReflush: Byte? = null, @TarsId(1) @JvmField val ifReflush: Byte? = null,
@JceId(2) @JvmField val uin: Long? = null, @TarsId(2) @JvmField val uin: Long? = null,
@JceId(3) @JvmField val startIndex: Short? = null, @TarsId(3) @JvmField val startIndex: Short? = null,
@JceId(4) @JvmField val getfriendCount: Short? = null, @TarsId(4) @JvmField val getfriendCount: Short? = null,
@JceId(5) @JvmField val groupid: Byte? = null, @TarsId(5) @JvmField val groupid: Byte? = null,
@JceId(6) @JvmField val ifGetGroupInfo: Byte? = null, @TarsId(6) @JvmField val ifGetGroupInfo: Byte? = null,
@JceId(7) @JvmField val groupstartIndex: Byte? = null, @TarsId(7) @JvmField val groupstartIndex: Byte? = null,
@JceId(8) @JvmField val getgroupCount: Byte? = null, @TarsId(8) @JvmField val getgroupCount: Byte? = null,
@JceId(9) @JvmField val ifGetMSFGroup: Byte? = null, @TarsId(9) @JvmField val ifGetMSFGroup: Byte? = null,
@JceId(10) @JvmField val ifShowTermType: Byte? = null, @TarsId(10) @JvmField val ifShowTermType: Byte? = null,
@JceId(11) @JvmField val version: Long? = null, @TarsId(11) @JvmField val version: Long? = null,
@JceId(12) @JvmField val uinList: List<Long>? = null, @TarsId(12) @JvmField val uinList: List<Long>? = null,
@JceId(13) @JvmField val eAppType: Int = 0, @TarsId(13) @JvmField val eAppType: Int = 0,
@JceId(14) @JvmField val ifGetDOVId: Byte? = null, @TarsId(14) @JvmField val ifGetDOVId: Byte? = null,
@JceId(15) @JvmField val ifGetBothFlag: Byte? = null, @TarsId(15) @JvmField val ifGetBothFlag: Byte? = null,
@JceId(16) @JvmField val vec0xd50Req: ByteArray? = null, @TarsId(16) @JvmField val vec0xd50Req: ByteArray? = null,
@JceId(17) @JvmField val vec0xd6bReq: ByteArray? = null, @TarsId(17) @JvmField val vec0xd6bReq: ByteArray? = null,
@JceId(18) @JvmField val vecSnsTypelist: List<Long>? = null @TarsId(18) @JvmField val vecSnsTypelist: List<Long>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GetFriendListResp( internal class GetFriendListResp(
@JceId(0) @JvmField val reqtype: Int, @TarsId(0) @JvmField val reqtype: Int,
@JceId(1) @JvmField val ifReflush: Byte, @TarsId(1) @JvmField val ifReflush: Byte,
@JceId(2) @JvmField val uin: Long, @TarsId(2) @JvmField val uin: Long,
@JceId(3) @JvmField val startIndex: Short, @TarsId(3) @JvmField val startIndex: Short,
@JceId(4) @JvmField val getfriendCount: Short, @TarsId(4) @JvmField val getfriendCount: Short,
@JceId(5) @JvmField val totoalFriendCount: Short, @TarsId(5) @JvmField val totoalFriendCount: Short,
@JceId(6) @JvmField val friendCount: Short, @TarsId(6) @JvmField val friendCount: Short,
@JceId(7) @JvmField val vecFriendInfo: List<FriendInfo>? = null, @TarsId(7) @JvmField val vecFriendInfo: List<FriendInfo>? = null,
@JceId(8) @JvmField val groupid: Byte? = null, @TarsId(8) @JvmField val groupid: Byte? = null,
@JceId(9) @JvmField val ifGetGroupInfo: Byte, @TarsId(9) @JvmField val ifGetGroupInfo: Byte,
@JceId(10) @JvmField val groupstartIndex: Byte? = null, @TarsId(10) @JvmField val groupstartIndex: Byte? = null,
@JceId(11) @JvmField val getgroupCount: Byte? = null, @TarsId(11) @JvmField val getgroupCount: Byte? = null,
@JceId(12) @JvmField val totoalGroupCount: Short? = null, @TarsId(12) @JvmField val totoalGroupCount: Short? = null,
@JceId(13) @JvmField val groupCount: Byte? = null, @TarsId(13) @JvmField val groupCount: Byte? = null,
@JceId(14) @JvmField val vecGroupInfo: List<GroupInfo>? = null, @TarsId(14) @JvmField val vecGroupInfo: List<GroupInfo>? = null,
@JceId(15) @JvmField val result: Int, @TarsId(15) @JvmField val result: Int,
@JceId(16) @JvmField val errorCode: Short? = null, @TarsId(16) @JvmField val errorCode: Short? = null,
@JceId(17) @JvmField val onlineFriendCount: Short? = null, @TarsId(17) @JvmField val onlineFriendCount: Short? = null,
@JceId(18) @JvmField val serverTime: Long? = null, @TarsId(18) @JvmField val serverTime: Long? = null,
@JceId(19) @JvmField val sqqOnLineCount: Short? = null, @TarsId(19) @JvmField val sqqOnLineCount: Short? = null,
@JceId(20) @JvmField val vecMSFGroupInfo: List<GroupInfo>? = null, @TarsId(20) @JvmField val vecMSFGroupInfo: List<GroupInfo>? = null,
@JceId(21) @JvmField val respType: Byte? = null, @TarsId(21) @JvmField val respType: Byte? = null,
@JceId(22) @JvmField val hasOtherRespFlag: Byte? = null, @TarsId(22) @JvmField val hasOtherRespFlag: Byte? = null,
@JceId(23) @JvmField val stSelfInfo: FriendInfo? = null, @TarsId(23) @JvmField val stSelfInfo: FriendInfo? = null,
@JceId(24) @JvmField val showPcIcon: Byte? = null, @TarsId(24) @JvmField val showPcIcon: Byte? = null,
@JceId(25) @JvmField val wGetExtSnsRspCode: Short? = null, @TarsId(25) @JvmField val wGetExtSnsRspCode: Short? = null,
@JceId(26) @JvmField val stSubSrvRspCode: FriendListSubSrvRspCode? = null @TarsId(26) @JvmField val stSubSrvRspCode: FriendListSubSrvRspCode? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FriendListSubSrvRspCode( internal class FriendListSubSrvRspCode(
@JceId(0) @JvmField val wGetMutualMarkRspCode: Short? = null, @TarsId(0) @JvmField val wGetMutualMarkRspCode: Short? = null,
@JceId(1) @JvmField val wGetIntimateInfoRspCode: Short? = null @TarsId(1) @JvmField val wGetIntimateInfoRspCode: Short? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FriendInfo( internal class FriendInfo(
@JceId(0) @JvmField val friendUin: Long, @TarsId(0) @JvmField val friendUin: Long,
@JceId(1) @JvmField val groupId: Byte, @TarsId(1) @JvmField val groupId: Byte,
@JceId(2) @JvmField val faceId: Short, @TarsId(2) @JvmField val faceId: Short,
@JceId(3) @JvmField val remark: String = "", @TarsId(3) @JvmField val remark: String = "",
@JceId(4) @JvmField val sqqtype: Byte, @TarsId(4) @JvmField val sqqtype: Byte,
@JceId(5) @JvmField val status: Byte = 20, @TarsId(5) @JvmField val status: Byte = 20,
@JceId(6) @JvmField val memberLevel: Byte? = null, @TarsId(6) @JvmField val memberLevel: Byte? = null,
@JceId(7) @JvmField val isMqqOnLine: Byte? = null, @TarsId(7) @JvmField val isMqqOnLine: Byte? = null,
@JceId(8) @JvmField val sqqOnLineState: Byte? = null, @TarsId(8) @JvmField val sqqOnLineState: Byte? = null,
@JceId(9) @JvmField val isIphoneOnline: Byte? = null, @TarsId(9) @JvmField val isIphoneOnline: Byte? = null,
@JceId(10) @JvmField val detalStatusFlag: Byte? = null, @TarsId(10) @JvmField val detalStatusFlag: Byte? = null,
@JceId(11) @JvmField val sqqOnLineStateV2: Byte? = null, @TarsId(11) @JvmField val sqqOnLineStateV2: Byte? = null,
@JceId(12) @JvmField val sShowName: String? = "", @TarsId(12) @JvmField val sShowName: String? = "",
@JceId(13) @JvmField val isRemark: Byte? = null, @TarsId(13) @JvmField val isRemark: Byte? = null,
@JceId(14) @JvmField val nick: String = "", @TarsId(14) @JvmField val nick: String = "",
@JceId(15) @JvmField val specialFlag: Byte? = null, @TarsId(15) @JvmField val specialFlag: Byte? = null,
@JceId(16) @JvmField val vecIMGroupID: ByteArray? = null, @TarsId(16) @JvmField val vecIMGroupID: ByteArray? = null,
@JceId(17) @JvmField val vecMSFGroupID: ByteArray? = null, @TarsId(17) @JvmField val vecMSFGroupID: ByteArray? = null,
@JceId(18) @JvmField val iTermType: Int? = null, @TarsId(18) @JvmField val iTermType: Int? = null,
@JceId(19) @JvmField val oVipInfo: VipBaseInfo? = null, //? bad @TarsId(19) @JvmField val oVipInfo: VipBaseInfo? = null, //? bad
@JceId(20) @JvmField val network: Byte? = null, @TarsId(20) @JvmField val network: Byte? = null,
@JceId(21) @JvmField val vecRing: ByteArray? = null, @TarsId(21) @JvmField val vecRing: ByteArray? = null,
@JceId(22) @JvmField val uAbiFlag: Long? = null, @TarsId(22) @JvmField val uAbiFlag: Long? = null,
@JceId(23) @JvmField val ulFaceAddonId: Long? = null, @TarsId(23) @JvmField val ulFaceAddonId: Long? = null,
@JceId(24) @JvmField val eNetworkType: Int? = 0, @TarsId(24) @JvmField val eNetworkType: Int? = 0,
@JceId(25) @JvmField val uVipFont: Long? = null, @TarsId(25) @JvmField val uVipFont: Long? = null,
@JceId(26) @JvmField val eIconType: Int? = 0, @TarsId(26) @JvmField val eIconType: Int? = 0,
@JceId(27) @JvmField val termDesc: String? = "", @TarsId(27) @JvmField val termDesc: String? = "",
@JceId(28) @JvmField val uColorRing: Long? = null, @TarsId(28) @JvmField val uColorRing: Long? = null,
@JceId(29) @JvmField val apolloFlag: Byte? = null, @TarsId(29) @JvmField val apolloFlag: Byte? = null,
@JceId(30) @JvmField val uApolloTimestamp: Long? = null, @TarsId(30) @JvmField val uApolloTimestamp: Long? = null,
@JceId(31) @JvmField val sex: Byte? = null, @TarsId(31) @JvmField val sex: Byte? = null,
@JceId(32) @JvmField val uFounderFont: Long? = null, @TarsId(32) @JvmField val uFounderFont: Long? = null,
@JceId(33) @JvmField val eimId: String? = "", @TarsId(33) @JvmField val eimId: String? = "",
@JceId(34) @JvmField val eimMobile: String? = "", @TarsId(34) @JvmField val eimMobile: String? = "",
@JceId(35) @JvmField val olympicTorch: Byte? = null, @TarsId(35) @JvmField val olympicTorch: Byte? = null,
@JceId(36) @JvmField val uApolloSignTime: Long? = null, @TarsId(36) @JvmField val uApolloSignTime: Long? = null,
@JceId(37) @JvmField val uLaviUin: Long? = null, @TarsId(37) @JvmField val uLaviUin: Long? = null,
@JceId(38) @JvmField val uTagUpdateTime: Long? = null, @TarsId(38) @JvmField val uTagUpdateTime: Long? = null,
@JceId(39) @JvmField val uGameLastLoginTime: Long? = null, @TarsId(39) @JvmField val uGameLastLoginTime: Long? = null,
@JceId(40) @JvmField val uGameAppid: Long? = null, @TarsId(40) @JvmField val uGameAppid: Long? = null,
@JceId(41) @JvmField val vecCardID: ByteArray? = null, @TarsId(41) @JvmField val vecCardID: ByteArray? = null,
@JceId(42) @JvmField val ulBitSet: Long? = null, @TarsId(42) @JvmField val ulBitSet: Long? = null,
@JceId(43) @JvmField val kingOfGloryFlag: Byte? = null, @TarsId(43) @JvmField val kingOfGloryFlag: Byte? = null,
@JceId(44) @JvmField val ulKingOfGloryRank: Long? = null, @TarsId(44) @JvmField val ulKingOfGloryRank: Long? = null,
@JceId(45) @JvmField val masterUin: String? = "", @TarsId(45) @JvmField val masterUin: String? = "",
@JceId(46) @JvmField val uLastMedalUpdateTime: Long? = null, @TarsId(46) @JvmField val uLastMedalUpdateTime: Long? = null,
@JceId(47) @JvmField val uFaceStoreId: Long? = null, @TarsId(47) @JvmField val uFaceStoreId: Long? = null,
@JceId(48) @JvmField val uFontEffect: Long? = null, @TarsId(48) @JvmField val uFontEffect: Long? = null,
@JceId(49) @JvmField val sDOVId: String? = "", @TarsId(49) @JvmField val sDOVId: String? = "",
@JceId(50) @JvmField val uBothFlag: Long? = null, @TarsId(50) @JvmField val uBothFlag: Long? = null,
@JceId(51) @JvmField val centiShow3DFlag: Byte? = null, @TarsId(51) @JvmField val centiShow3DFlag: Byte? = null,
@JceId(52) @JvmField val vecIntimateInfo: ByteArray? = null, @TarsId(52) @JvmField val vecIntimateInfo: ByteArray? = null,
@JceId(53) @JvmField val showNameplate: Byte? = null, @TarsId(53) @JvmField val showNameplate: Byte? = null,
@JceId(54) @JvmField val newLoverDiamondFlag: Byte? = null, @TarsId(54) @JvmField val newLoverDiamondFlag: Byte? = null,
@JceId(55) @JvmField val vecExtSnsFrdData: ByteArray? = null, @TarsId(55) @JvmField val vecExtSnsFrdData: ByteArray? = null,
@JceId(56) @JvmField val vecMutualMarkData: ByteArray? = null @TarsId(56) @JvmField val vecMutualMarkData: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class VipBaseInfo( internal class VipBaseInfo(
@JceId(0) @JvmField val mOpenInfo: Map<Int, VipOpenInfo>? = null, @TarsId(0) @JvmField val mOpenInfo: Map<Int, VipOpenInfo>? = null,
// 1, 2 are since 8.2.7 // 1, 2 are since 8.2.7
@JceId(1) @JvmField val iNameplateVipType: Int? = 0, @TarsId(1) @JvmField val iNameplateVipType: Int? = 0,
@JceId(2) @JvmField val iGrayNameplateFlag: Int? = 0 @TarsId(2) @JvmField val iGrayNameplateFlag: Int? = 0
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class VipOpenInfo( internal class VipOpenInfo(
@JceId(0) @JvmField val open: Boolean? = false, @TarsId(0) @JvmField val open: Boolean? = false,
@JceId(1) @JvmField val iVipType: Int = -1, @TarsId(1) @JvmField val iVipType: Int = -1,
@JceId(2) @JvmField val iVipLevel: Int = -1, @TarsId(2) @JvmField val iVipLevel: Int = -1,
@JceId(3) @JvmField val iVipFlag: Int? = null, @TarsId(3) @JvmField val iVipFlag: Int? = null,
@JceId(4) @JvmField val nameplateId: Long? = null @TarsId(4) @JvmField val nameplateId: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GroupInfo( internal class GroupInfo(
@JceId(0) @JvmField val groupId: Byte, @TarsId(0) @JvmField val groupId: Byte,
@JceId(1) @JvmField val groupname: String = "", @TarsId(1) @JvmField val groupname: String = "",
@JceId(2) @JvmField val friendCount: Int, @TarsId(2) @JvmField val friendCount: Int,
@JceId(3) @JvmField val onlineFriendCount: Int, @TarsId(3) @JvmField val onlineFriendCount: Int,
@JceId(4) @JvmField val seqid: Byte? = null, @TarsId(4) @JvmField val seqid: Byte? = null,
@JceId(5) @JvmField val sqqOnLineCount: Int? = null @TarsId(5) @JvmField val sqqOnLineCount: Int? = null
) : JceStruct ) : JceStruct

View File

@@ -1,43 +1,43 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class GroupMngReqJce( internal class GroupMngReqJce(
@JceId(0) @JvmField val reqtype: Int, @TarsId(0) @JvmField val reqtype: Int,
@JceId(1) @JvmField val uin: Long, @TarsId(1) @JvmField val uin: Long,
@JceId(2) @JvmField val vecBody: ByteArray, @TarsId(2) @JvmField val vecBody: ByteArray,
@JceId(3) @JvmField val checkInGroup: Byte? = null, @TarsId(3) @JvmField val checkInGroup: Byte? = null,
@JceId(4) @JvmField val sGroupLocation: String? = "", @TarsId(4) @JvmField val sGroupLocation: String? = "",
@JceId(5) @JvmField val statOption: Byte? = null, @TarsId(5) @JvmField val statOption: Byte? = null,
@JceId(6) @JvmField val wSourceID: Int? = null, @TarsId(6) @JvmField val wSourceID: Int? = null,
@JceId(7) @JvmField val wSourceSubID: Int? = null, @TarsId(7) @JvmField val wSourceSubID: Int? = null,
@JceId(8) @JvmField val isSupportAuthQuestionJoin: Byte? = null, @TarsId(8) @JvmField val isSupportAuthQuestionJoin: Byte? = null,
@JceId(9) @JvmField val ifGetAuthInfo: Byte? = null, @TarsId(9) @JvmField val ifGetAuthInfo: Byte? = null,
@JceId(10) @JvmField val dwDiscussUin: Long? = null, @TarsId(10) @JvmField val dwDiscussUin: Long? = null,
@JceId(11) @JvmField val sJoinGroupKey: String? = "", @TarsId(11) @JvmField val sJoinGroupKey: String? = "",
@JceId(12) @JvmField val sJoinGroupPicUrl: String? = "", @TarsId(12) @JvmField val sJoinGroupPicUrl: String? = "",
@JceId(13) @JvmField val vecJoinGroupRichMsg: ByteArray? = null, @TarsId(13) @JvmField val vecJoinGroupRichMsg: ByteArray? = null,
@JceId(14) @JvmField val sJoinGroupAuth: String? = "", @TarsId(14) @JvmField val sJoinGroupAuth: String? = "",
@JceId(15) @JvmField val sJoinGroupVerifyToken: String? = "", @TarsId(15) @JvmField val sJoinGroupVerifyToken: String? = "",
@JceId(16) @JvmField val dwJoinVerifyType: Long? = null @TarsId(16) @JvmField val dwJoinVerifyType: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GroupMngRes( internal class GroupMngRes(
@JceId(0) @JvmField val reqtype: Int, @TarsId(0) @JvmField val reqtype: Int,
@JceId(1) @JvmField val result: Byte, @TarsId(1) @JvmField val result: Byte,
@JceId(2) @JvmField val vecBody: ByteArray, @TarsId(2) @JvmField val vecBody: ByteArray,
@JceId(3) @JvmField val errorString: String = "", @TarsId(3) @JvmField val errorString: String = "",
@JceId(4) @JvmField val errorCode: Short = 0, @TarsId(4) @JvmField val errorCode: Short = 0,
@JceId(5) @JvmField val isInGroup: Byte? = null, @TarsId(5) @JvmField val isInGroup: Byte? = null,
@JceId(6) @JvmField val sGroupLocation: String? = "", @TarsId(6) @JvmField val sGroupLocation: String? = "",
@JceId(7) @JvmField val isMemInvite: Byte? = null, @TarsId(7) @JvmField val isMemInvite: Byte? = null,
@JceId(8) @JvmField val sAuthGrpInfo: String? = "", @TarsId(8) @JvmField val sAuthGrpInfo: String? = "",
@JceId(9) @JvmField val sJoinQuestion: String? = "", @TarsId(9) @JvmField val sJoinQuestion: String? = "",
@JceId(10) @JvmField val sJoinAnswer: String? = "", @TarsId(10) @JvmField val sJoinAnswer: String? = "",
@JceId(11) @JvmField val dwDis2GrpLimitType: Long? = null @TarsId(11) @JvmField val dwDis2GrpLimitType: Long? = null
) : JceStruct ) : JceStruct

View File

@@ -1,216 +1,216 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class AddGroup( internal class AddGroup(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val dwSortID: Long? = null, @TarsId(1) @JvmField val dwSortID: Long? = null,
@JceId(2) @JvmField val groupName: String? = "" @TarsId(2) @JvmField val groupName: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DelGroup( internal class DelGroup(
@JceId(0) @JvmField val dwGroupID: Long? = null @TarsId(0) @JvmField val dwGroupID: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FriendGroup( internal class FriendGroup(
@JceId(0) @JvmField val dwFuin: Long? = null, @TarsId(0) @JvmField val dwFuin: Long? = null,
@JceId(1) @JvmField val vOldGroupID: List<Long>? = null, @TarsId(1) @JvmField val vOldGroupID: List<Long>? = null,
@JceId(2) @JvmField val vNewGroupID: List<Long>? = null @TarsId(2) @JvmField val vNewGroupID: List<Long>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GroupSort( internal class GroupSort(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val dwSortID: Long? = null @TarsId(1) @JvmField val dwSortID: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MarketFaceInfo( internal class MarketFaceInfo(
@JceId(0) @JvmField val insertIdx: Long, @TarsId(0) @JvmField val insertIdx: Long,
@JceId(1) @JvmField val marketFaceBuff: ByteArray @TarsId(1) @JvmField val marketFaceBuff: ByteArray
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModFriendGroup( internal class ModFriendGroup(
@JceId(0) @JvmField val vMsgFrdGroup: List<FriendGroup>? = null @TarsId(0) @JvmField val vMsgFrdGroup: List<FriendGroup>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModGroupName( internal class ModGroupName(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val groupName: String? = "" @TarsId(1) @JvmField val groupName: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModGroupSort( internal class ModGroupSort(
@JceId(0) @JvmField val vMsgGroupSort: List<GroupSort>? = null @TarsId(0) @JvmField val vMsgGroupSort: List<GroupSort>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210( internal class MsgType0x210(
@JceId(0) @JvmField val uSubMsgType: Long, @TarsId(0) @JvmField val uSubMsgType: Long,
@JceId(1) @JvmField val stMsgInfo0x2: MsgType0x210SubMsgType0x2? = null, @TarsId(1) @JvmField val stMsgInfo0x2: MsgType0x210SubMsgType0x2? = null,
@JceId(3) @JvmField val stMsgInfo0xa: MsgType0x210SubMsgType0xa? = null, @TarsId(3) @JvmField val stMsgInfo0xa: MsgType0x210SubMsgType0xa? = null,
@JceId(4) @JvmField val stMsgInfo0xe: MsgType0x210SubMsgType0xe? = null, @TarsId(4) @JvmField val stMsgInfo0xe: MsgType0x210SubMsgType0xe? = null,
@JceId(5) @JvmField val stMsgInfo0x13: MsgType0x210SubMsgType0x13? = null, @TarsId(5) @JvmField val stMsgInfo0x13: MsgType0x210SubMsgType0x13? = null,
@JceId(6) @JvmField val stMsgInfo0x17: MsgType0x210SubMsgType0x17? = null, @TarsId(6) @JvmField val stMsgInfo0x17: MsgType0x210SubMsgType0x17? = null,
@JceId(7) @JvmField val stMsgInfo0x20: MsgType0x210SubMsgType0x20? = null, @TarsId(7) @JvmField val stMsgInfo0x20: MsgType0x210SubMsgType0x20? = null,
@JceId(8) @JvmField val stMsgInfo0x1d: MsgType0x210SubMsgType0x1d? = null, @TarsId(8) @JvmField val stMsgInfo0x1d: MsgType0x210SubMsgType0x1d? = null,
@JceId(9) @JvmField val stMsgInfo0x24: MsgType0x210SubMsgType0x24? = null, @TarsId(9) @JvmField val stMsgInfo0x24: MsgType0x210SubMsgType0x24? = null,
@JceId(10) @JvmField val vProtobuf: ByteArray = EMPTY_BYTE_ARRAY @TarsId(10) @JvmField val vProtobuf: ByteArray = EMPTY_BYTE_ARRAY
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x13( internal class MsgType0x210SubMsgType0x13(
@JceId(0) @JvmField val uint32SrcAppId: Long? = null, @TarsId(0) @JvmField val uint32SrcAppId: Long? = null,
@JceId(1) @JvmField val uint32SrcInstId: Long? = null, @TarsId(1) @JvmField val uint32SrcInstId: Long? = null,
@JceId(2) @JvmField val uint32DstAppId: Long? = null, @TarsId(2) @JvmField val uint32DstAppId: Long? = null,
@JceId(3) @JvmField val uint32DstInstId: Long? = null, @TarsId(3) @JvmField val uint32DstInstId: Long? = null,
@JceId(4) @JvmField val uint64DstUin: Long? = null, @TarsId(4) @JvmField val uint64DstUin: Long? = null,
@JceId(5) @JvmField val uint64Sessionid: Long? = null, @TarsId(5) @JvmField val uint64Sessionid: Long? = null,
@JceId(6) @JvmField val uint32Size: Long? = null, @TarsId(6) @JvmField val uint32Size: Long? = null,
@JceId(7) @JvmField val uint32Index: Long? = null, @TarsId(7) @JvmField val uint32Index: Long? = null,
@JceId(8) @JvmField val uint32Type: Long? = null, @TarsId(8) @JvmField val uint32Type: Long? = null,
@JceId(9) @JvmField val buf: ByteArray? = null @TarsId(9) @JvmField val buf: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x13_MsgItem( internal class MsgType0x210SubMsgType0x13_MsgItem(
@JceId(0) @JvmField val uint32Type: Long? = null, @TarsId(0) @JvmField val uint32Type: Long? = null,
@JceId(1) @JvmField val text: ByteArray? = null @TarsId(1) @JvmField val text: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x17( internal class MsgType0x210SubMsgType0x17(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val stAddGroup: AddGroup? = null, @TarsId(1) @JvmField val stAddGroup: AddGroup? = null,
@JceId(2) @JvmField val stDelGroup: DelGroup? = null, @TarsId(2) @JvmField val stDelGroup: DelGroup? = null,
@JceId(3) @JvmField val stModGroupName: ModGroupName? = null, @TarsId(3) @JvmField val stModGroupName: ModGroupName? = null,
@JceId(4) @JvmField val stModGroupSort: ModGroupSort? = null, @TarsId(4) @JvmField val stModGroupSort: ModGroupSort? = null,
@JceId(5) @JvmField val stModFriendGroup: ModFriendGroup? = null @TarsId(5) @JvmField val stModFriendGroup: ModFriendGroup? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x1d( internal class MsgType0x210SubMsgType0x1d(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val dwUin: Long? = null, @TarsId(1) @JvmField val dwUin: Long? = null,
@JceId(2) @JvmField val dwID: Long? = null, @TarsId(2) @JvmField val dwID: Long? = null,
@JceId(3) @JvmField val value: String? = "" @TarsId(3) @JvmField val value: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x2( internal class MsgType0x210SubMsgType0x2(
@JceId(0) @JvmField val uSrcAppId: Long? = null, @TarsId(0) @JvmField val uSrcAppId: Long? = null,
@JceId(1) @JvmField val uSrcInstId: Long? = null, @TarsId(1) @JvmField val uSrcInstId: Long? = null,
@JceId(2) @JvmField val uDstAppId: Long? = null, @TarsId(2) @JvmField val uDstAppId: Long? = null,
@JceId(3) @JvmField val uDstInstId: Long? = null, @TarsId(3) @JvmField val uDstInstId: Long? = null,
@JceId(4) @JvmField val uDstUin: Long? = null, @TarsId(4) @JvmField val uDstUin: Long? = null,
@JceId(5) @JvmField val fileName: ByteArray? = null, @TarsId(5) @JvmField val fileName: ByteArray? = null,
@JceId(6) @JvmField val fileIndex: ByteArray? = null, @TarsId(6) @JvmField val fileIndex: ByteArray? = null,
@JceId(7) @JvmField val fileMd5: ByteArray? = null, @TarsId(7) @JvmField val fileMd5: ByteArray? = null,
@JceId(8) @JvmField val fileKey: ByteArray? = null, @TarsId(8) @JvmField val fileKey: ByteArray? = null,
@JceId(9) @JvmField val uServerIp: Long? = null, @TarsId(9) @JvmField val uServerIp: Long? = null,
@JceId(10) @JvmField val uServerPort: Long? = null, @TarsId(10) @JvmField val uServerPort: Long? = null,
@JceId(11) @JvmField val fileLen: Long? = null, @TarsId(11) @JvmField val fileLen: Long? = null,
@JceId(12) @JvmField val sessionId: Long? = null, @TarsId(12) @JvmField val sessionId: Long? = null,
@JceId(13) @JvmField val originfileMd5: ByteArray? = null, @TarsId(13) @JvmField val originfileMd5: ByteArray? = null,
@JceId(14) @JvmField val uOriginfiletype: Long? = null, @TarsId(14) @JvmField val uOriginfiletype: Long? = null,
@JceId(15) @JvmField val uSeq: Long? = null @TarsId(15) @JvmField val uSeq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x20( internal class MsgType0x210SubMsgType0x20(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val dwType: Long? = null, @TarsId(1) @JvmField val dwType: Long? = null,
@JceId(2) @JvmField val dwUin: Long? = null, @TarsId(2) @JvmField val dwUin: Long? = null,
@JceId(3) @JvmField val remaek: String? = "" @TarsId(3) @JvmField val remaek: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x24( internal class MsgType0x210SubMsgType0x24(
@JceId(0) @JvmField val vPluginNumList: List<PluginNum>? = null @TarsId(0) @JvmField val vPluginNumList: List<PluginNum>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0xa( internal class MsgType0x210SubMsgType0xa(
@JceId(0) @JvmField val uSrcAppId: Long? = null, @TarsId(0) @JvmField val uSrcAppId: Long? = null,
@JceId(1) @JvmField val uSrcInstId: Long? = null, @TarsId(1) @JvmField val uSrcInstId: Long? = null,
@JceId(2) @JvmField val uDstAppId: Long? = null, @TarsId(2) @JvmField val uDstAppId: Long? = null,
@JceId(3) @JvmField val uDstInstId: Long? = null, @TarsId(3) @JvmField val uDstInstId: Long? = null,
@JceId(4) @JvmField val uDstUin: Long? = null, @TarsId(4) @JvmField val uDstUin: Long? = null,
@JceId(5) @JvmField val uType: Long? = null, @TarsId(5) @JvmField val uType: Long? = null,
@JceId(6) @JvmField val uServerIp: Long? = null, @TarsId(6) @JvmField val uServerIp: Long? = null,
@JceId(7) @JvmField val uServerPort: Long? = null, @TarsId(7) @JvmField val uServerPort: Long? = null,
@JceId(8) @JvmField val vUrlNotify: ByteArray? = null, @TarsId(8) @JvmField val vUrlNotify: ByteArray? = null,
@JceId(9) @JvmField val vTokenKey: ByteArray? = null, @TarsId(9) @JvmField val vTokenKey: ByteArray? = null,
@JceId(10) @JvmField val uFileLen: Long? = null, @TarsId(10) @JvmField val uFileLen: Long? = null,
@JceId(11) @JvmField val fileName: ByteArray? = null, @TarsId(11) @JvmField val fileName: ByteArray? = null,
@JceId(12) @JvmField val vMd5: ByteArray? = null, @TarsId(12) @JvmField val vMd5: ByteArray? = null,
@JceId(13) @JvmField val sessionId: Long? = null, @TarsId(13) @JvmField val sessionId: Long? = null,
@JceId(14) @JvmField val originfileMd5: ByteArray? = null, @TarsId(14) @JvmField val originfileMd5: ByteArray? = null,
@JceId(15) @JvmField val uOriginfiletype: Long? = null, @TarsId(15) @JvmField val uOriginfiletype: Long? = null,
@JceId(16) @JvmField val uSeq: Long? = null @TarsId(16) @JvmField val uSeq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0xe( internal class MsgType0x210SubMsgType0xe(
@JceId(0) @JvmField val uint32SrcAppId: Long? = null, @TarsId(0) @JvmField val uint32SrcAppId: Long? = null,
@JceId(1) @JvmField val uint32SrcInstId: Long? = null, @TarsId(1) @JvmField val uint32SrcInstId: Long? = null,
@JceId(2) @JvmField val uint32DstAppId: Long? = null, @TarsId(2) @JvmField val uint32DstAppId: Long? = null,
@JceId(3) @JvmField val uint32DstInstId: Long? = null, @TarsId(3) @JvmField val uint32DstInstId: Long? = null,
@JceId(4) @JvmField val uint64DstUin: Long? = null, @TarsId(4) @JvmField val uint64DstUin: Long? = null,
@JceId(5) @JvmField val uint64Sessionid: Long? = null, @TarsId(5) @JvmField val uint64Sessionid: Long? = null,
@JceId(6) @JvmField val uint32Operate: Long? = null, @TarsId(6) @JvmField val uint32Operate: Long? = null,
@JceId(7) @JvmField val uint32Seq: Long? = null, @TarsId(7) @JvmField val uint32Seq: Long? = null,
@JceId(8) @JvmField val uint32Code: Long? = null, @TarsId(8) @JvmField val uint32Code: Long? = null,
@JceId(9) @JvmField val msg: String? = "" @TarsId(9) @JvmField val msg: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class PersonInfoChange( internal class PersonInfoChange(
@JceId(0) @JvmField val type: Byte? = null, @TarsId(0) @JvmField val type: Byte? = null,
@JceId(1) @JvmField val vChgField: List<PersonInfoField>? = null @TarsId(1) @JvmField val vChgField: List<PersonInfoField>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class PersonInfoField( internal class PersonInfoField(
@JceId(0) @JvmField val uField: Long? = null @TarsId(0) @JvmField val uField: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class PluginNum( internal class PluginNum(
@JceId(0) @JvmField val dwID: Long? = null, @TarsId(0) @JvmField val dwID: Long? = null,
@JceId(1) @JvmField val dwNUm: Long? = null, @TarsId(1) @JvmField val dwNUm: Long? = null,
@JceId(2) @JvmField val flag: Byte? = null @TarsId(2) @JvmField val flag: Byte? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class SlaveMasterMsg( internal class SlaveMasterMsg(
@JceId(0) @JvmField val uMsgType: Long? = null, @TarsId(0) @JvmField val uMsgType: Long? = null,
@JceId(1) @JvmField val uCmd: Long? = null, @TarsId(1) @JvmField val uCmd: Long? = null,
@JceId(2) @JvmField val uSeq: Long? = null, @TarsId(2) @JvmField val uSeq: Long? = null,
@JceId(3) @JvmField val fromUin: Long? = null, @TarsId(3) @JvmField val fromUin: Long? = null,
@JceId(4) @JvmField val wFromApp: Short? = null, @TarsId(4) @JvmField val wFromApp: Short? = null,
@JceId(5) @JvmField val uFromInstId: Long? = null, @TarsId(5) @JvmField val uFromInstId: Long? = null,
@JceId(6) @JvmField val toUin: Long? = null, @TarsId(6) @JvmField val toUin: Long? = null,
@JceId(7) @JvmField val wToApp: Short? = null, @TarsId(7) @JvmField val wToApp: Short? = null,
@JceId(8) @JvmField val uToInstId: Long? = null, @TarsId(8) @JvmField val uToInstId: Long? = null,
@JceId(9) @JvmField val vOrigMsg: ByteArray? = null, @TarsId(9) @JvmField val vOrigMsg: ByteArray? = null,
@JceId(10) @JvmField val uLastChangeTime: Long? = null, @TarsId(10) @JvmField val uLastChangeTime: Long? = null,
@JceId(11) @JvmField val vReserved: ByteArray? = null, @TarsId(11) @JvmField val vReserved: ByteArray? = null,
@JceId(12) @JvmField val vMarketFace: List<MarketFaceInfo>? = null, @TarsId(12) @JvmField val vMarketFace: List<MarketFaceInfo>? = null,
@JceId(13) @JvmField val uSuperQQBubbleId: Long? = null @TarsId(13) @JvmField val uSuperQQBubbleId: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class Type_1_QQDataTextMsg( internal class Type_1_QQDataTextMsg(
@JceId(0) @JvmField val msgItem: List<MsgType0x210SubMsgType0x13_MsgItem>? = null @TarsId(0) @JvmField val msgItem: List<MsgType0x210SubMsgType0x13_MsgItem>? = null
) : JceStruct ) : JceStruct

View File

@@ -1,250 +1,250 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
internal class OnlinePushPack { internal class OnlinePushPack {
@Serializable @Serializable
internal class DelMsgInfo( internal class DelMsgInfo(
@JceId(0) @JvmField val fromUin: Long, @TarsId(0) @JvmField val fromUin: Long,
@JceId(1) @JvmField val uMsgTime: Long, @TarsId(1) @JvmField val uMsgTime: Long,
@JceId(2) @JvmField val shMsgSeq: Short, @TarsId(2) @JvmField val shMsgSeq: Short,
@JceId(3) @JvmField val vMsgCookies: ByteArray? = null, @TarsId(3) @JvmField val vMsgCookies: ByteArray? = null,
@JceId(4) @JvmField val wCmd: Short? = null, @TarsId(4) @JvmField val wCmd: Short? = null,
@JceId(5) @JvmField val uMsgType: Long? = null, @TarsId(5) @JvmField val uMsgType: Long? = null,
@JceId(6) @JvmField val uAppId: Long? = null, @TarsId(6) @JvmField val uAppId: Long? = null,
@JceId(7) @JvmField val sendTime: Long? = null, @TarsId(7) @JvmField val sendTime: Long? = null,
@JceId(8) @JvmField val ssoSeq: Int? = null, @TarsId(8) @JvmField val ssoSeq: Int? = null,
@JceId(9) @JvmField val ssoIp: Int? = null, @TarsId(9) @JvmField val ssoIp: Int? = null,
@JceId(10) @JvmField val clientIp: Int? = null @TarsId(10) @JvmField val clientIp: Int? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DeviceInfo( internal class DeviceInfo(
@JceId(0) @JvmField val netType: Byte? = null, @TarsId(0) @JvmField val netType: Byte? = null,
@JceId(1) @JvmField val devType: String? = "", @TarsId(1) @JvmField val devType: String? = "",
@JceId(2) @JvmField val oSVer: String? = "", @TarsId(2) @JvmField val oSVer: String? = "",
@JceId(3) @JvmField val vendorName: String? = "", @TarsId(3) @JvmField val vendorName: String? = "",
@JceId(4) @JvmField val vendorOSName: String? = "", @TarsId(4) @JvmField val vendorOSName: String? = "",
@JceId(5) @JvmField val iOSIdfa: String? = "" @TarsId(5) @JvmField val iOSIdfa: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class Name( internal class Name(
@JceId(0) @JvmField val fromUin: Long, @TarsId(0) @JvmField val fromUin: Long,
@JceId(1) @JvmField val uMsgTime: Long, @TarsId(1) @JvmField val uMsgTime: Long,
@JceId(2) @JvmField val shMsgType: Short, @TarsId(2) @JvmField val shMsgType: Short,
@JceId(3) @JvmField val shMsgSeq: Short, @TarsId(3) @JvmField val shMsgSeq: Short,
@JceId(4) @JvmField val msg: String = "", @TarsId(4) @JvmField val msg: String = "",
@JceId(5) @JvmField val uRealMsgTime: Int? = null, @TarsId(5) @JvmField val uRealMsgTime: Int? = null,
@JceId(6) @JvmField val vMsg: ByteArray? = null, @TarsId(6) @JvmField val vMsg: ByteArray? = null,
@JceId(7) @JvmField val uAppShareID: Long? = null, @TarsId(7) @JvmField val uAppShareID: Long? = null,
@JceId(8) @JvmField val vMsgCookies: ByteArray? = null, @TarsId(8) @JvmField val vMsgCookies: ByteArray? = null,
@JceId(9) @JvmField val vAppShareCookie: ByteArray? = null, @TarsId(9) @JvmField val vAppShareCookie: ByteArray? = null,
@JceId(10) @JvmField val msgUid: Long? = null, @TarsId(10) @JvmField val msgUid: Long? = null,
@JceId(11) @JvmField val lastChangeTime: Long? = 1L, @TarsId(11) @JvmField val lastChangeTime: Long? = 1L,
@JceId(12) @JvmField val vCPicInfo: List<CPicInfo>? = null, @TarsId(12) @JvmField val vCPicInfo: List<CPicInfo>? = null,
@JceId(13) @JvmField val stShareData: ShareData? = null, @TarsId(13) @JvmField val stShareData: ShareData? = null,
@JceId(14) @JvmField val fromInstId: Long? = null, @TarsId(14) @JvmField val fromInstId: Long? = null,
@JceId(15) @JvmField val vRemarkOfSender: ByteArray? = null, @TarsId(15) @JvmField val vRemarkOfSender: ByteArray? = null,
@JceId(16) @JvmField val fromMobile: String? = "", @TarsId(16) @JvmField val fromMobile: String? = "",
@JceId(17) @JvmField val fromName: String? = "", @TarsId(17) @JvmField val fromName: String? = "",
@JceId(18) @JvmField val vNickName: List<String>? = null, @TarsId(18) @JvmField val vNickName: List<String>? = null,
@JceId(19) @JvmField val stC2CTmpMsgHead: TempMsgHead? = null @TarsId(19) @JvmField val stC2CTmpMsgHead: TempMsgHead? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class SvcReqPushMsg( internal class SvcReqPushMsg(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val uMsgTime: Long, @TarsId(1) @JvmField val uMsgTime: Long,
@JceId(2) @JvmField val vMsgInfos: List<MsgInfo>, @TarsId(2) @JvmField val vMsgInfos: List<MsgInfo>,
@JceId(3) @JvmField val svrip: Int? = 0, @TarsId(3) @JvmField val svrip: Int? = 0,
@JceId(4) @JvmField val vSyncCookie: ByteArray? = null, @TarsId(4) @JvmField val vSyncCookie: ByteArray? = null,
@JceId(5) @JvmField val vUinPairMsg: List<UinPairMsg>? = null, @TarsId(5) @JvmField val vUinPairMsg: List<UinPairMsg>? = null,
@JceId(6) @JvmField val mPreviews: Map<String, ByteArray>? = null @TarsId(6) @JvmField val mPreviews: Map<String, ByteArray>? = null
// @SerialId(7) @JvmField val wUserActive: Int? = null, // @SerialId(7) @JvmField val wUserActive: Int? = null,
//@SerialId(12) @JvmField val wGeneralFlag: Int? = null //@SerialId(12) @JvmField val wGeneralFlag: Int? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class SvcRespPushMsg( internal class SvcRespPushMsg(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val vDelInfos: List<DelMsgInfo>, @TarsId(1) @JvmField val vDelInfos: List<DelMsgInfo>,
@JceId(2) @JvmField val svrip: Int = 0, @TarsId(2) @JvmField val svrip: Int = 0,
@JceId(3) @JvmField val pushToken: ByteArray? = null, @TarsId(3) @JvmField val pushToken: ByteArray? = null,
@JceId(4) @JvmField val serviceType: Int? = null, @TarsId(4) @JvmField val serviceType: Int? = null,
@JceId(5) @JvmField val deviceInfo: DeviceInfo? = null @TarsId(5) @JvmField val deviceInfo: DeviceInfo? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class UinPairMsg( internal class UinPairMsg(
@JceId(1) @JvmField val uLastReadTime: Long? = null, @TarsId(1) @JvmField val uLastReadTime: Long? = null,
@JceId(2) @JvmField val peerUin: Long? = null, @TarsId(2) @JvmField val peerUin: Long? = null,
@JceId(3) @JvmField val uMsgCompleted: Long? = null, @TarsId(3) @JvmField val uMsgCompleted: Long? = null,
@JceId(4) @JvmField val vMsgInfos: List<MsgInfo>? = null @TarsId(4) @JvmField val vMsgInfos: List<MsgInfo>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210( internal class MsgType0x210(
@JceId(0) @JvmField val uSubMsgType: Long, @TarsId(0) @JvmField val uSubMsgType: Long,
@JceId(1) @JvmField val stMsgInfo0x2: MsgType0x210SubMsgType0x2? = null, @TarsId(1) @JvmField val stMsgInfo0x2: MsgType0x210SubMsgType0x2? = null,
@JceId(3) @JvmField val stMsgInfo0xa: MsgType0x210SubMsgType0xa? = null, @TarsId(3) @JvmField val stMsgInfo0xa: MsgType0x210SubMsgType0xa? = null,
@JceId(4) @JvmField val stMsgInfo0xe: MsgType0x210SubMsgType0xe? = null, @TarsId(4) @JvmField val stMsgInfo0xe: MsgType0x210SubMsgType0xe? = null,
@JceId(5) @JvmField val stMsgInfo0x13: MsgType0x210SubMsgType0x13? = null, @TarsId(5) @JvmField val stMsgInfo0x13: MsgType0x210SubMsgType0x13? = null,
@JceId(6) @JvmField val stMsgInfo0x17: MsgType0x210SubMsgType0x17? = null, @TarsId(6) @JvmField val stMsgInfo0x17: MsgType0x210SubMsgType0x17? = null,
@JceId(7) @JvmField val stMsgInfo0x20: MsgType0x210SubMsgType0x20? = null, @TarsId(7) @JvmField val stMsgInfo0x20: MsgType0x210SubMsgType0x20? = null,
@JceId(8) @JvmField val stMsgInfo0x1d: MsgType0x210SubMsgType0x1d? = null, @TarsId(8) @JvmField val stMsgInfo0x1d: MsgType0x210SubMsgType0x1d? = null,
@JceId(9) @JvmField val stMsgInfo0x24: MsgType0x210SubMsgType0x24? = null, @TarsId(9) @JvmField val stMsgInfo0x24: MsgType0x210SubMsgType0x24? = null,
@JceId(10) @JvmField val vProtobuf: ByteArray? = null @TarsId(10) @JvmField val vProtobuf: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x13( internal class MsgType0x210SubMsgType0x13(
@JceId(0) @JvmField val uint32SrcAppId: Long? = null, @TarsId(0) @JvmField val uint32SrcAppId: Long? = null,
@JceId(1) @JvmField val uint32SrcInstId: Long? = null, @TarsId(1) @JvmField val uint32SrcInstId: Long? = null,
@JceId(2) @JvmField val uint32DstAppId: Long? = null, @TarsId(2) @JvmField val uint32DstAppId: Long? = null,
@JceId(3) @JvmField val uint32DstInstId: Long? = null, @TarsId(3) @JvmField val uint32DstInstId: Long? = null,
@JceId(4) @JvmField val uint64DstUin: Long? = null, @TarsId(4) @JvmField val uint64DstUin: Long? = null,
@JceId(5) @JvmField val uint64Sessionid: Long? = null, @TarsId(5) @JvmField val uint64Sessionid: Long? = null,
@JceId(6) @JvmField val uint32Size: Long? = null, @TarsId(6) @JvmField val uint32Size: Long? = null,
@JceId(7) @JvmField val uint32Index: Long? = null, @TarsId(7) @JvmField val uint32Index: Long? = null,
@JceId(8) @JvmField val uint32Type: Long? = null, @TarsId(8) @JvmField val uint32Type: Long? = null,
@JceId(9) @JvmField val buf: ByteArray? = null @TarsId(9) @JvmField val buf: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x17( internal class MsgType0x210SubMsgType0x17(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val stAddGroup: AddGroup? = null, @TarsId(1) @JvmField val stAddGroup: AddGroup? = null,
@JceId(2) @JvmField val stDelGroup: DelGroup? = null, @TarsId(2) @JvmField val stDelGroup: DelGroup? = null,
@JceId(3) @JvmField val stModGroupName: ModGroupName? = null, @TarsId(3) @JvmField val stModGroupName: ModGroupName? = null,
@JceId(4) @JvmField val stModGroupSort: ModGroupSort? = null, @TarsId(4) @JvmField val stModGroupSort: ModGroupSort? = null,
@JceId(5) @JvmField val stModFriendGroup: ModFriendGroup? = null @TarsId(5) @JvmField val stModFriendGroup: ModFriendGroup? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class AddGroup( internal class AddGroup(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val dwSortID: Long? = null, @TarsId(1) @JvmField val dwSortID: Long? = null,
@JceId(2) @JvmField val groupName: String? = "" @TarsId(2) @JvmField val groupName: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class DelGroup( internal class DelGroup(
@JceId(0) @JvmField val dwGroupID: Long? = null @TarsId(0) @JvmField val dwGroupID: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModFriendGroup( internal class ModFriendGroup(
@JceId(0) @JvmField val vMsgFrdGroup: List<FriendGroup>? = null @TarsId(0) @JvmField val vMsgFrdGroup: List<FriendGroup>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class FriendGroup( internal class FriendGroup(
@JceId(0) @JvmField val dwFuin: Long? = null, @TarsId(0) @JvmField val dwFuin: Long? = null,
@JceId(1) @JvmField val vOldGroupID: List<Long>? = null, @TarsId(1) @JvmField val vOldGroupID: List<Long>? = null,
@JceId(2) @JvmField val vNewGroupID: List<Long>? = null @TarsId(2) @JvmField val vNewGroupID: List<Long>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModGroupName( internal class ModGroupName(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val groupName: String? = "" @TarsId(1) @JvmField val groupName: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ModGroupSort( internal class ModGroupSort(
@JceId(0) @JvmField val vMsgGroupSort: List<GroupSort>? = null @TarsId(0) @JvmField val vMsgGroupSort: List<GroupSort>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GroupSort( internal class GroupSort(
@JceId(0) @JvmField val dwGroupID: Long? = null, @TarsId(0) @JvmField val dwGroupID: Long? = null,
@JceId(1) @JvmField val dwSortID: Long? = null @TarsId(1) @JvmField val dwSortID: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x1d( internal class MsgType0x210SubMsgType0x1d(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val dwUin: Long? = null, @TarsId(1) @JvmField val dwUin: Long? = null,
@JceId(2) @JvmField val dwID: Long? = null, @TarsId(2) @JvmField val dwID: Long? = null,
@JceId(3) @JvmField val value: String? = "" @TarsId(3) @JvmField val value: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x2( internal class MsgType0x210SubMsgType0x2(
@JceId(0) @JvmField val uSrcAppId: Long? = null, @TarsId(0) @JvmField val uSrcAppId: Long? = null,
@JceId(1) @JvmField val uSrcInstId: Long? = null, @TarsId(1) @JvmField val uSrcInstId: Long? = null,
@JceId(2) @JvmField val uDstAppId: Long? = null, @TarsId(2) @JvmField val uDstAppId: Long? = null,
@JceId(3) @JvmField val uDstInstId: Long? = null, @TarsId(3) @JvmField val uDstInstId: Long? = null,
@JceId(4) @JvmField val uDstUin: Long? = null, @TarsId(4) @JvmField val uDstUin: Long? = null,
@JceId(5) @JvmField val fileName: ByteArray? = null, @TarsId(5) @JvmField val fileName: ByteArray? = null,
@JceId(6) @JvmField val fileIndex: ByteArray? = null, @TarsId(6) @JvmField val fileIndex: ByteArray? = null,
@JceId(7) @JvmField val fileMd5: ByteArray? = null, @TarsId(7) @JvmField val fileMd5: ByteArray? = null,
@JceId(8) @JvmField val fileKey: ByteArray? = null, @TarsId(8) @JvmField val fileKey: ByteArray? = null,
@JceId(9) @JvmField val uServerIp: Long? = null, @TarsId(9) @JvmField val uServerIp: Long? = null,
@JceId(10) @JvmField val uServerPort: Long? = null, @TarsId(10) @JvmField val uServerPort: Long? = null,
@JceId(11) @JvmField val fileLen: Long? = null, @TarsId(11) @JvmField val fileLen: Long? = null,
@JceId(12) @JvmField val sessionId: Long? = null, @TarsId(12) @JvmField val sessionId: Long? = null,
@JceId(13) @JvmField val originfileMd5: ByteArray? = null, @TarsId(13) @JvmField val originfileMd5: ByteArray? = null,
@JceId(14) @JvmField val uOriginfiletype: Long? = null, @TarsId(14) @JvmField val uOriginfiletype: Long? = null,
@JceId(15) @JvmField val uSeq: Long? = null @TarsId(15) @JvmField val uSeq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x20( internal class MsgType0x210SubMsgType0x20(
@JceId(0) @JvmField val dwOpType: Long? = null, @TarsId(0) @JvmField val dwOpType: Long? = null,
@JceId(1) @JvmField val dwType: Long? = null, @TarsId(1) @JvmField val dwType: Long? = null,
@JceId(2) @JvmField val dwUin: Long? = null, @TarsId(2) @JvmField val dwUin: Long? = null,
@JceId(3) @JvmField val remaek: String? = "" @TarsId(3) @JvmField val remaek: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0x24( internal class MsgType0x210SubMsgType0x24(
@JceId(0) @JvmField val vPluginNumList: List<PluginNum>? = null @TarsId(0) @JvmField val vPluginNumList: List<PluginNum>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class PluginNum( internal class PluginNum(
@JceId(0) @JvmField val dwID: Long? = null, @TarsId(0) @JvmField val dwID: Long? = null,
@JceId(1) @JvmField val dwNUm: Long? = null, @TarsId(1) @JvmField val dwNUm: Long? = null,
@JceId(2) @JvmField val flag: Byte? = null @TarsId(2) @JvmField val flag: Byte? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0xa( internal class MsgType0x210SubMsgType0xa(
@JceId(0) @JvmField val uSrcAppId: Long? = null, @TarsId(0) @JvmField val uSrcAppId: Long? = null,
@JceId(1) @JvmField val uSrcInstId: Long? = null, @TarsId(1) @JvmField val uSrcInstId: Long? = null,
@JceId(2) @JvmField val uDstAppId: Long? = null, @TarsId(2) @JvmField val uDstAppId: Long? = null,
@JceId(3) @JvmField val uDstInstId: Long? = null, @TarsId(3) @JvmField val uDstInstId: Long? = null,
@JceId(4) @JvmField val uDstUin: Long? = null, @TarsId(4) @JvmField val uDstUin: Long? = null,
@JceId(5) @JvmField val uType: Long? = null, @TarsId(5) @JvmField val uType: Long? = null,
@JceId(6) @JvmField val uServerIp: Long? = null, @TarsId(6) @JvmField val uServerIp: Long? = null,
@JceId(7) @JvmField val uServerPort: Long? = null, @TarsId(7) @JvmField val uServerPort: Long? = null,
@JceId(8) @JvmField val vUrlNotify: ByteArray? = null, @TarsId(8) @JvmField val vUrlNotify: ByteArray? = null,
@JceId(9) @JvmField val vTokenKey: ByteArray? = null, @TarsId(9) @JvmField val vTokenKey: ByteArray? = null,
@JceId(10) @JvmField val uFileLen: Long? = null, @TarsId(10) @JvmField val uFileLen: Long? = null,
@JceId(11) @JvmField val fileName: ByteArray? = null, @TarsId(11) @JvmField val fileName: ByteArray? = null,
@JceId(12) @JvmField val vMd5: ByteArray? = null, @TarsId(12) @JvmField val vMd5: ByteArray? = null,
@JceId(13) @JvmField val sessionId: Long? = null, @TarsId(13) @JvmField val sessionId: Long? = null,
@JceId(14) @JvmField val originfileMd5: ByteArray? = null, @TarsId(14) @JvmField val originfileMd5: ByteArray? = null,
@JceId(15) @JvmField val uOriginfiletype: Long? = null, @TarsId(15) @JvmField val uOriginfiletype: Long? = null,
@JceId(16) @JvmField val uSeq: Long? = null @TarsId(16) @JvmField val uSeq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class MsgType0x210SubMsgType0xe( internal class MsgType0x210SubMsgType0xe(
@JceId(0) @JvmField val uint32SrcAppId: Long? = null, @TarsId(0) @JvmField val uint32SrcAppId: Long? = null,
@JceId(1) @JvmField val uint32SrcInstId: Long? = null, @TarsId(1) @JvmField val uint32SrcInstId: Long? = null,
@JceId(2) @JvmField val uint32DstAppId: Long? = null, @TarsId(2) @JvmField val uint32DstAppId: Long? = null,
@JceId(3) @JvmField val uint32DstInstId: Long? = null, @TarsId(3) @JvmField val uint32DstInstId: Long? = null,
@JceId(4) @JvmField val uint64DstUin: Long? = null, @TarsId(4) @JvmField val uint64DstUin: Long? = null,
@JceId(5) @JvmField val uint64Sessionid: Long? = null, @TarsId(5) @JvmField val uint64Sessionid: Long? = null,
@JceId(6) @JvmField val uint32Operate: Long? = null, @TarsId(6) @JvmField val uint32Operate: Long? = null,
@JceId(7) @JvmField val uint32Seq: Long? = null, @TarsId(7) @JvmField val uint32Seq: Long? = null,
@JceId(8) @JvmField val uint32Code: Long? = null, @TarsId(8) @JvmField val uint32Code: Long? = null,
@JceId(9) @JvmField val msg: String? = "" @TarsId(9) @JvmField val msg: String? = ""
) : JceStruct ) : JceStruct
} }

View File

@@ -1,72 +1,72 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.network.Packet import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Suppress("ArrayInDataClass") @Suppress("ArrayInDataClass")
@Serializable @Serializable
internal class RequestPushNotify( internal class RequestPushNotify(
@JceId(0) @JvmField val uin: Long? = 0L, @TarsId(0) @JvmField val uin: Long? = 0L,
@JceId(1) @JvmField val ctype: Byte = 0, @TarsId(1) @JvmField val ctype: Byte = 0,
@JceId(2) @JvmField val strService: String?, @TarsId(2) @JvmField val strService: String?,
@JceId(3) @JvmField val strCmd: String?, @TarsId(3) @JvmField val strCmd: String?,
@JceId(4) @JvmField val vNotifyCookie: ByteArray? = EMPTY_BYTE_ARRAY, @TarsId(4) @JvmField val vNotifyCookie: ByteArray? = EMPTY_BYTE_ARRAY,
@JceId(5) @JvmField val usMsgType: Int?, @TarsId(5) @JvmField val usMsgType: Int?,
@JceId(6) @JvmField val wUserActive: Int?, @TarsId(6) @JvmField val wUserActive: Int?,
@JceId(7) @JvmField val wGeneralFlag: Int?, @TarsId(7) @JvmField val wGeneralFlag: Int?,
@JceId(8) @JvmField val bindedUin: Long?, @TarsId(8) @JvmField val bindedUin: Long?,
@JceId(9) @JvmField val stMsgInfo: MsgInfo?, @TarsId(9) @JvmField val stMsgInfo: MsgInfo?,
@JceId(10) @JvmField val msgCtrlBuf: String?, @TarsId(10) @JvmField val msgCtrlBuf: String?,
@JceId(11) @JvmField val serverBuf: ByteArray?, @TarsId(11) @JvmField val serverBuf: ByteArray?,
@JceId(12) @JvmField val pingFlag: Long?, @TarsId(12) @JvmField val pingFlag: Long?,
@JceId(13) @JvmField val svrip: Int? @TarsId(13) @JvmField val svrip: Int?
) : JceStruct, Packet, Packet.NoLog ) : JceStruct, Packet
@Serializable @Serializable
internal class MsgInfo( internal class MsgInfo(
@JceId(0) @JvmField val lFromUin: Long = 0L, @TarsId(0) @JvmField val lFromUin: Long = 0L,
@JceId(1) @JvmField val uMsgTime: Long = 0L, @TarsId(1) @JvmField val uMsgTime: Long = 0L,
@JceId(2) @JvmField val shMsgType: Short, @TarsId(2) @JvmField val shMsgType: Short,
@JceId(3) @JvmField val shMsgSeq: Short, @TarsId(3) @JvmField val shMsgSeq: Short,
@JceId(4) @JvmField val strMsg: String?, @TarsId(4) @JvmField val strMsg: String?,
@JceId(5) @JvmField val uRealMsgTime: Int?, @TarsId(5) @JvmField val uRealMsgTime: Int?,
@JceId(6) @JvmField val vMsg: ByteArray, @TarsId(6) @JvmField val vMsg: ByteArray,
@JceId(7) @JvmField val uAppShareID: Long?, @TarsId(7) @JvmField val uAppShareID: Long?,
@JceId(8) @JvmField val vMsgCookies: ByteArray? = EMPTY_BYTE_ARRAY, @TarsId(8) @JvmField val vMsgCookies: ByteArray? = EMPTY_BYTE_ARRAY,
@JceId(9) @JvmField val vAppShareCookie: ByteArray? = EMPTY_BYTE_ARRAY, @TarsId(9) @JvmField val vAppShareCookie: ByteArray? = EMPTY_BYTE_ARRAY,
@JceId(10) @JvmField val lMsgUid: Long?, @TarsId(10) @JvmField val lMsgUid: Long?,
@JceId(11) @JvmField val lLastChangeTime: Long?, @TarsId(11) @JvmField val lLastChangeTime: Long?,
@JceId(12) @JvmField val vCPicInfo: List<CPicInfo>?, @TarsId(12) @JvmField val vCPicInfo: List<CPicInfo>?,
@JceId(13) @JvmField val stShareData: ShareData?, @TarsId(13) @JvmField val stShareData: ShareData?,
@JceId(14) @JvmField val lFromInstId: Long?, @TarsId(14) @JvmField val lFromInstId: Long?,
@JceId(15) @JvmField val vRemarkOfSender: ByteArray?, @TarsId(15) @JvmField val vRemarkOfSender: ByteArray?,
@JceId(16) @JvmField val strFromMobile: String?, @TarsId(16) @JvmField val strFromMobile: String?,
@JceId(17) @JvmField val strFromName: String?, @TarsId(17) @JvmField val strFromName: String?,
@JceId(18) @JvmField val vNickName: List<String>?//, @TarsId(18) @JvmField val vNickName: List<String>?//,
//@SerialId(19) @JvmField val stC2CTmpMsgHead: TempMsgHead? //@SerialId(19) @JvmField val stC2CTmpMsgHead: TempMsgHead?
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class ShareData( internal class ShareData(
@JceId(0) @JvmField val pkgname: String = "", @TarsId(0) @JvmField val pkgname: String = "",
@JceId(1) @JvmField val msgtail: String = "", @TarsId(1) @JvmField val msgtail: String = "",
@JceId(2) @JvmField val picurl: String = "", @TarsId(2) @JvmField val picurl: String = "",
@JceId(3) @JvmField val url: String = "" @TarsId(3) @JvmField val url: String = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class TempMsgHead( internal class TempMsgHead(
@JceId(0) @JvmField val c2c_type: Int? = 0, @TarsId(0) @JvmField val c2c_type: Int? = 0,
@JceId(1) @JvmField val serviceType: Int? = 0 @TarsId(1) @JvmField val serviceType: Int? = 0
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class CPicInfo( internal class CPicInfo(
@JceId(0) @JvmField val vPath: ByteArray = EMPTY_BYTE_ARRAY, @TarsId(0) @JvmField val vPath: ByteArray = EMPTY_BYTE_ARRAY,
@JceId(1) @JvmField val vHost: ByteArray? = EMPTY_BYTE_ARRAY @TarsId(1) @JvmField val vHost: ByteArray? = EMPTY_BYTE_ARRAY
) : JceStruct ) : JceStruct

View File

@@ -1,26 +1,26 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class RequestMSFForceOffline( internal class RequestMSFForceOffline(
@JceId(0) @JvmField val uin: Long = 0L, @TarsId(0) @JvmField val uin: Long = 0L,
@JceId(1) @JvmField val iSeqno: Long = 0L, @TarsId(1) @JvmField val iSeqno: Long = 0L,
@JceId(2) @JvmField val kickType: Byte = 0, @TarsId(2) @JvmField val kickType: Byte = 0,
@JceId(3) @JvmField val info: String = "", @TarsId(3) @JvmField val info: String = "",
@JceId(4) @JvmField val title: String? = "", @TarsId(4) @JvmField val title: String? = "",
@JceId(5) @JvmField val sigKick: Byte? = 0, @TarsId(5) @JvmField val sigKick: Byte? = 0,
@JceId(6) @JvmField val vecSigKickData: ByteArray? = null, @TarsId(6) @JvmField val vecSigKickData: ByteArray? = null,
@JceId(7) @JvmField val sameDevice: Byte? = 0 @TarsId(7) @JvmField val sameDevice: Byte? = 0
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class RspMSFForceOffline( internal class RspMSFForceOffline(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val seq: Long, @TarsId(1) @JvmField val seq: Long,
@JceId(2) @JvmField val const: Byte = 0 @TarsId(2) @JvmField val const: Byte = 0
) : JceStruct ) : JceStruct

View File

@@ -1,38 +1,38 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
private val EMPTY_MAP = mapOf<String, String>() private val EMPTY_MAP = mapOf<String, String>()
@Serializable @Serializable
internal class RequestPacket( internal class RequestPacket(
@JceId(1) @JvmField val iVersion: Short? = 3, @TarsId(1) @JvmField val iVersion: Short? = 3,
@JceId(2) @JvmField val cPacketType: Byte = 0, @TarsId(2) @JvmField val cPacketType: Byte = 0,
@JceId(3) @JvmField val iMessageType: Int = 0, @TarsId(3) @JvmField val iMessageType: Int = 0,
@JceId(4) @JvmField val iRequestId: Int = 0, @TarsId(4) @JvmField val iRequestId: Int = 0,
@JceId(5) @JvmField val sServantName: String = "", @TarsId(5) @JvmField val sServantName: String = "",
@JceId(6) @JvmField val sFuncName: String = "", @TarsId(6) @JvmField val sFuncName: String = "",
@JceId(7) @JvmField val sBuffer: ByteArray = EMPTY_BYTE_ARRAY, @TarsId(7) @JvmField val sBuffer: ByteArray = EMPTY_BYTE_ARRAY,
@JceId(8) @JvmField val iTimeout: Int? = 0, @TarsId(8) @JvmField val iTimeout: Int? = 0,
@JceId(9) @JvmField val context: Map<String, String>? = EMPTY_MAP, @TarsId(9) @JvmField val context: Map<String, String>? = EMPTY_MAP,
@JceId(10) @JvmField val status: Map<String, String>? = EMPTY_MAP @TarsId(10) @JvmField val status: Map<String, String>? = EMPTY_MAP
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class RequestDataVersion3( internal class RequestDataVersion3(
@JceId(0) @JvmField val map: Map<String, ByteArray> // 注意: ByteArray 不能直接放序列化的 JceStruct!! 要放类似 RequestDataStructSvcReqRegister 的 @TarsId(0) @JvmField val map: Map<String, ByteArray> // 注意: ByteArray 不能直接放序列化的 JceStruct!! 要放类似 RequestDataStructSvcReqRegister 的
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class RequestDataVersion2( internal class RequestDataVersion2(
@JceId(0) @JvmField val map: Map<String, Map<String, ByteArray>> @TarsId(0) @JvmField val map: Map<String, Map<String, ByteArray>>
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class RequestDataStructSvcReqRegister( internal class RequestDataStructSvcReqRegister(
@JceId(0) @JvmField val struct: SvcReqRegister @TarsId(0) @JvmField val struct: SvcReqRegister
) : JceStruct ) : JceStruct

View File

@@ -1,14 +1,14 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class RequestPushForceOffline( internal class RequestPushForceOffline(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val title: String? = "", @TarsId(1) @JvmField val title: String? = "",
@JceId(2) @JvmField val tips: String? = "", @TarsId(2) @JvmField val tips: String? = "",
@JceId(3) @JvmField val sameDevice: Byte? = null @TarsId(3) @JvmField val sameDevice: Byte? = null
) : JceStruct ) : JceStruct

View File

@@ -1,47 +1,47 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class SvcReqRegister( internal class SvcReqRegister(
@JceId(0) @JvmField val lUin: Long = 0L, @TarsId(0) @JvmField val lUin: Long = 0L,
@JceId(1) @JvmField val lBid: Long = 0L, @TarsId(1) @JvmField val lBid: Long = 0L,
@JceId(2) @JvmField val cConnType: Byte = 0, @TarsId(2) @JvmField val cConnType: Byte = 0,
@JceId(3) @JvmField val sOther: String = "", @TarsId(3) @JvmField val sOther: String = "",
@JceId(4) @JvmField val iStatus: Int = 11, @TarsId(4) @JvmField val iStatus: Int = 11,
@JceId(5) @JvmField val bOnlinePush: Byte = 0, @TarsId(5) @JvmField val bOnlinePush: Byte = 0,
@JceId(6) @JvmField val bIsOnline: Byte = 0, @TarsId(6) @JvmField val bIsOnline: Byte = 0,
@JceId(7) @JvmField val bIsShowOnline: Byte = 0, @TarsId(7) @JvmField val bIsShowOnline: Byte = 0,
@JceId(8) @JvmField val bKikPC: Byte = 0, @TarsId(8) @JvmField val bKikPC: Byte = 0,
@JceId(9) @JvmField val bKikWeak: Byte = 0, @TarsId(9) @JvmField val bKikWeak: Byte = 0,
@JceId(10) @JvmField val timeStamp: Long = 0L, @TarsId(10) @JvmField val timeStamp: Long = 0L,
@JceId(11) @JvmField val iOSVersion: Long = 0L, @TarsId(11) @JvmField val iOSVersion: Long = 0L,
@JceId(12) @JvmField val cNetType: Byte = 0, @TarsId(12) @JvmField val cNetType: Byte = 0,
@JceId(13) @JvmField val sBuildVer: String? = "", @TarsId(13) @JvmField val sBuildVer: String? = "",
@JceId(14) @JvmField val bRegType: Byte = 0, @TarsId(14) @JvmField val bRegType: Byte = 0,
@JceId(15) @JvmField val vecDevParam: ByteArray? = null, @TarsId(15) @JvmField val vecDevParam: ByteArray? = null,
@JceId(16) @JvmField val vecGuid: ByteArray? = null, @TarsId(16) @JvmField val vecGuid: ByteArray? = null,
@JceId(17) @JvmField val iLocaleID: Int = 2052, @TarsId(17) @JvmField val iLocaleID: Int = 2052,
@JceId(18) @JvmField val bSlientPush: Byte = 0, @TarsId(18) @JvmField val bSlientPush: Byte = 0,
@JceId(19) @JvmField val strDevName: String? = null, @TarsId(19) @JvmField val strDevName: String? = null,
@JceId(20) @JvmField val strDevType: String? = null, @TarsId(20) @JvmField val strDevType: String? = null,
@JceId(21) @JvmField val strOSVer: String? = null, @TarsId(21) @JvmField val strOSVer: String? = null,
@JceId(22) @JvmField val bOpenPush: Byte = 1, @TarsId(22) @JvmField val bOpenPush: Byte = 1,
@JceId(23) @JvmField val iLargeSeq: Long = 0L, @TarsId(23) @JvmField val iLargeSeq: Long = 0L,
@JceId(24) @JvmField val iLastWatchStartTime: Long = 0L, @TarsId(24) @JvmField val iLastWatchStartTime: Long = 0L,
@JceId(26) @JvmField val uOldSSOIp: Long = 0L, @TarsId(26) @JvmField val uOldSSOIp: Long = 0L,
@JceId(27) @JvmField val uNewSSOIp: Long = 0L, @TarsId(27) @JvmField val uNewSSOIp: Long = 0L,
@JceId(28) @JvmField val sChannelNo: String? = null, @TarsId(28) @JvmField val sChannelNo: String? = null,
@JceId(29) @JvmField val lCpId: Long = 0L, @TarsId(29) @JvmField val lCpId: Long = 0L,
@JceId(30) @JvmField val strVendorName: String? = null, @TarsId(30) @JvmField val strVendorName: String? = null,
@JceId(31) @JvmField val strVendorOSName: String? = null, @TarsId(31) @JvmField val strVendorOSName: String? = null,
@JceId(32) @JvmField val strIOSIdfa: String? = null, @TarsId(32) @JvmField val strIOSIdfa: String? = null,
@JceId(33) @JvmField val bytes_0x769_reqbody: ByteArray? = null, @TarsId(33) @JvmField val bytes_0x769_reqbody: ByteArray? = null,
@JceId(34) @JvmField val bIsSetStatus: Byte = 0, @TarsId(34) @JvmField val bIsSetStatus: Byte = 0,
@JceId(35) @JvmField val vecServerBuf: ByteArray? = null, @TarsId(35) @JvmField val vecServerBuf: ByteArray? = null,
@JceId(36) @JvmField val bSetMute: Byte = 0 @TarsId(36) @JvmField val bSetMute: Byte = 0
// @SerialId(25) var vecBindUin: ArrayList<*>? = null // ?? 未知泛型 // @SerialId(25) var vecBindUin: ArrayList<*>? = null // ?? 未知泛型
) : JceStruct ) : JceStruct

View File

@@ -1,97 +1,97 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.jce package net.mamoe.mirai.qqandroid.network.protocol.data.jce
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@Serializable @Serializable
internal class GetTroopListReqV2Simplify( internal class GetTroopListReqV2Simplify(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val getMSFMsgFlag: Byte? = null, @TarsId(1) @JvmField val getMSFMsgFlag: Byte? = null,
@JceId(2) @JvmField val vecCookies: ByteArray? = null, @TarsId(2) @JvmField val vecCookies: ByteArray? = null,
@JceId(3) @JvmField val vecGroupInfo: List<StTroopNumSimplify>? = null, @TarsId(3) @JvmField val vecGroupInfo: List<StTroopNumSimplify>? = null,
@JceId(4) @JvmField val groupFlagExt: Byte? = null, @TarsId(4) @JvmField val groupFlagExt: Byte? = null,
@JceId(5) @JvmField val shVersion: Int? = null, @TarsId(5) @JvmField val shVersion: Int? = null,
@JceId(6) @JvmField val dwCompanyId: Long? = null, @TarsId(6) @JvmField val dwCompanyId: Long? = null,
@JceId(7) @JvmField val versionNum: Long? = null, @TarsId(7) @JvmField val versionNum: Long? = null,
@JceId(8) @JvmField val getLongGroupName: Byte? = null @TarsId(8) @JvmField val getLongGroupName: Byte? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class StTroopNumSimplify( internal class StTroopNumSimplify(
@JceId(0) @JvmField val groupCode: Long, @TarsId(0) @JvmField val groupCode: Long,
@JceId(1) @JvmField val dwGroupInfoSeq: Long? = null, @TarsId(1) @JvmField val dwGroupInfoSeq: Long? = null,
@JceId(2) @JvmField val dwGroupFlagExt: Long? = null, @TarsId(2) @JvmField val dwGroupFlagExt: Long? = null,
@JceId(3) @JvmField val dwGroupRankSeq: Long? = null @TarsId(3) @JvmField val dwGroupRankSeq: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GetTroopListRespV2( internal class GetTroopListRespV2(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val troopCount: Short, @TarsId(1) @JvmField val troopCount: Short,
@JceId(2) @JvmField val result: Int, @TarsId(2) @JvmField val result: Int,
@JceId(3) @JvmField val errorCode: Short? = null, @TarsId(3) @JvmField val errorCode: Short? = null,
@JceId(4) @JvmField val vecCookies: ByteArray? = null, @TarsId(4) @JvmField val vecCookies: ByteArray? = null,
@JceId(5) @JvmField val vecTroopList: List<StTroopNum>? = null, @TarsId(5) @JvmField val vecTroopList: List<StTroopNum>? = null,
@JceId(6) @JvmField val vecTroopListDel: List<StTroopNum>? = null, @TarsId(6) @JvmField val vecTroopListDel: List<StTroopNum>? = null,
@JceId(7) @JvmField val vecTroopRank: List<StGroupRankInfo>? = null, @TarsId(7) @JvmField val vecTroopRank: List<StGroupRankInfo>? = null,
@JceId(8) @JvmField val vecFavGroup: List<StFavoriteGroup>? = null, @TarsId(8) @JvmField val vecFavGroup: List<StFavoriteGroup>? = null,
@JceId(9) @JvmField val vecTroopListExt: List<StTroopNum>? = null @TarsId(9) @JvmField val vecTroopListExt: List<StTroopNum>? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class StTroopNum( internal class StTroopNum(
@JceId(0) @JvmField val groupUin: Long, @TarsId(0) @JvmField val groupUin: Long,
@JceId(1) @JvmField val groupCode: Long, @TarsId(1) @JvmField val groupCode: Long,
@JceId(2) @JvmField val flag: Byte? = null, @TarsId(2) @JvmField val flag: Byte? = null,
@JceId(3) @JvmField val dwGroupInfoSeq: Long? = null, @TarsId(3) @JvmField val dwGroupInfoSeq: Long? = null,
@JceId(4) @JvmField val groupName: String = "", @TarsId(4) @JvmField val groupName: String = "",
@JceId(5) @JvmField val groupMemo: String = "", @TarsId(5) @JvmField val groupMemo: String = "",
@JceId(6) @JvmField val dwGroupFlagExt: Long? = null, @TarsId(6) @JvmField val dwGroupFlagExt: Long? = null,
@JceId(7) @JvmField val dwGroupRankSeq: Long? = null, @TarsId(7) @JvmField val dwGroupRankSeq: Long? = null,
@JceId(8) @JvmField val dwCertificationType: Long? = null, @TarsId(8) @JvmField val dwCertificationType: Long? = null,
@JceId(9) @JvmField val dwShutUpTimestamp: Long? = null, @TarsId(9) @JvmField val dwShutUpTimestamp: Long? = null,
@JceId(10) @JvmField val dwMyShutUpTimestamp: Long? = null, @TarsId(10) @JvmField val dwMyShutUpTimestamp: Long? = null,
@JceId(11) @JvmField val dwCmdUinUinFlag: Long? = null, @TarsId(11) @JvmField val dwCmdUinUinFlag: Long? = null,
@JceId(12) @JvmField val dwAdditionalFlag: Long? = null, @TarsId(12) @JvmField val dwAdditionalFlag: Long? = null,
@JceId(13) @JvmField val dwGroupTypeFlag: Long? = null, @TarsId(13) @JvmField val dwGroupTypeFlag: Long? = null,
@JceId(14) @JvmField val dwGroupSecType: Long? = null, @TarsId(14) @JvmField val dwGroupSecType: Long? = null,
@JceId(15) @JvmField val dwGroupSecTypeInfo: Long? = null, @TarsId(15) @JvmField val dwGroupSecTypeInfo: Long? = null,
@JceId(16) @JvmField val dwGroupClassExt: Long? = null, @TarsId(16) @JvmField val dwGroupClassExt: Long? = null,
@JceId(17) @JvmField val dwAppPrivilegeFlag: Long? = null, @TarsId(17) @JvmField val dwAppPrivilegeFlag: Long? = null,
@JceId(18) @JvmField val dwSubscriptionUin: Long? = null, @TarsId(18) @JvmField val dwSubscriptionUin: Long? = null,
@JceId(19) @JvmField val dwMemberNum: Long? = null, @TarsId(19) @JvmField val dwMemberNum: Long? = null,
@JceId(20) @JvmField val dwMemberNumSeq: Long? = null, @TarsId(20) @JvmField val dwMemberNumSeq: Long? = null,
@JceId(21) @JvmField val dwMemberCardSeq: Long? = null, @TarsId(21) @JvmField val dwMemberCardSeq: Long? = null,
@JceId(22) @JvmField val dwGroupFlagExt3: Long? = null, @TarsId(22) @JvmField val dwGroupFlagExt3: Long? = null,
@JceId(23) @JvmField val dwGroupOwnerUin: Long, @TarsId(23) @JvmField val dwGroupOwnerUin: Long,
@JceId(24) @JvmField val isConfGroup: Byte? = null, @TarsId(24) @JvmField val isConfGroup: Byte? = null,
@JceId(25) @JvmField val isModifyConfGroupFace: Byte? = null, @TarsId(25) @JvmField val isModifyConfGroupFace: Byte? = null,
@JceId(26) @JvmField val isModifyConfGroupName: Byte? = null, @TarsId(26) @JvmField val isModifyConfGroupName: Byte? = null,
@JceId(27) @JvmField val dwCmduinJoinTime: Long? = null, @TarsId(27) @JvmField val dwCmduinJoinTime: Long? = null,
@JceId(28) @JvmField val ulCompanyId: Long? = null, @TarsId(28) @JvmField val ulCompanyId: Long? = null,
@JceId(29) @JvmField val dwMaxGroupMemberNum: Long? = null, @TarsId(29) @JvmField val dwMaxGroupMemberNum: Long? = null,
@JceId(30) @JvmField val dwCmdUinGroupMask: Long? = null, @TarsId(30) @JvmField val dwCmdUinGroupMask: Long? = null,
@JceId(31) @JvmField val udwHLGuildAppid: Long? = null, @TarsId(31) @JvmField val udwHLGuildAppid: Long? = null,
@JceId(32) @JvmField val udwHLGuildSubType: Long? = null, @TarsId(32) @JvmField val udwHLGuildSubType: Long? = null,
@JceId(33) @JvmField val udwCmdUinRingtoneID: Long? = null, @TarsId(33) @JvmField val udwCmdUinRingtoneID: Long? = null,
@JceId(34) @JvmField val udwCmdUinFlagEx2: Long? = null @TarsId(34) @JvmField val udwCmdUinFlagEx2: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class StGroupRankInfo( internal class StGroupRankInfo(
@JceId(0) @JvmField val dwGroupCode: Long, @TarsId(0) @JvmField val dwGroupCode: Long,
@JceId(1) @JvmField val groupRankSysFlag: Byte? = null, @TarsId(1) @JvmField val groupRankSysFlag: Byte? = null,
@JceId(2) @JvmField val groupRankUserFlag: Byte? = null, @TarsId(2) @JvmField val groupRankUserFlag: Byte? = null,
@JceId(3) @JvmField val vecRankMap: List<StLevelRankPair>? = null, @TarsId(3) @JvmField val vecRankMap: List<StLevelRankPair>? = null,
@JceId(4) @JvmField val dwGroupRankSeq: Long? = null, @TarsId(4) @JvmField val dwGroupRankSeq: Long? = null,
@JceId(5) @JvmField val ownerName: String? = "", @TarsId(5) @JvmField val ownerName: String? = "",
@JceId(6) @JvmField val adminName: String? = "", @TarsId(6) @JvmField val adminName: String? = "",
@JceId(7) @JvmField val dwOfficeMode: Long? = null, @TarsId(7) @JvmField val dwOfficeMode: Long? = null,
@JceId(9) @JvmField val fuckIssue405: List<FuckIssue405?>? = null // fake @TarsId(9) @JvmField val fuckIssue405: List<FuckIssue405?>? = null // fake
) : JceStruct ) : JceStruct
@Serializable @Serializable
@@ -99,89 +99,89 @@ internal class FuckIssue405
@Serializable @Serializable
internal class StFavoriteGroup( internal class StFavoriteGroup(
@JceId(0) @JvmField val dwGroupCode: Long, @TarsId(0) @JvmField val dwGroupCode: Long,
@JceId(1) @JvmField val dwTimestamp: Long? = null, @TarsId(1) @JvmField val dwTimestamp: Long? = null,
@JceId(2) @JvmField val dwSnsFlag: Long? = 1L, @TarsId(2) @JvmField val dwSnsFlag: Long? = 1L,
@JceId(3) @JvmField val dwOpenTimestamp: Long? = null @TarsId(3) @JvmField val dwOpenTimestamp: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class StLevelRankPair( internal class StLevelRankPair(
@JceId(0) @JvmField val dwLevel: Long? = null, @TarsId(0) @JvmField val dwLevel: Long? = null,
@JceId(1) @JvmField val rank: String? = "" @TarsId(1) @JvmField val rank: String? = ""
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GetTroopMemberListReq( internal class GetTroopMemberListReq(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val groupCode: Long, @TarsId(1) @JvmField val groupCode: Long,
@JceId(2) @JvmField val nextUin: Long, @TarsId(2) @JvmField val nextUin: Long,
@JceId(3) @JvmField val groupUin: Long, @TarsId(3) @JvmField val groupUin: Long,
@JceId(4) @JvmField val version: Long? = null, @TarsId(4) @JvmField val version: Long? = null,
@JceId(5) @JvmField val reqType: Long? = null, @TarsId(5) @JvmField val reqType: Long? = null,
@JceId(6) @JvmField val getListAppointTime: Long? = null, @TarsId(6) @JvmField val getListAppointTime: Long? = null,
@JceId(7) @JvmField val richCardNameVer: Byte? = null @TarsId(7) @JvmField val richCardNameVer: Byte? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class GetTroopMemberListResp( internal class GetTroopMemberListResp(
@JceId(0) @JvmField val uin: Long, @TarsId(0) @JvmField val uin: Long,
@JceId(1) @JvmField val groupCode: Long, @TarsId(1) @JvmField val groupCode: Long,
@JceId(2) @JvmField val groupUin: Long, @TarsId(2) @JvmField val groupUin: Long,
@JceId(3) @JvmField val vecTroopMember: List<StTroopMemberInfo>, @TarsId(3) @JvmField val vecTroopMember: List<StTroopMemberInfo>,
@JceId(4) @JvmField val nextUin: Long, @TarsId(4) @JvmField val nextUin: Long,
@JceId(5) @JvmField val result: Int, @TarsId(5) @JvmField val result: Int,
@JceId(6) @JvmField val errorCode: Short? = null, @TarsId(6) @JvmField val errorCode: Short? = null,
@JceId(7) @JvmField val officeMode: Long? = null, @TarsId(7) @JvmField val officeMode: Long? = null,
@JceId(8) @JvmField val nextGetTime: Long? = null @TarsId(8) @JvmField val nextGetTime: Long? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class StTroopMemberInfo( internal class StTroopMemberInfo(
@JceId(0) @JvmField val memberUin: Long, @TarsId(0) @JvmField val memberUin: Long,
@JceId(1) @JvmField val faceId: Short, @TarsId(1) @JvmField val faceId: Short,
@JceId(2) @JvmField val age: Byte, @TarsId(2) @JvmField val age: Byte,
@JceId(3) @JvmField val gender: Byte, @TarsId(3) @JvmField val gender: Byte,
@JceId(4) @JvmField val nick: String = "", @TarsId(4) @JvmField val nick: String = "",
@JceId(5) @JvmField val status: Byte = 20, @TarsId(5) @JvmField val status: Byte = 20,
@JceId(6) @JvmField val sShowName: String? = null, @TarsId(6) @JvmField val sShowName: String? = null,
@JceId(8) @JvmField val sName: String? = null, @TarsId(8) @JvmField val sName: String? = null,
@JceId(9) @JvmField val cGender: Byte? = null, @TarsId(9) @JvmField val cGender: Byte? = null,
@JceId(10) @JvmField val sPhone: String? = "", @TarsId(10) @JvmField val sPhone: String? = "",
@JceId(11) @JvmField val sEmail: String? = "", @TarsId(11) @JvmField val sEmail: String? = "",
@JceId(12) @JvmField val sMemo: String? = "", @TarsId(12) @JvmField val sMemo: String? = "",
@JceId(13) @JvmField val autoRemark: String? = "", @TarsId(13) @JvmField val autoRemark: String? = "",
@JceId(14) @JvmField val dwMemberLevel: Long? = null, @TarsId(14) @JvmField val dwMemberLevel: Long? = null,
@JceId(15) @JvmField val dwJoinTime: Long? = null, @TarsId(15) @JvmField val dwJoinTime: Long? = null,
@JceId(16) @JvmField val dwLastSpeakTime: Long? = null, @TarsId(16) @JvmField val dwLastSpeakTime: Long? = null,
@JceId(17) @JvmField val dwCreditLevel: Long? = null, @TarsId(17) @JvmField val dwCreditLevel: Long? = null,
@JceId(18) @JvmField val dwFlag: Long? = null, @TarsId(18) @JvmField val dwFlag: Long? = null,
@JceId(19) @JvmField val dwFlagExt: Long? = null, @TarsId(19) @JvmField val dwFlagExt: Long? = null,
@JceId(20) @JvmField val dwPoint: Long? = null, @TarsId(20) @JvmField val dwPoint: Long? = null,
@JceId(21) @JvmField val concerned: Byte? = null, @TarsId(21) @JvmField val concerned: Byte? = null,
@JceId(22) @JvmField val shielded: Byte? = null, @TarsId(22) @JvmField val shielded: Byte? = null,
@JceId(23) @JvmField val sSpecialTitle: String? = "", @TarsId(23) @JvmField val sSpecialTitle: String? = "",
@JceId(24) @JvmField val dwSpecialTitleExpireTime: Long? = null, @TarsId(24) @JvmField val dwSpecialTitleExpireTime: Long? = null,
@JceId(25) @JvmField val job: String? = "", @TarsId(25) @JvmField val job: String? = "",
@JceId(26) @JvmField val apolloFlag: Byte? = null, @TarsId(26) @JvmField val apolloFlag: Byte? = null,
@JceId(27) @JvmField val dwApolloTimestamp: Long? = null, @TarsId(27) @JvmField val dwApolloTimestamp: Long? = null,
@JceId(28) @JvmField val dwGlobalGroupLevel: Long? = null, @TarsId(28) @JvmField val dwGlobalGroupLevel: Long? = null,
@JceId(29) @JvmField val dwTitleId: Long? = null, @TarsId(29) @JvmField val dwTitleId: Long? = null,
@JceId(30) @JvmField val dwShutupTimestap: Long? = null, @TarsId(30) @JvmField val dwShutupTimestap: Long? = null,
@JceId(31) @JvmField val dwGlobalGroupPoint: Long? = null, @TarsId(31) @JvmField val dwGlobalGroupPoint: Long? = null,
@JceId(32) @JvmField val qzusrinfo: QzoneUserInfo? = null, @TarsId(32) @JvmField val qzusrinfo: QzoneUserInfo? = null,
@JceId(33) @JvmField val richCardNameVer: Byte? = null, @TarsId(33) @JvmField val richCardNameVer: Byte? = null,
@JceId(34) @JvmField val dwVipType: Long? = null, @TarsId(34) @JvmField val dwVipType: Long? = null,
@JceId(35) @JvmField val dwVipLevel: Long? = null, @TarsId(35) @JvmField val dwVipLevel: Long? = null,
@JceId(36) @JvmField val dwBigClubLevel: Long? = null, @TarsId(36) @JvmField val dwBigClubLevel: Long? = null,
@JceId(37) @JvmField val dwBigClubFlag: Long? = null, @TarsId(37) @JvmField val dwBigClubFlag: Long? = null,
@JceId(38) @JvmField val dwNameplate: Long? = null, @TarsId(38) @JvmField val dwNameplate: Long? = null,
@JceId(39) @JvmField val vecGroupHonor: ByteArray? = null @TarsId(39) @JvmField val vecGroupHonor: ByteArray? = null
) : JceStruct ) : JceStruct
@Serializable @Serializable
internal class QzoneUserInfo( internal class QzoneUserInfo(
@JceId(0) @JvmField val eStarState: Int? = null, @TarsId(0) @JvmField val eStarState: Int? = null,
@JceId(1) @JvmField val extendInfo: Map<String, String>? = null @TarsId(1) @JvmField val extendInfo: Map<String, String>? = null
) : JceStruct ) : JceStruct

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -10,118 +10,118 @@ import kotlin.jvm.JvmField
internal class Cmd0x352 : ProtoBuf { internal class Cmd0x352 : ProtoBuf {
@Serializable @Serializable
internal class DelImgReq( internal class DelImgReq(
@ProtoId(1) @JvmField val srcUin: Long = 0L, @ProtoNumber(1) @JvmField val srcUin: Long = 0L,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val reqTerm: Int = 0, @ProtoNumber(3) @JvmField val reqTerm: Int = 0,
@ProtoId(4) @JvmField val reqPlatformType: Int = 0, @ProtoNumber(4) @JvmField val reqPlatformType: Int = 0,
@ProtoId(5) @JvmField val buType: Int = 0, @ProtoNumber(5) @JvmField val buType: Int = 0,
@ProtoId(6) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val picWidth: Int = 0, @ProtoNumber(8) @JvmField val picWidth: Int = 0,
@ProtoId(9) @JvmField val picHeight: Int = 0 @ProtoNumber(9) @JvmField val picHeight: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DelImgRsp( internal class DelImgRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetImgUrlReq( internal class GetImgUrlReq(
@ProtoId(1) @JvmField val srcUin: Long = 0L, @ProtoNumber(1) @JvmField val srcUin: Long = 0L,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val urlFlag: Int = 0, @ProtoNumber(4) @JvmField val urlFlag: Int = 0,
@ProtoId(6) @JvmField val urlType: Int = 0, @ProtoNumber(6) @JvmField val urlType: Int = 0,
@ProtoId(7) @JvmField val reqTerm: Int = 0, @ProtoNumber(7) @JvmField val reqTerm: Int = 0,
@ProtoId(8) @JvmField val reqPlatformType: Int = 0, @ProtoNumber(8) @JvmField val reqPlatformType: Int = 0,
@ProtoId(9) @JvmField val srcFileType: Int = 0, @ProtoNumber(9) @JvmField val srcFileType: Int = 0,
@ProtoId(10) @JvmField val innerIp: Int = 0, @ProtoNumber(10) @JvmField val innerIp: Int = 0,
@ProtoId(11) @JvmField val boolAddressBook: Boolean = false, @ProtoNumber(11) @JvmField val boolAddressBook: Boolean = false,
@ProtoId(12) @JvmField val buType: Int = 0, @ProtoNumber(12) @JvmField val buType: Int = 0,
@ProtoId(13) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(13) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(14) @JvmField val picUpTimestamp: Int = 0, @ProtoNumber(14) @JvmField val picUpTimestamp: Int = 0,
@ProtoId(15) @JvmField val reqTransferType: Int = 0 @ProtoNumber(15) @JvmField val reqTransferType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetImgUrlRsp( internal class GetImgUrlRsp(
@ProtoId(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val clientIp: Int = 0, @ProtoNumber(2) @JvmField val clientIp: Int = 0,
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val bytesThumbDownUrl: List<ByteArray>? = null, @ProtoNumber(5) @JvmField val bytesThumbDownUrl: List<ByteArray>? = null,
@ProtoId(6) @JvmField val bytesOriginalDownUrl: List<ByteArray>? = null, @ProtoNumber(6) @JvmField val bytesOriginalDownUrl: List<ByteArray>? = null,
@ProtoId(7) @JvmField val msgImgInfo: ImgInfo? = null, @ProtoNumber(7) @JvmField val msgImgInfo: ImgInfo? = null,
@ProtoId(8) @JvmField val uint32DownIp: List<Int>? = null, @ProtoNumber(8) @JvmField val uint32DownIp: List<Int>? = null,
@ProtoId(9) @JvmField val uint32DownPort: List<Int>? = null, @ProtoNumber(9) @JvmField val uint32DownPort: List<Int>? = null,
@ProtoId(10) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(12) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(13) @JvmField val bytesBigDownUrl: List<ByteArray>? = null, @ProtoNumber(13) @JvmField val bytesBigDownUrl: List<ByteArray>? = null,
@ProtoId(14) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(14) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(15) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(15) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(16) @JvmField val httpsUrlFlag: Int = 0, @ProtoNumber(16) @JvmField val httpsUrlFlag: Int = 0,
@ProtoId(26) @JvmField val msgDownIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgDownIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Suppress("ArrayInDataClass") @Suppress("ArrayInDataClass")
@Serializable @Serializable
internal class ImgInfo( internal class ImgInfo(
@ProtoId(1) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val fileType: Int = 0, @ProtoNumber(2) @JvmField val fileType: Int = 0,
@ProtoId(3) @JvmField val fileSize: Long = 0L, @ProtoNumber(3) @JvmField val fileSize: Long = 0L,
@ProtoId(4) @JvmField val fileWidth: Int = 0, @ProtoNumber(4) @JvmField val fileWidth: Int = 0,
@ProtoId(5) @JvmField val fileHeight: Int = 0, @ProtoNumber(5) @JvmField val fileHeight: Int = 0,
@ProtoId(6) @JvmField val fileFlag: Long = 0L, @ProtoNumber(6) @JvmField val fileFlag: Long = 0L,
@ProtoId(7) @JvmField val fileCutPos: Int = 0 @ProtoNumber(7) @JvmField val fileCutPos: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class IPv6Info( internal class IPv6Info(
@ProtoId(1) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val port: Int = 0 @ProtoNumber(2) @JvmField val port: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, //2是GetImgUrlReq 1是UploadImgReq @ProtoNumber(1) @JvmField val subcmd: Int = 0, //2是GetImgUrlReq 1是UploadImgReq
@ProtoId(2) @JvmField val msgTryupImgReq: List<TryUpImgReq>? = null,// optional @ProtoNumber(2) @JvmField val msgTryupImgReq: List<TryUpImgReq>? = null,// optional
@ProtoId(3) @JvmField val msgGetimgUrlReq: List<GetImgUrlReq>? = null,// optional @ProtoNumber(3) @JvmField val msgGetimgUrlReq: List<GetImgUrlReq>? = null,// optional
@ProtoId(4) @JvmField val msgDelImgReq: List<DelImgReq>? = null, @ProtoNumber(4) @JvmField val msgDelImgReq: List<DelImgReq>? = null,
@ProtoId(10) @JvmField val netType: Int = 3// 数据网络=5 @ProtoNumber(10) @JvmField val netType: Int = 3// 数据网络=5
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, @ProtoNumber(1) @JvmField val subcmd: Int = 0,
@ProtoId(2) @JvmField val msgTryupImgRsp: List<TryUpImgRsp>? = null, @ProtoNumber(2) @JvmField val msgTryupImgRsp: List<TryUpImgRsp>? = null,
@ProtoId(3) @JvmField val msgGetimgUrlRsp: List<GetImgUrlRsp>? = null, @ProtoNumber(3) @JvmField val msgGetimgUrlRsp: List<GetImgUrlRsp>? = null,
@ProtoId(4) @JvmField val boolNewBigchan: Boolean = false, @ProtoNumber(4) @JvmField val boolNewBigchan: Boolean = false,
@ProtoId(5) @JvmField val msgDelImgRsp: List<DelImgRsp>? = null, @ProtoNumber(5) @JvmField val msgDelImgRsp: List<DelImgRsp>? = null,
@ProtoId(10) @JvmField val failMsg: String? = "" @ProtoNumber(10) @JvmField val failMsg: String? = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpImgReq( internal class TryUpImgReq(
@ProtoId(1) @JvmField val srcUin: Int, @ProtoNumber(1) @JvmField val srcUin: Int,
@ProtoId(2) @JvmField val dstUin: Int, @ProtoNumber(2) @JvmField val dstUin: Int,
@ProtoId(3) @JvmField val fileId: Int = 0,//从0开始的自增数貌似有一个连接就要自增1, 但是又会重置回0 @ProtoNumber(3) @JvmField val fileId: Int = 0,//从0开始的自增数貌似有一个连接就要自增1, 但是又会重置回0
@ProtoId(4) @JvmField val fileMd5: ByteArray, @ProtoNumber(4) @JvmField val fileMd5: ByteArray,
@ProtoId(5) @JvmField val fileSize: Int, @ProtoNumber(5) @JvmField val fileSize: Int,
@ProtoId(6) @JvmField val fileName: String,//默认为md5+".jpg" @ProtoNumber(6) @JvmField val fileName: String,//默认为md5+".jpg"
@ProtoId(7) @JvmField val srcTerm: Int = 5, @ProtoNumber(7) @JvmField val srcTerm: Int = 5,
@ProtoId(8) @JvmField val platformType: Int = 9, @ProtoNumber(8) @JvmField val platformType: Int = 9,
@ProtoId(9) @JvmField val innerIP: Int = 0, @ProtoNumber(9) @JvmField val innerIP: Int = 0,
@ProtoId(10) @JvmField val addressBook: Int = 0,//chatType == 1006为1 我觉得发0没问题 @ProtoNumber(10) @JvmField val addressBook: Int = 0,//chatType == 1006为1 我觉得发0没问题
@ProtoId(11) @JvmField val retry: Int = 0,//default @ProtoNumber(11) @JvmField val retry: Int = 0,//default
@ProtoId(12) @JvmField val buType: Int = 1,//1或96 不确定 @ProtoNumber(12) @JvmField val buType: Int = 1,//1或96 不确定
@ProtoId(13) @JvmField val imgOriginal: Int,//是否为原图 @ProtoNumber(13) @JvmField val imgOriginal: Int,//是否为原图
@ProtoId(14) @JvmField val imgWidth: Int = 0, @ProtoNumber(14) @JvmField val imgWidth: Int = 0,
@ProtoId(15) @JvmField val imgHeight: Int = 0, @ProtoNumber(15) @JvmField val imgHeight: Int = 0,
/** /**
* ImgType: * ImgType:
* JPG: 1000 * JPG: 1000
@@ -132,50 +132,50 @@ internal class Cmd0x352 : ProtoBuf {
* APNG: 2001 * APNG: 2001
* SHARPP: 1004 * SHARPP: 1004
*/ */
@ProtoId(16) @JvmField val imgType: Int = 1000, @ProtoNumber(16) @JvmField val imgType: Int = 1000,
@ProtoId(17) @JvmField val buildVer: String = "8.2.7.4410",//版本号 @ProtoNumber(17) @JvmField val buildVer: String = "8.2.7.4410",//版本号
@ProtoId(18) @JvmField val fileIndex: ByteArray = EMPTY_BYTE_ARRAY,//default @ProtoNumber(18) @JvmField val fileIndex: ByteArray = EMPTY_BYTE_ARRAY,//default
@ProtoId(19) @JvmField val fileStoreDays: Int = 0,//default @ProtoNumber(19) @JvmField val fileStoreDays: Int = 0,//default
@ProtoId(20) @JvmField val stepFlag: Int = 0,//default @ProtoNumber(20) @JvmField val stepFlag: Int = 0,//default
@ProtoId(21) @JvmField val rejectTryFast: Int = 0,//bool @ProtoNumber(21) @JvmField val rejectTryFast: Int = 0,//bool
@ProtoId(22) @JvmField val srvUpload: Int = 1,//typeHotPic[1/2/3] @ProtoNumber(22) @JvmField val srvUpload: Int = 1,//typeHotPic[1/2/3]
@ProtoId(23) @JvmField val transferUrl: ByteArray = EMPTY_BYTE_ARRAY//rawDownloadUrl, 如果没有就是EMPTY_BYTE_ARRAY @ProtoNumber(23) @JvmField val transferUrl: ByteArray = EMPTY_BYTE_ARRAY//rawDownloadUrl, 如果没有就是EMPTY_BYTE_ARRAY
) : ImgReq ) : ImgReq
@Serializable @Serializable
internal class TryUpImgRsp( internal class TryUpImgRsp(
@ProtoId(1) @JvmField val fileId: Long = 0L, @ProtoNumber(1) @JvmField val fileId: Long = 0L,
@ProtoId(2) @JvmField val clientIp: Int = 0, @ProtoNumber(2) @JvmField val clientIp: Int = 0,
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val failMsg: String? = "", @ProtoNumber(4) @JvmField val failMsg: String? = "",
@ProtoId(5) @JvmField val boolFileExit: Boolean = false, @ProtoNumber(5) @JvmField val boolFileExit: Boolean = false,
@ProtoId(6) @JvmField val msgImgInfo: ImgInfo? = null, @ProtoNumber(6) @JvmField val msgImgInfo: ImgInfo? = null,
@ProtoId(7) @JvmField val uint32UpIp: List<Int>? = null, @ProtoNumber(7) @JvmField val uint32UpIp: List<Int>? = null,
@ProtoId(8) @JvmField val uint32UpPort: List<Int>? = null, @ProtoNumber(8) @JvmField val uint32UpPort: List<Int>? = null,
@ProtoId(9) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val upResid: String = "", @ProtoNumber(10) @JvmField val upResid: String = "",
@ProtoId(11) @JvmField val upUuid: String = "", @ProtoNumber(11) @JvmField val upUuid: String = "",
@ProtoId(12) @JvmField val upOffset: Long = 0L, @ProtoNumber(12) @JvmField val upOffset: Long = 0L,
@ProtoId(13) @JvmField val blockSize: Long = 0L, @ProtoNumber(13) @JvmField val blockSize: Long = 0L,
@ProtoId(14) @JvmField val encryptDstip: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(14) @JvmField val encryptDstip: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(15) @JvmField val roamdays: Int = 0, @ProtoNumber(15) @JvmField val roamdays: Int = 0,
@ProtoId(26) @JvmField val msgUpIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgUpIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(60) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(60) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(61) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(61) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(62) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(62) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(64) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(64) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(65) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(65) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(66) @JvmField val httpsUrlFlag: Int = 0, @ProtoNumber(66) @JvmField val httpsUrlFlag: Int = 0,
@ProtoId(1001) @JvmField val msgInfo4busi: TryUpInfo4Busi? = null @ProtoNumber(1001) @JvmField val msgInfo4busi: TryUpInfo4Busi? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpInfo4Busi( internal class TryUpInfo4Busi(
@ProtoId(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val thumbDownUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val thumbDownUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val originalDownUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val originalDownUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val bigDownUrl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val bigDownUrl: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -10,141 +10,141 @@ import kotlin.jvm.JvmField
internal class Cmd0x388 : ProtoBuf { internal class Cmd0x388 : ProtoBuf {
@Serializable @Serializable
internal class DelImgReq( internal class DelImgReq(
@ProtoId(1) @JvmField val srcUin: Long = 0L, @ProtoNumber(1) @JvmField val srcUin: Long = 0L,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val reqTerm: Int = 0, @ProtoNumber(3) @JvmField val reqTerm: Int = 0,
@ProtoId(4) @JvmField val reqPlatformType: Int = 0, @ProtoNumber(4) @JvmField val reqPlatformType: Int = 0,
@ProtoId(5) @JvmField val buType: Int = 0, @ProtoNumber(5) @JvmField val buType: Int = 0,
@ProtoId(6) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val picWidth: Int = 0, @ProtoNumber(8) @JvmField val picWidth: Int = 0,
@ProtoId(9) @JvmField val picHeight: Int = 0 @ProtoNumber(9) @JvmField val picHeight: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DelImgRsp( internal class DelImgRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ExpRoamExtendInfo( internal class ExpRoamExtendInfo(
@ProtoId(1) @JvmField val resid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val resid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ExpRoamPicInfo( internal class ExpRoamPicInfo(
@ProtoId(1) @JvmField val shopFlag: Int = 0, @ProtoNumber(1) @JvmField val shopFlag: Int = 0,
@ProtoId(2) @JvmField val pkgId: Int = 0, @ProtoNumber(2) @JvmField val pkgId: Int = 0,
@ProtoId(3) @JvmField val picId: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val picId: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ExtensionCommPicTryUp( internal class ExtensionCommPicTryUp(
@ProtoId(1) @JvmField val bytesExtinfo: List<ByteArray>? = null @ProtoNumber(1) @JvmField val bytesExtinfo: List<ByteArray>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ExtensionExpRoamTryUp( internal class ExtensionExpRoamTryUp(
@ProtoId(1) @JvmField val msgExproamPicInfo: List<ExpRoamPicInfo>? = null @ProtoNumber(1) @JvmField val msgExproamPicInfo: List<ExpRoamPicInfo>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetImgUrlReq( internal class GetImgUrlReq(
@ProtoId(1) @JvmField val groupCode: Long = 0L, @ProtoNumber(1) @JvmField val groupCode: Long = 0L,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val fileid: Long = 0L, @ProtoNumber(3) @JvmField val fileid: Long = 0L,
@ProtoId(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val urlFlag: Int = 0, @ProtoNumber(5) @JvmField val urlFlag: Int = 0,
@ProtoId(6) @JvmField val urlType: Int = 0, @ProtoNumber(6) @JvmField val urlType: Int = 0,
@ProtoId(7) @JvmField val reqTerm: Int = 0, @ProtoNumber(7) @JvmField val reqTerm: Int = 0,
@ProtoId(8) @JvmField val reqPlatformType: Int = 0, @ProtoNumber(8) @JvmField val reqPlatformType: Int = 0,
@ProtoId(9) @JvmField val innerIp: Int = 0, @ProtoNumber(9) @JvmField val innerIp: Int = 0,
@ProtoId(10) @JvmField val buType: Int = 0, @ProtoNumber(10) @JvmField val buType: Int = 0,
@ProtoId(11) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val fileId: Long = 0L, @ProtoNumber(12) @JvmField val fileId: Long = 0L,
@ProtoId(13) @JvmField val fileSize: Long = 0L, @ProtoNumber(13) @JvmField val fileSize: Long = 0L,
@ProtoId(14) @JvmField val originalPic: Int = 0, @ProtoNumber(14) @JvmField val originalPic: Int = 0,
@ProtoId(15) @JvmField val retryReq: Int = 0, @ProtoNumber(15) @JvmField val retryReq: Int = 0,
@ProtoId(16) @JvmField val fileHeight: Int = 0, @ProtoNumber(16) @JvmField val fileHeight: Int = 0,
@ProtoId(17) @JvmField val fileWidth: Int = 0, @ProtoNumber(17) @JvmField val fileWidth: Int = 0,
@ProtoId(18) @JvmField val picType: Int = 0, @ProtoNumber(18) @JvmField val picType: Int = 0,
@ProtoId(19) @JvmField val picUpTimestamp: Int = 0, @ProtoNumber(19) @JvmField val picUpTimestamp: Int = 0,
@ProtoId(20) @JvmField val reqTransferType: Int = 0 @ProtoNumber(20) @JvmField val reqTransferType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetImgUrlRsp( internal class GetImgUrlRsp(
@ProtoId(1) @JvmField val fileid: Long = 0L, @ProtoNumber(1) @JvmField val fileid: Long = 0L,
@ProtoId(2) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val msgImgInfo: ImgInfo? = null, @ProtoNumber(5) @JvmField val msgImgInfo: ImgInfo? = null,
@ProtoId(6) @JvmField val bytesThumbDownUrl: List<ByteArray>? = null, @ProtoNumber(6) @JvmField val bytesThumbDownUrl: List<ByteArray>? = null,
@ProtoId(7) @JvmField val bytesOriginalDownUrl: List<ByteArray>? = null, @ProtoNumber(7) @JvmField val bytesOriginalDownUrl: List<ByteArray>? = null,
@ProtoId(8) @JvmField val bytesBigDownUrl: List<ByteArray>? = null, @ProtoNumber(8) @JvmField val bytesBigDownUrl: List<ByteArray>? = null,
@ProtoId(9) @JvmField val uint32DownIp: List<Int>? = null, @ProtoNumber(9) @JvmField val uint32DownIp: List<Int>? = null,
@ProtoId(10) @JvmField val uint32DownPort: List<Int>? = null, @ProtoNumber(10) @JvmField val uint32DownPort: List<Int>? = null,
@ProtoId(11) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(12) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(13) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(13) @JvmField val originalDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(14) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(14) @JvmField val bigDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(15) @JvmField val fileId: Long = 0L, @ProtoNumber(15) @JvmField val fileId: Long = 0L,
@ProtoId(16) @JvmField val autoDownType: Int = 0, @ProtoNumber(16) @JvmField val autoDownType: Int = 0,
@ProtoId(17) @JvmField val uint32OrderDownType: List<Int>? = null, @ProtoNumber(17) @JvmField val uint32OrderDownType: List<Int>? = null,
@ProtoId(19) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(19) @JvmField val bigThumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(20) @JvmField val httpsUrlFlag: Int = 0, @ProtoNumber(20) @JvmField val httpsUrlFlag: Int = 0,
@ProtoId(26) @JvmField val msgDownIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgDownIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetPttUrlReq( internal class GetPttUrlReq(
@ProtoId(1) @JvmField val groupCode: Long = 0L, @ProtoNumber(1) @JvmField val groupCode: Long = 0L,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val fileid: Long = 0L, @ProtoNumber(3) @JvmField val fileid: Long = 0L,
@ProtoId(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val reqTerm: Int = 0, @ProtoNumber(5) @JvmField val reqTerm: Int = 0,
@ProtoId(6) @JvmField val reqPlatformType: Int = 0, @ProtoNumber(6) @JvmField val reqPlatformType: Int = 0,
@ProtoId(7) @JvmField val innerIp: Int = 0, @ProtoNumber(7) @JvmField val innerIp: Int = 0,
@ProtoId(8) @JvmField val buType: Int = 0, @ProtoNumber(8) @JvmField val buType: Int = 0,
@ProtoId(9) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val fileId: Long = 0L, @ProtoNumber(10) @JvmField val fileId: Long = 0L,
@ProtoId(11) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val codec: Int = 0, @ProtoNumber(12) @JvmField val codec: Int = 0,
@ProtoId(13) @JvmField val buId: Int = 0, @ProtoNumber(13) @JvmField val buId: Int = 0,
@ProtoId(14) @JvmField val reqTransferType: Int = 0, @ProtoNumber(14) @JvmField val reqTransferType: Int = 0,
@ProtoId(15) @JvmField val isAuto: Int = 0 @ProtoNumber(15) @JvmField val isAuto: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetPttUrlRsp( internal class GetPttUrlRsp(
@ProtoId(1) @JvmField val fileid: Long = 0L, @ProtoNumber(1) @JvmField val fileid: Long = 0L,
@ProtoId(2) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val bytesDownUrl: List<ByteArray>? = null, @ProtoNumber(5) @JvmField val bytesDownUrl: List<ByteArray>? = null,
@ProtoId(6) @JvmField val uint32DownIp: List<Int>? = null, @ProtoNumber(6) @JvmField val uint32DownIp: List<Int>? = null,
@ProtoId(7) @JvmField val uint32DownPort: List<Int>? = null, @ProtoNumber(7) @JvmField val uint32DownPort: List<Int>? = null,
@ProtoId(8) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(8) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(9) @JvmField val downPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val downPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val fileId: Long = 0L, @ProtoNumber(10) @JvmField val fileId: Long = 0L,
@ProtoId(11) @JvmField val transferType: Int = 0, @ProtoNumber(11) @JvmField val transferType: Int = 0,
@ProtoId(12) @JvmField val allowRetry: Int = 0, @ProtoNumber(12) @JvmField val allowRetry: Int = 0,
@ProtoId(26) @JvmField val msgDownIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgDownIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(28) @JvmField val strDomain: String = "" @ProtoNumber(28) @JvmField val strDomain: String = ""
) : ProtoBuf ) : ProtoBuf
@Suppress("ArrayInDataClass") @Suppress("ArrayInDataClass")
@Serializable @Serializable
internal class ImgInfo( internal class ImgInfo(
@ProtoId(1) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val fileType: Int = 0, @ProtoNumber(2) @JvmField val fileType: Int = 0,
@ProtoId(3) @JvmField val fileSize: Long = 0L, @ProtoNumber(3) @JvmField val fileSize: Long = 0L,
@ProtoId(4) @JvmField val fileWidth: Int = 0, @ProtoNumber(4) @JvmField val fileWidth: Int = 0,
@ProtoId(5) @JvmField val fileHeight: Int = 0 @ProtoNumber(5) @JvmField val fileHeight: Int = 0
) : ProtoBuf { ) : ProtoBuf {
override fun toString(): String { override fun toString(): String {
return "ImgInfo(fileMd5=${fileMd5.contentToString()}, fileType=$fileType, fileSize=$fileSize, fileWidth=$fileWidth, fileHeight=$fileHeight)" return "ImgInfo(fileMd5=${fileMd5.contentToString()}, fileType=$fileType, fileSize=$fileSize, fileWidth=$fileWidth, fileHeight=$fileHeight)"
@@ -153,128 +153,128 @@ internal class ImgInfo(
@Serializable @Serializable
internal class IPv6Info( internal class IPv6Info(
@ProtoId(1) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val port: Int = 0 @ProtoNumber(2) @JvmField val port: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PicSize( internal class PicSize(
@ProtoId(1) @JvmField val original: Int = 0, @ProtoNumber(1) @JvmField val original: Int = 0,
@ProtoId(2) @JvmField val thumb: Int = 0, @ProtoNumber(2) @JvmField val thumb: Int = 0,
@ProtoId(3) @JvmField val high: Int = 0 @ProtoNumber(3) @JvmField val high: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val netType: Int = 0, @ProtoNumber(1) @JvmField val netType: Int = 0,
@ProtoId(2) @JvmField val subcmd: Int = 0, @ProtoNumber(2) @JvmField val subcmd: Int = 0,
@ProtoId(3) @JvmField val msgTryupImgReq: List<TryUpImgReq>? = null, @ProtoNumber(3) @JvmField val msgTryupImgReq: List<TryUpImgReq>? = null,
@ProtoId(4) @JvmField val msgGetimgUrlReq: List<GetImgUrlReq>? = null, @ProtoNumber(4) @JvmField val msgGetimgUrlReq: List<GetImgUrlReq>? = null,
@ProtoId(5) @JvmField val msgTryupPttReq: List<TryUpPttReq>? = null, @ProtoNumber(5) @JvmField val msgTryupPttReq: List<TryUpPttReq>? = null,
@ProtoId(6) @JvmField val msgGetpttUrlReq: List<GetPttUrlReq>? = null, @ProtoNumber(6) @JvmField val msgGetpttUrlReq: List<GetPttUrlReq>? = null,
@ProtoId(7) @JvmField val commandId: Int = 0, @ProtoNumber(7) @JvmField val commandId: Int = 0,
@ProtoId(8) @JvmField val msgDelImgReq: List<DelImgReq>? = null, @ProtoNumber(8) @JvmField val msgDelImgReq: List<DelImgReq>? = null,
@ProtoId(1001) @JvmField val extension: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1001) @JvmField val extension: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val clientIp: Int = 0, @ProtoNumber(1) @JvmField val clientIp: Int = 0,
@ProtoId(2) @JvmField val subcmd: Int = 0, @ProtoNumber(2) @JvmField val subcmd: Int = 0,
@ProtoId(3) @JvmField val msgTryupImgRsp: List<TryUpImgRsp>? = null, @ProtoNumber(3) @JvmField val msgTryupImgRsp: List<TryUpImgRsp>? = null,
@ProtoId(4) @JvmField val msgGetimgUrlRsp: List<GetImgUrlRsp>? = null, @ProtoNumber(4) @JvmField val msgGetimgUrlRsp: List<GetImgUrlRsp>? = null,
@ProtoId(5) @JvmField val msgTryupPttRsp: List<TryUpPttRsp>? = null, @ProtoNumber(5) @JvmField val msgTryupPttRsp: List<TryUpPttRsp>? = null,
@ProtoId(6) @JvmField val msgGetpttUrlRsp: List<GetPttUrlRsp>? = null, @ProtoNumber(6) @JvmField val msgGetpttUrlRsp: List<GetPttUrlRsp>? = null,
@ProtoId(7) @JvmField val msgDelImgRsp: List<DelImgRsp>? = null @ProtoNumber(7) @JvmField val msgDelImgRsp: List<DelImgRsp>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpImgReq( internal class TryUpImgReq(
@ProtoId(1) @JvmField val groupCode: Long = 0L, @ProtoNumber(1) @JvmField val groupCode: Long = 0L,
@ProtoId(2) @JvmField val srcUin: Long = 0L, @ProtoNumber(2) @JvmField val srcUin: Long = 0L,
@ProtoId(3) @JvmField val fileId: Long = 0L, @ProtoNumber(3) @JvmField val fileId: Long = 0L,
@ProtoId(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val fileSize: Long = 0L, @ProtoNumber(5) @JvmField val fileSize: Long = 0L,
@ProtoId(6) @JvmField val fileName: String = "", @ProtoNumber(6) @JvmField val fileName: String = "",
@ProtoId(7) @JvmField val srcTerm: Int = 0, @ProtoNumber(7) @JvmField val srcTerm: Int = 0,
@ProtoId(8) @JvmField val platformType: Int = 0, @ProtoNumber(8) @JvmField val platformType: Int = 0,
@ProtoId(9) @JvmField val buType: Int = 0, @ProtoNumber(9) @JvmField val buType: Int = 0,
@ProtoId(10) @JvmField val picWidth: Int = 0, @ProtoNumber(10) @JvmField val picWidth: Int = 0,
@ProtoId(11) @JvmField val picHeight: Int = 0, @ProtoNumber(11) @JvmField val picHeight: Int = 0,
@ProtoId(12) @JvmField val picType: Int = 0, @ProtoNumber(12) @JvmField val picType: Int = 0,
@ProtoId(13) @JvmField val buildVer: String = "", @ProtoNumber(13) @JvmField val buildVer: String = "",
@ProtoId(14) @JvmField val innerIp: Int = 0, @ProtoNumber(14) @JvmField val innerIp: Int = 0,
@ProtoId(15) @JvmField val appPicType: Int = 0, @ProtoNumber(15) @JvmField val appPicType: Int = 0,
@ProtoId(16) @JvmField val originalPic: Int = 0, @ProtoNumber(16) @JvmField val originalPic: Int = 0,
@ProtoId(17) @JvmField val fileIndex: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(17) @JvmField val fileIndex: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(18) @JvmField val dstUin: Long = 0L, @ProtoNumber(18) @JvmField val dstUin: Long = 0L,
@ProtoId(19) @JvmField val srvUpload: Int = 0, @ProtoNumber(19) @JvmField val srvUpload: Int = 0,
@ProtoId(20) @JvmField val transferUrl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(20) @JvmField val transferUrl: ByteArray = EMPTY_BYTE_ARRAY
) : ImgReq ) : ImgReq
@Serializable @Serializable
internal class TryUpImgRsp( internal class TryUpImgRsp(
@ProtoId(1) @JvmField val fileId: Long = 0L, @ProtoNumber(1) @JvmField val fileId: Long = 0L,
@ProtoId(2) @JvmField val result: Int = 0, @ProtoNumber(2) @JvmField val result: Int = 0,
@ProtoId(3) @JvmField val failMsg: String = "", @ProtoNumber(3) @JvmField val failMsg: String = "",
@ProtoId(4) @JvmField val boolFileExit: Boolean = false, @ProtoNumber(4) @JvmField val boolFileExit: Boolean = false,
@ProtoId(5) @JvmField val msgImgInfo: ImgInfo? = null, @ProtoNumber(5) @JvmField val msgImgInfo: ImgInfo? = null,
@ProtoId(6) @JvmField val uint32UpIp: List<Int>? = null, @ProtoNumber(6) @JvmField val uint32UpIp: List<Int>? = null,
@ProtoId(7) @JvmField val uint32UpPort: List<Int>? = null, @ProtoNumber(7) @JvmField val uint32UpPort: List<Int>? = null,
@ProtoId(8) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(8) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(9) @JvmField val fileid: Long = 0L, @ProtoNumber(9) @JvmField val fileid: Long = 0L,
@ProtoId(10) @JvmField val upOffset: Long = 0L, @ProtoNumber(10) @JvmField val upOffset: Long = 0L,
@ProtoId(11) @JvmField val blockSize: Long = 0L, @ProtoNumber(11) @JvmField val blockSize: Long = 0L,
@ProtoId(12) @JvmField val boolNewBigChan: Boolean = false, @ProtoNumber(12) @JvmField val boolNewBigChan: Boolean = false,
@ProtoId(26) @JvmField val msgUpIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgUpIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(1001) @JvmField val msgInfo4busi: TryUpInfo4Busi? = null @ProtoNumber(1001) @JvmField val msgInfo4busi: TryUpInfo4Busi? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpInfo4Busi( internal class TryUpInfo4Busi(
@ProtoId(1) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val downDomain: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val thumbDownUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val thumbDownUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val originalDownUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val originalDownUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val bigDownUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val bigDownUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpPttReq( internal class TryUpPttReq(
@ProtoId(1) @JvmField val groupCode: Long = 0L, @ProtoNumber(1) @JvmField val groupCode: Long = 0L,
@ProtoId(2) @JvmField val srcUin: Long = 0L, @ProtoNumber(2) @JvmField val srcUin: Long = 0L,
@ProtoId(3) @JvmField val fileId: Long = 0L, @ProtoNumber(3) @JvmField val fileId: Long = 0L,
@ProtoId(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val fileSize: Long = 0L, @ProtoNumber(5) @JvmField val fileSize: Long = 0L,
@ProtoId(6) @JvmField val fileName: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val fileName: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val srcTerm: Int = 0, @ProtoNumber(7) @JvmField val srcTerm: Int = 0,
@ProtoId(8) @JvmField val platformType: Int = 0, @ProtoNumber(8) @JvmField val platformType: Int = 0,
@ProtoId(9) @JvmField val buType: Int = 0, @ProtoNumber(9) @JvmField val buType: Int = 0,
@ProtoId(10) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val buildVer: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val innerIp: Int = 0, @ProtoNumber(11) @JvmField val innerIp: Int = 0,
@ProtoId(12) @JvmField val voiceLength: Int = 0, @ProtoNumber(12) @JvmField val voiceLength: Int = 0,
@ProtoId(13) @JvmField val boolNewUpChan: Boolean = false, @ProtoNumber(13) @JvmField val boolNewUpChan: Boolean = false,
@ProtoId(14) @JvmField val codec: Int = 0, @ProtoNumber(14) @JvmField val codec: Int = 0,
@ProtoId(15) @JvmField val voiceType: Int = 0, @ProtoNumber(15) @JvmField val voiceType: Int = 0,
@ProtoId(16) @JvmField val buId: Int = 0 @ProtoNumber(16) @JvmField val buId: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TryUpPttRsp( internal class TryUpPttRsp(
@ProtoId(1) @JvmField val fileId: Long = 0L, @ProtoNumber(1) @JvmField val fileId: Long = 0L,
@ProtoId(2) @JvmField val result: Int = 0, @ProtoNumber(2) @JvmField val result: Int = 0,
@ProtoId(3) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val failMsg: ByteArray? = null,
@ProtoId(4) @JvmField val boolFileExit: Boolean = false, @ProtoNumber(4) @JvmField val boolFileExit: Boolean = false,
@ProtoId(5) @JvmField val uint32UpIp: List<Int>? = null, @ProtoNumber(5) @JvmField val uint32UpIp: List<Int>? = null,
@ProtoId(6) @JvmField val uint32UpPort: List<Int>? = null, @ProtoNumber(6) @JvmField val uint32UpPort: List<Int>? = null,
@ProtoId(7) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val upUkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val fileid: Long = 0L, @ProtoNumber(8) @JvmField val fileid: Long = 0L,
@ProtoId(9) @JvmField val upOffset: Long = 0L, @ProtoNumber(9) @JvmField val upOffset: Long = 0L,
@ProtoId(10) @JvmField val blockSize: Long = 0L, @ProtoNumber(10) @JvmField val blockSize: Long = 0L,
@ProtoId(11) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val channelType: Int = 0, @ProtoNumber(12) @JvmField val channelType: Int = 0,
@ProtoId(26) @JvmField val msgUpIp6: List<IPv6Info>? = null, @ProtoNumber(26) @JvmField val msgUpIp6: List<IPv6Info>? = null,
@ProtoId(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(27) @JvmField val clientIp6: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -3,60 +3,60 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoIntegerType
import kotlinx.serialization.protobuf.ProtoNumberType import kotlinx.serialization.protobuf.ProtoNumber
import kotlinx.serialization.protobuf.ProtoType import kotlinx.serialization.protobuf.ProtoType
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
class GroupOpenSysMsg : ProtoBuf { internal class GroupOpenSysMsg : ProtoBuf {
@Serializable @Serializable
internal class LightApp( internal class LightApp(
@ProtoId(1) @JvmField val app: String = "", @ProtoNumber(1) @JvmField val app: String = "",
@ProtoId(2) @JvmField val view: String = "", @ProtoNumber(2) @JvmField val view: String = "",
@ProtoId(3) @JvmField val desc: String = "", @ProtoNumber(3) @JvmField val desc: String = "",
@ProtoId(4) @JvmField val prompt: String = "", @ProtoNumber(4) @JvmField val prompt: String = "",
@ProtoId(5) @JvmField val ver: String = "", @ProtoNumber(5) @JvmField val ver: String = "",
@ProtoId(6) @JvmField val meta: String = "", @ProtoNumber(6) @JvmField val meta: String = "",
@ProtoId(7) @JvmField val config: String = "", @ProtoNumber(7) @JvmField val config: String = "",
@ProtoId(8) @JvmField val source: Source? = null @ProtoNumber(8) @JvmField val source: Source? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RichMsg( internal class RichMsg(
@ProtoId(1) @JvmField val title: String = "", @ProtoNumber(1) @JvmField val title: String = "",
@ProtoId(2) @JvmField val desc: String = "", @ProtoNumber(2) @JvmField val desc: String = "",
@ProtoId(3) @JvmField val brief: String = "", @ProtoNumber(3) @JvmField val brief: String = "",
@ProtoId(4) @JvmField val cover: String = "", @ProtoNumber(4) @JvmField val cover: String = "",
@ProtoId(5) @JvmField val url: String = "", @ProtoNumber(5) @JvmField val url: String = "",
@ProtoId(6) @JvmField val source: Source? = null @ProtoNumber(6) @JvmField val source: Source? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Sender( internal class Sender(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val nick: String = "", @ProtoNumber(2) @JvmField val nick: String = "",
@ProtoId(3) @JvmField val avatar: String = "", @ProtoNumber(3) @JvmField val avatar: String = "",
@ProtoId(4) @JvmField val url: String = "" @ProtoNumber(4) @JvmField val url: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Source( internal class Source(
@ProtoId(1) @JvmField val name: String = "", @ProtoNumber(1) @JvmField val name: String = "",
@ProtoId(2) @JvmField val icon: String = "", @ProtoNumber(2) @JvmField val icon: String = "",
@ProtoId(3) @JvmField val url: String = "" @ProtoNumber(3) @JvmField val url: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SysMsgBody( internal class SysMsgBody(
@ProtoId(1) @JvmField val groupId: Long = 0L, @ProtoNumber(1) @JvmField val groupId: Long = 0L,
@ProtoId(2) @JvmField val appid: Long = 0L, @ProtoNumber(2) @JvmField val appid: Long = 0L,
@ProtoId(3) @JvmField val sender: Sender? = null, @ProtoNumber(3) @JvmField val sender: Sender? = null,
@ProtoId(4) @JvmField val msgType: Int = 0, @ProtoNumber(4) @JvmField val msgType: Int = 0,
@ProtoId(5) @JvmField val content: String = "", @ProtoNumber(5) @JvmField val content: String = "",
@ProtoId(6) @JvmField val richMsg: RichMsg? = null, @ProtoNumber(6) @JvmField val richMsg: RichMsg? = null,
@ProtoId(7) @JvmField val lightApp: LightApp? = null @ProtoNumber(7) @JvmField val lightApp: LightApp? = null
) : ProtoBuf ) : ProtoBuf
} }
@@ -64,337 +64,337 @@ class GroupOpenSysMsg : ProtoBuf {
internal class TroopTips0x857 : ProtoBuf { internal class TroopTips0x857 : ProtoBuf {
@Serializable @Serializable
internal class AIOGrayTipsInfo( internal class AIOGrayTipsInfo(
@ProtoId(1) @JvmField val optUint32ShowLastest: Int = 0, @ProtoNumber(1) @JvmField val optUint32ShowLastest: Int = 0,
@ProtoId(2) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val optUint32Remind: Int = 0, @ProtoNumber(3) @JvmField val optUint32Remind: Int = 0,
@ProtoId(4) @JvmField val optBytesBrief: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val optBytesBrief: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val receiverUin: Long = 0L, @ProtoNumber(5) @JvmField val receiverUin: Long = 0L,
@ProtoId(6) @JvmField val reliaoAdminOpt: Int = 0, @ProtoNumber(6) @JvmField val reliaoAdminOpt: Int = 0,
@ProtoId(7) @JvmField val robotGroupOpt: Int = 0 @ProtoNumber(7) @JvmField val robotGroupOpt: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AIOTopTipsInfo( internal class AIOTopTipsInfo(
@ProtoId(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val optUint32Icon: Int = 0, @ProtoNumber(2) @JvmField val optUint32Icon: Int = 0,
@ProtoId(3) @JvmField val optEnumAction: Int /* enum */ = 1, @ProtoNumber(3) @JvmField val optEnumAction: Int /* enum */ = 1,
@ProtoId(4) @JvmField val optBytesUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val optBytesUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val optBytesData: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val optBytesData: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val optBytesDataI: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val optBytesDataI: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val optBytesDataA: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val optBytesDataA: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val optBytesDataP: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(8) @JvmField val optBytesDataP: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FloatedTipsInfo( internal class FloatedTipsInfo(
@ProtoId(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GeneralGrayTipInfo( internal class GeneralGrayTipInfo(
@ProtoId(1) @JvmField val busiType: Long = 0L, @ProtoNumber(1) @JvmField val busiType: Long = 0L,
@ProtoId(2) @JvmField val busiId: Long = 0L, @ProtoNumber(2) @JvmField val busiId: Long = 0L,
@ProtoId(3) @JvmField val ctrlFlag: Int = 0, @ProtoNumber(3) @JvmField val ctrlFlag: Int = 0,
@ProtoId(4) @JvmField val c2cType: Int = 0, @ProtoNumber(4) @JvmField val c2cType: Int = 0,
@ProtoId(5) @JvmField val serviceType: Int = 0, @ProtoNumber(5) @JvmField val serviceType: Int = 0,
@ProtoId(6) @JvmField val templId: Long = 0L, @ProtoNumber(6) @JvmField val templId: Long = 0L,
@ProtoId(7) @JvmField val msgTemplParam: List<TemplParam>? = null, @ProtoNumber(7) @JvmField val msgTemplParam: List<TemplParam>? = null,
@ProtoId(8) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(8) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val tipsSeqId: Long = 0L, @ProtoNumber(10) @JvmField val tipsSeqId: Long = 0L,
@ProtoId(100) @JvmField val pbReserv: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(100) @JvmField val pbReserv: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GoldMsgTipsElem( internal class GoldMsgTipsElem(
@ProtoId(1) @JvmField val type: Int = 0, @ProtoNumber(1) @JvmField val type: Int = 0,
@ProtoId(2) @JvmField val billno: String = "", @ProtoNumber(2) @JvmField val billno: String = "",
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val amount: Int = 0, @ProtoNumber(4) @JvmField val amount: Int = 0,
@ProtoId(5) @JvmField val total: Int = 0, @ProtoNumber(5) @JvmField val total: Int = 0,
@ProtoId(6) @JvmField val interval: Int = 0, @ProtoNumber(6) @JvmField val interval: Int = 0,
@ProtoId(7) @JvmField val finish: Int = 0, @ProtoNumber(7) @JvmField val finish: Int = 0,
@ProtoId(8) @JvmField val uin: List<Long>? = null, @ProtoNumber(8) @JvmField val uin: List<Long>? = null,
@ProtoId(9) @JvmField val action: Int = 0 @ProtoNumber(9) @JvmField val action: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupInfoChange( internal class GroupInfoChange(
@ProtoId(1) @JvmField val groupHonorSwitch: Int = 0 @ProtoNumber(1) @JvmField val groupHonorSwitch: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupNotifyInfo( internal class GroupNotifyInfo(
@ProtoId(1) @JvmField val optUint32AutoPullFlag: Int = 0, @ProtoNumber(1) @JvmField val optUint32AutoPullFlag: Int = 0,
@ProtoId(2) @JvmField val optBytesFeedsId: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val optBytesFeedsId: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class InstCtrl( internal class InstCtrl(
@ProtoId(1) @JvmField val msgSendToInst: List<InstInfo>? = null, @ProtoNumber(1) @JvmField val msgSendToInst: List<InstInfo>? = null,
@ProtoId(2) @JvmField val msgExcludeInst: List<InstInfo>? = null, @ProtoNumber(2) @JvmField val msgExcludeInst: List<InstInfo>? = null,
@ProtoId(3) @JvmField val msgFromInst: InstInfo? = null @ProtoNumber(3) @JvmField val msgFromInst: InstInfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class InstInfo( internal class InstInfo(
@ProtoId(1) @JvmField val apppid: Int = 0, @ProtoNumber(1) @JvmField val apppid: Int = 0,
@ProtoId(2) @JvmField val instid: Int = 0, @ProtoNumber(2) @JvmField val instid: Int = 0,
@ProtoId(3) @JvmField val platform: Int = 0, @ProtoNumber(3) @JvmField val platform: Int = 0,
@ProtoId(4) @JvmField val openAppid: Int = 0, @ProtoNumber(4) @JvmField val openAppid: Int = 0,
@ProtoId(5) @JvmField val productid: Int = 0, @ProtoNumber(5) @JvmField val productid: Int = 0,
@ProtoId(6) @JvmField val ssoBid: Int = 0, @ProtoNumber(6) @JvmField val ssoBid: Int = 0,
@ProtoId(7) @JvmField val guid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val guid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val verMin: Int = 0, @ProtoNumber(8) @JvmField val verMin: Int = 0,
@ProtoId(9) @JvmField val verMax: Int = 0 @ProtoNumber(9) @JvmField val verMax: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LbsShareChangePushInfo( internal class LbsShareChangePushInfo(
@ProtoId(1) @JvmField val msgType: Int = 0, @ProtoNumber(1) @JvmField val msgType: Int = 0,
@ProtoId(2) @JvmField val msgInfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val msgInfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val versionCtrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val versionCtrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val groupId: Long = 0L, @ProtoNumber(4) @JvmField val groupId: Long = 0L,
@ProtoId(5) @JvmField val operUin: Long = 0L, @ProtoNumber(5) @JvmField val operUin: Long = 0L,
@ProtoId(6) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val msgSeq: Long = 0L, @ProtoNumber(7) @JvmField val msgSeq: Long = 0L,
@ProtoId(8) @JvmField val joinNums: Int = 0, @ProtoNumber(8) @JvmField val joinNums: Int = 0,
@ProtoId(99) @JvmField val pushType: Int = 0, @ProtoNumber(99) @JvmField val pushType: Int = 0,
@ProtoId(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LuckyBagNotify( internal class LuckyBagNotify(
@ProtoId(1) @JvmField val msgTips: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val msgTips: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MediaChangePushInfo( internal class MediaChangePushInfo(
@ProtoId(1) @JvmField val msgType: Int = 0, @ProtoNumber(1) @JvmField val msgType: Int = 0,
@ProtoId(2) @JvmField val msgInfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val msgInfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val versionCtrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val versionCtrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val groupId: Long = 0L, @ProtoNumber(4) @JvmField val groupId: Long = 0L,
@ProtoId(5) @JvmField val operUin: Long = 0L, @ProtoNumber(5) @JvmField val operUin: Long = 0L,
@ProtoId(6) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val msgSeq: Long = 0L, @ProtoNumber(7) @JvmField val msgSeq: Long = 0L,
@ProtoId(8) @JvmField val joinNums: Int = 0, @ProtoNumber(8) @JvmField val joinNums: Int = 0,
@ProtoId(9) @JvmField val msgPerSetting: PersonalSetting? = null, @ProtoNumber(9) @JvmField val msgPerSetting: PersonalSetting? = null,
@ProtoId(10) @JvmField val playMode: Int = 0, @ProtoNumber(10) @JvmField val playMode: Int = 0,
@ProtoId(99) @JvmField val mediaType: Int = 0, @ProtoNumber(99) @JvmField val mediaType: Int = 0,
@ProtoId(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class PersonalSetting( internal class PersonalSetting(
@ProtoId(1) @JvmField val themeId: Int = 0, @ProtoNumber(1) @JvmField val themeId: Int = 0,
@ProtoId(2) @JvmField val playerId: Int = 0, @ProtoNumber(2) @JvmField val playerId: Int = 0,
@ProtoId(3) @JvmField val fontId: Int = 0 @ProtoNumber(3) @JvmField val fontId: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class MessageBoxInfo( internal class MessageBoxInfo(
@ProtoId(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val optBytesContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val optBytesTitle: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val optBytesTitle: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val optBytesButton: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val optBytesButton: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MessageRecallReminder( internal class MessageRecallReminder(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val recalledMsgList: List<MessageMeta> = listOf(), @ProtoNumber(3) @JvmField val recalledMsgList: List<MessageMeta> = listOf(),
@ProtoId(4) @JvmField val reminderContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val reminderContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val userdef: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val userdef: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val groupType: Int = 0, @ProtoNumber(6) @JvmField val groupType: Int = 0,
@ProtoId(7) @JvmField val opType: Int = 0 @ProtoNumber(7) @JvmField val opType: Int = 0
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class MessageMeta( internal class MessageMeta(
@ProtoId(1) @JvmField val seq: Int = 0, @ProtoNumber(1) @JvmField val seq: Int = 0,
@ProtoId(2) @JvmField val time: Int = 0, @ProtoNumber(2) @JvmField val time: Int = 0,
@ProtoId(3) @JvmField val msgRandom: Int = 0, @ProtoNumber(3) @JvmField val msgRandom: Int = 0,
@ProtoId(4) @JvmField val msgType: Int = 0, @ProtoNumber(4) @JvmField val msgType: Int = 0,
@ProtoId(5) @JvmField val msgFlag: Int = 0, @ProtoNumber(5) @JvmField val msgFlag: Int = 0,
@ProtoId(6) @JvmField val authorUin: Long = 0L @ProtoNumber(6) @JvmField val authorUin: Long = 0L
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class MiniAppNotify( internal class MiniAppNotify(
@ProtoId(1) @JvmField val msg: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val msg: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NotifyMsgBody( internal class NotifyMsgBody(
@ProtoId(1) @JvmField val optEnumType: Int /* enum */ = 1, @ProtoNumber(1) @JvmField val optEnumType: Int /* enum */ = 1,
@ProtoId(2) @JvmField val optUint64MsgTime: Long = 0L, @ProtoNumber(2) @JvmField val optUint64MsgTime: Long = 0L,
@ProtoId(3) @JvmField val optUint64MsgExpires: Long = 0L, @ProtoNumber(3) @JvmField val optUint64MsgExpires: Long = 0L,
@ProtoId(4) @JvmField val optUint64GroupCode: Long = 0L, @ProtoNumber(4) @JvmField val optUint64GroupCode: Long = 0L,
@ProtoId(5) @JvmField val optMsgGraytips: AIOGrayTipsInfo? = null, @ProtoNumber(5) @JvmField val optMsgGraytips: AIOGrayTipsInfo? = null,
@ProtoId(6) @JvmField val optMsgMessagebox: MessageBoxInfo? = null, @ProtoNumber(6) @JvmField val optMsgMessagebox: MessageBoxInfo? = null,
@ProtoId(7) @JvmField val optMsgFloatedtips: FloatedTipsInfo? = null, @ProtoNumber(7) @JvmField val optMsgFloatedtips: FloatedTipsInfo? = null,
@ProtoId(8) @JvmField val optMsgToptips: AIOTopTipsInfo? = null, @ProtoNumber(8) @JvmField val optMsgToptips: AIOTopTipsInfo? = null,
@ProtoId(9) @JvmField val optMsgRedtips: RedGrayTipsInfo? = null, @ProtoNumber(9) @JvmField val optMsgRedtips: RedGrayTipsInfo? = null,
@ProtoId(10) @JvmField val optMsgGroupNotify: GroupNotifyInfo? = null, @ProtoNumber(10) @JvmField val optMsgGroupNotify: GroupNotifyInfo? = null,
@ProtoId(11) @JvmField val optMsgRecall: MessageRecallReminder? = null, @ProtoNumber(11) @JvmField val optMsgRecall: MessageRecallReminder? = null,
@ProtoId(12) @JvmField val optMsgThemeNotify: ThemeStateNotify? = null, @ProtoNumber(12) @JvmField val optMsgThemeNotify: ThemeStateNotify? = null,
@ProtoId(13) @JvmField val serviceType: Int = 0, @ProtoNumber(13) @JvmField val serviceType: Int = 0,
@ProtoId(14) @JvmField val optMsgObjmsgUpdate: NotifyObjmsgUpdate? = null, @ProtoNumber(14) @JvmField val optMsgObjmsgUpdate: NotifyObjmsgUpdate? = null,
@ProtoId(15) @JvmField val optMsgWerewolfPush: WereWolfPush? = null, @ProtoNumber(15) @JvmField val optMsgWerewolfPush: WereWolfPush? = null,
// @SerialId(16) @JvmField val optStcmGameState: ApolloGameStatus.STCMGameMessage? = null, // @SerialId(16) @JvmField val optStcmGameState: ApolloGameStatus.STCMGameMessage? = null,
// @SerialId(17) @JvmField val aplloMsgPush: ApolloPushMsgInfo.STPushMsgElem? = null, // @SerialId(17) @JvmField val aplloMsgPush: ApolloPushMsgInfo.STPushMsgElem? = null,
@ProtoId(18) @JvmField val optMsgGoldtips: GoldMsgTipsElem? = null, @ProtoNumber(18) @JvmField val optMsgGoldtips: GoldMsgTipsElem? = null,
@ProtoId(20) @JvmField val optMsgMiniappNotify: MiniAppNotify? = null, @ProtoNumber(20) @JvmField val optMsgMiniappNotify: MiniAppNotify? = null,
@ProtoId(21) @JvmField val optUint64SenderUin: Long = 0L, @ProtoNumber(21) @JvmField val optUint64SenderUin: Long = 0L,
@ProtoId(22) @JvmField val optMsgLuckybagNotify: LuckyBagNotify? = null, @ProtoNumber(22) @JvmField val optMsgLuckybagNotify: LuckyBagNotify? = null,
@ProtoId(23) @JvmField val optMsgTroopformtipsPush: TroopFormGrayTipsInfo? = null, @ProtoNumber(23) @JvmField val optMsgTroopformtipsPush: TroopFormGrayTipsInfo? = null,
@ProtoId(24) @JvmField val optMsgMediaPush: MediaChangePushInfo? = null, @ProtoNumber(24) @JvmField val optMsgMediaPush: MediaChangePushInfo? = null,
@ProtoId(26) @JvmField val optGeneralGrayTip: GeneralGrayTipInfo? = null, @ProtoNumber(26) @JvmField val optGeneralGrayTip: GeneralGrayTipInfo? = null,
@ProtoId(27) @JvmField val optMsgVideoPush: VideoChangePushInfo? = null, @ProtoNumber(27) @JvmField val optMsgVideoPush: VideoChangePushInfo? = null,
@ProtoId(28) @JvmField val optLbsShareChangePlusInfo: LbsShareChangePushInfo? = null, @ProtoNumber(28) @JvmField val optLbsShareChangePlusInfo: LbsShareChangePushInfo? = null,
@ProtoId(29) @JvmField val optMsgSingPush: SingChangePushInfo? = null, @ProtoNumber(29) @JvmField val optMsgSingPush: SingChangePushInfo? = null,
@ProtoId(30) @JvmField val optMsgGroupInfoChange: GroupInfoChange? = null @ProtoNumber(30) @JvmField val optMsgGroupInfoChange: GroupInfoChange? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NotifyObjmsgUpdate( internal class NotifyObjmsgUpdate(
@ProtoId(1) @JvmField val objmsgId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val objmsgId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val updateType: Int = 0, @ProtoNumber(2) @JvmField val updateType: Int = 0,
@ProtoId(3) @JvmField val extMsg: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val extMsg: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RedGrayTipsInfo( internal class RedGrayTipsInfo(
@ProtoId(1) @JvmField val optUint32ShowLastest: Int = 0, @ProtoNumber(1) @JvmField val optUint32ShowLastest: Int = 0,
@ProtoId(2) @JvmField val senderUin: Long = 0L, @ProtoNumber(2) @JvmField val senderUin: Long = 0L,
@ProtoId(3) @JvmField val receiverUin: Long = 0L, @ProtoNumber(3) @JvmField val receiverUin: Long = 0L,
@ProtoId(4) @JvmField val senderRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val senderRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val receiverRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val receiverRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val authkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val authkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoType(ProtoNumberType.SIGNED) @ProtoId(7) @JvmField val sint32Msgtype: Int = 0, @ProtoType(ProtoIntegerType.SIGNED) @ProtoNumber(7) @JvmField val sint32Msgtype: Int = 0,
@ProtoId(8) @JvmField val luckyFlag: Int = 0, @ProtoNumber(8) @JvmField val luckyFlag: Int = 0,
@ProtoId(9) @JvmField val hideFlag: Int = 0, @ProtoNumber(9) @JvmField val hideFlag: Int = 0,
@ProtoId(10) @JvmField val pcBody: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val pcBody: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val icon: Int = 0, @ProtoNumber(11) @JvmField val icon: Int = 0,
@ProtoId(12) @JvmField val luckyUin: Long = 0L, @ProtoNumber(12) @JvmField val luckyUin: Long = 0L,
@ProtoId(13) @JvmField val time: Int = 0, @ProtoNumber(13) @JvmField val time: Int = 0,
@ProtoId(14) @JvmField val random: Int = 0, @ProtoNumber(14) @JvmField val random: Int = 0,
@ProtoId(15) @JvmField val broadcastRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(15) @JvmField val broadcastRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(16) @JvmField val idiom: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(16) @JvmField val idiom: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(17) @JvmField val idiomSeq: Int = 0, @ProtoNumber(17) @JvmField val idiomSeq: Int = 0,
@ProtoId(18) @JvmField val idiomAlpha: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(18) @JvmField val idiomAlpha: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(19) @JvmField val jumpurl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(19) @JvmField val jumpurl: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val optUint64GroupCode: Long = 0L, @ProtoNumber(1) @JvmField val optUint64GroupCode: Long = 0L,
@ProtoId(2) @JvmField val uint64Memberuins: List<Long>? = null, @ProtoNumber(2) @JvmField val uint64Memberuins: List<Long>? = null,
@ProtoId(3) @JvmField val optUint32Offline: Int = 0, @ProtoNumber(3) @JvmField val optUint32Offline: Int = 0,
@ProtoId(4) @JvmField val msgInstCtrl: InstCtrl? = null, @ProtoNumber(4) @JvmField val msgInstCtrl: InstCtrl? = null,
@ProtoId(5) @JvmField val optBytesMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val optBytesMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val optUint32BusiType: Int = 0 @ProtoNumber(6) @JvmField val optUint32BusiType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val optUint64GroupCode: Long = 0L @ProtoNumber(1) @JvmField val optUint64GroupCode: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SingChangePushInfo( internal class SingChangePushInfo(
@ProtoId(1) @JvmField val seq: Long = 0L, @ProtoNumber(1) @JvmField val seq: Long = 0L,
@ProtoId(2) @JvmField val actionType: Int = 0, @ProtoNumber(2) @JvmField val actionType: Int = 0,
@ProtoId(3) @JvmField val groupId: Long = 0L, @ProtoNumber(3) @JvmField val groupId: Long = 0L,
@ProtoId(4) @JvmField val operUin: Long = 0L, @ProtoNumber(4) @JvmField val operUin: Long = 0L,
@ProtoId(5) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val joinNums: Int = 0 @ProtoNumber(6) @JvmField val joinNums: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TemplParam( internal class TemplParam(
@ProtoId(1) @JvmField val name: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val name: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val value: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val value: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ThemeStateNotify( internal class ThemeStateNotify(
@ProtoId(1) @JvmField val state: Int = 0, @ProtoNumber(1) @JvmField val state: Int = 0,
@ProtoId(2) @JvmField val feedsId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val feedsId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val themeName: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val themeName: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val actionUin: Long = 0L, @ProtoNumber(4) @JvmField val actionUin: Long = 0L,
@ProtoId(5) @JvmField val createUin: Long = 0L @ProtoNumber(5) @JvmField val createUin: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TroopFormGrayTipsInfo( internal class TroopFormGrayTipsInfo(
@ProtoId(1) @JvmField val writerUin: Long = 0L, @ProtoNumber(1) @JvmField val writerUin: Long = 0L,
@ProtoId(2) @JvmField val creatorUin: Long = 0L, @ProtoNumber(2) @JvmField val creatorUin: Long = 0L,
@ProtoId(3) @JvmField val richContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val richContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val optBytesUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val optBytesUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val creatorNick: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val creatorNick: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class VideoChangePushInfo( internal class VideoChangePushInfo(
@ProtoId(1) @JvmField val seq: Long = 0L, @ProtoNumber(1) @JvmField val seq: Long = 0L,
@ProtoId(2) @JvmField val actionType: Int = 0, @ProtoNumber(2) @JvmField val actionType: Int = 0,
@ProtoId(3) @JvmField val groupId: Long = 0L, @ProtoNumber(3) @JvmField val groupId: Long = 0L,
@ProtoId(4) @JvmField val operUin: Long = 0L, @ProtoNumber(4) @JvmField val operUin: Long = 0L,
@ProtoId(5) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val grayTips: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val joinNums: Int = 0, @ProtoNumber(6) @JvmField val joinNums: Int = 0,
@ProtoId(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(100) @JvmField val extInfo: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class WereWolfPush( internal class WereWolfPush(
@ProtoId(1) @JvmField val pushType: Int = 0, @ProtoNumber(1) @JvmField val pushType: Int = 0,
@ProtoId(2) @JvmField val gameRoom: Long = 0L, @ProtoNumber(2) @JvmField val gameRoom: Long = 0L,
@ProtoId(3) @JvmField val enumGameState: Int = 0, @ProtoNumber(3) @JvmField val enumGameState: Int = 0,
@ProtoId(4) @JvmField val gameRound: Int = 0, @ProtoNumber(4) @JvmField val gameRound: Int = 0,
@ProtoId(5) @JvmField val roles: List<Role>? = null, @ProtoNumber(5) @JvmField val roles: List<Role>? = null,
@ProtoId(6) @JvmField val speaker: Long = 0L, @ProtoNumber(6) @JvmField val speaker: Long = 0L,
@ProtoId(7) @JvmField val judgeUin: Long = 0L, @ProtoNumber(7) @JvmField val judgeUin: Long = 0L,
@ProtoId(8) @JvmField val judgeWords: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(8) @JvmField val judgeWords: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(9) @JvmField val enumOperation: Int = 0, @ProtoNumber(9) @JvmField val enumOperation: Int = 0,
@ProtoId(10) @JvmField val srcUser: Long = 0L, @ProtoNumber(10) @JvmField val srcUser: Long = 0L,
@ProtoId(11) @JvmField val dstUser: Long = 0L, @ProtoNumber(11) @JvmField val dstUser: Long = 0L,
@ProtoId(12) @JvmField val deadUsers: List<Long>? = null, @ProtoNumber(12) @JvmField val deadUsers: List<Long>? = null,
@ProtoId(13) @JvmField val gameResult: Int = 0, @ProtoNumber(13) @JvmField val gameResult: Int = 0,
@ProtoId(14) @JvmField val timeoutSec: Int = 0, @ProtoNumber(14) @JvmField val timeoutSec: Int = 0,
@ProtoId(15) @JvmField val killConfirmed: Int = 0, @ProtoNumber(15) @JvmField val killConfirmed: Int = 0,
@ProtoId(16) @JvmField val judgeNickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(16) @JvmField val judgeNickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(17) @JvmField val votedTieUsers: List<Long>? = null @ProtoNumber(17) @JvmField val votedTieUsers: List<Long>? = null
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class GameRecord( internal class GameRecord(
@ProtoId(1) @JvmField val total: Int = 0, @ProtoNumber(1) @JvmField val total: Int = 0,
@ProtoId(2) @JvmField val win: Int = 0, @ProtoNumber(2) @JvmField val win: Int = 0,
@ProtoId(3) @JvmField val lose: Int = 0, @ProtoNumber(3) @JvmField val lose: Int = 0,
@ProtoId(4) @JvmField val draw: Int = 0 @ProtoNumber(4) @JvmField val draw: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Role( internal class Role(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val enumType: Int = 0, @ProtoNumber(2) @JvmField val enumType: Int = 0,
@ProtoId(3) @JvmField val enumState: Int = 0, @ProtoNumber(3) @JvmField val enumState: Int = 0,
@ProtoId(4) @JvmField val canSpeak: Int = 0, @ProtoNumber(4) @JvmField val canSpeak: Int = 0,
@ProtoId(5) @JvmField val canListen: Int = 0, @ProtoNumber(5) @JvmField val canListen: Int = 0,
@ProtoId(6) @JvmField val position: Int = 0, @ProtoNumber(6) @JvmField val position: Int = 0,
@ProtoId(7) @JvmField val canVote: Int = 0, @ProtoNumber(7) @JvmField val canVote: Int = 0,
@ProtoId(8) @JvmField val canVoted: Int = 0, @ProtoNumber(8) @JvmField val canVoted: Int = 0,
@ProtoId(9) @JvmField val alreadyChecked: Int = 0, @ProtoNumber(9) @JvmField val alreadyChecked: Int = 0,
@ProtoId(10) @JvmField val alreadySaved: Int = 0, @ProtoNumber(10) @JvmField val alreadySaved: Int = 0,
@ProtoId(11) @JvmField val alreadyPoisoned: Int = 0, @ProtoNumber(11) @JvmField val alreadyPoisoned: Int = 0,
@ProtoId(12) @JvmField val playerState: Int = 0, @ProtoNumber(12) @JvmField val playerState: Int = 0,
@ProtoId(13) @JvmField val enumDeadOp: Int = 0, @ProtoNumber(13) @JvmField val enumDeadOp: Int = 0,
@ProtoId(14) @JvmField val enumOperation: Int = 0, @ProtoNumber(14) @JvmField val enumOperation: Int = 0,
@ProtoId(15) @JvmField val dstUser: Long = 0L, @ProtoNumber(15) @JvmField val dstUser: Long = 0L,
@ProtoId(16) @JvmField val operationRound: Int = 0, @ProtoNumber(16) @JvmField val operationRound: Int = 0,
@ProtoId(17) @JvmField val msgGameRecord: GameRecord? = null, @ProtoNumber(17) @JvmField val msgGameRecord: GameRecord? = null,
@ProtoId(18) @JvmField val isWerewolf: Int = 0, @ProtoNumber(18) @JvmField val isWerewolf: Int = 0,
@ProtoId(19) @JvmField val defendedUser: Long = 0L, @ProtoNumber(19) @JvmField val defendedUser: Long = 0L,
@ProtoId(20) @JvmField val isSheriff: Int = 0 @ProtoNumber(20) @JvmField val isSheriff: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
} }

View File

@@ -3,8 +3,8 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoIntegerType
import kotlinx.serialization.protobuf.ProtoNumberType import kotlinx.serialization.protobuf.ProtoNumber
import kotlinx.serialization.protobuf.ProtoType import kotlinx.serialization.protobuf.ProtoType
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
@@ -14,74 +14,74 @@ import kotlin.jvm.JvmField
internal class Oidb0x858 : ProtoBuf { internal class Oidb0x858 : ProtoBuf {
@Serializable @Serializable
internal class GoldMsgTipsElem( internal class GoldMsgTipsElem(
@ProtoId(1) @JvmField val type: Int = 0, @ProtoNumber(1) @JvmField val type: Int = 0,
@ProtoId(2) @JvmField val billno: String = "", @ProtoNumber(2) @JvmField val billno: String = "",
@ProtoId(3) @JvmField val result: Int = 0, @ProtoNumber(3) @JvmField val result: Int = 0,
@ProtoId(4) @JvmField val amount: Int = 0, @ProtoNumber(4) @JvmField val amount: Int = 0,
@ProtoId(5) @JvmField val total: Int = 0, @ProtoNumber(5) @JvmField val total: Int = 0,
@ProtoId(6) @JvmField val interval: Int = 0, @ProtoNumber(6) @JvmField val interval: Int = 0,
@ProtoId(7) @JvmField val finish: Int = 0, @ProtoNumber(7) @JvmField val finish: Int = 0,
@ProtoId(8) @JvmField val uin: List<Long>? = null, @ProtoNumber(8) @JvmField val uin: List<Long>? = null,
@ProtoId(9) @JvmField val action: Int = 0 @ProtoNumber(9) @JvmField val action: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MessageRecallReminder( internal class MessageRecallReminder(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val recalledMsgList: List<MessageMeta> = listOf(), @ProtoNumber(3) @JvmField val recalledMsgList: List<MessageMeta> = listOf(),
@ProtoId(4) @JvmField val reminderContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val reminderContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val userdef: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val userdef: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class MessageMeta( internal class MessageMeta(
@ProtoId(1) @JvmField val seq: Int = 0, @ProtoNumber(1) @JvmField val seq: Int = 0,
@ProtoId(2) @JvmField val time: Int = 0, @ProtoNumber(2) @JvmField val time: Int = 0,
@ProtoId(3) @JvmField val msgRandom: Int = 0 @ProtoNumber(3) @JvmField val msgRandom: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class NotifyMsgBody( internal class NotifyMsgBody(
@ProtoId(1) @JvmField val optEnumType: Int /* enum */ = 5, @ProtoNumber(1) @JvmField val optEnumType: Int /* enum */ = 5,
@ProtoId(2) @JvmField val optUint64MsgTime: Long = 0L, @ProtoNumber(2) @JvmField val optUint64MsgTime: Long = 0L,
@ProtoId(3) @JvmField val optUint64MsgExpires: Long = 0L, @ProtoNumber(3) @JvmField val optUint64MsgExpires: Long = 0L,
@ProtoId(4) @JvmField val optUint64ConfUin: Long = 0L, @ProtoNumber(4) @JvmField val optUint64ConfUin: Long = 0L,
@ProtoId(5) @JvmField val optMsgRedtips: RedGrayTipsInfo? = null, @ProtoNumber(5) @JvmField val optMsgRedtips: RedGrayTipsInfo? = null,
@ProtoId(6) @JvmField val optMsgRecallReminder: MessageRecallReminder? = null, @ProtoNumber(6) @JvmField val optMsgRecallReminder: MessageRecallReminder? = null,
@ProtoId(7) @JvmField val optMsgObjUpdate: NotifyObjmsgUpdate? = null, @ProtoNumber(7) @JvmField val optMsgObjUpdate: NotifyObjmsgUpdate? = null,
// @SerialId(8) @JvmField val optStcmGameState: ApolloGameStatus.STCMGameMessage? = null, // @SerialId(8) @JvmField val optStcmGameState: ApolloGameStatus.STCMGameMessage? = null,
// @SerialId(9) @JvmField val aplloMsgPush: ApolloPushMsgInfo.STPushMsgElem? = null, // @SerialId(9) @JvmField val aplloMsgPush: ApolloPushMsgInfo.STPushMsgElem? = null,
@ProtoId(10) @JvmField val optMsgGoldtips: GoldMsgTipsElem? = null @ProtoNumber(10) @JvmField val optMsgGoldtips: GoldMsgTipsElem? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NotifyObjmsgUpdate( internal class NotifyObjmsgUpdate(
@ProtoId(1) @JvmField val objmsgId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val objmsgId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val updateType: Int = 0, @ProtoNumber(2) @JvmField val updateType: Int = 0,
@ProtoId(3) @JvmField val extMsg: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val extMsg: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RedGrayTipsInfo( internal class RedGrayTipsInfo(
@ProtoId(1) @JvmField val optUint32ShowLastest: Int = 0, @ProtoNumber(1) @JvmField val optUint32ShowLastest: Int = 0,
@ProtoId(2) @JvmField val senderUin: Long = 0L, @ProtoNumber(2) @JvmField val senderUin: Long = 0L,
@ProtoId(3) @JvmField val receiverUin: Long = 0L, @ProtoNumber(3) @JvmField val receiverUin: Long = 0L,
@ProtoId(4) @JvmField val senderRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val senderRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val receiverRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val receiverRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val authkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val authkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoType(ProtoNumberType.SIGNED) @ProtoId(7) @JvmField val sint32Msgtype: Int = 0, @ProtoType(ProtoIntegerType.SIGNED) @ProtoNumber(7) @JvmField val sint32Msgtype: Int = 0,
@ProtoId(8) @JvmField val luckyFlag: Int = 0, @ProtoNumber(8) @JvmField val luckyFlag: Int = 0,
@ProtoId(9) @JvmField val hideFlag: Int = 0, @ProtoNumber(9) @JvmField val hideFlag: Int = 0,
@ProtoId(10) @JvmField val pcBody: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val pcBody: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val icon: Int = 0, @ProtoNumber(11) @JvmField val icon: Int = 0,
@ProtoId(12) @JvmField val luckyUin: Long = 0L, @ProtoNumber(12) @JvmField val luckyUin: Long = 0L,
@ProtoId(13) @JvmField val time: Int = 0, @ProtoNumber(13) @JvmField val time: Int = 0,
@ProtoId(14) @JvmField val random: Int = 0, @ProtoNumber(14) @JvmField val random: Int = 0,
@ProtoId(15) @JvmField val broadcastRichContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(15) @JvmField val broadcastRichContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(16) @JvmField val idiom: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(16) @JvmField val idiom: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(17) @JvmField val idiomSeq: Int = 0, @ProtoNumber(17) @JvmField val idiomSeq: Int = 0,
@ProtoId(18) @JvmField val idiomAlpha: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(18) @JvmField val idiomAlpha: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(19) @JvmField val jumpurl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(19) @JvmField val jumpurl: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,56 +9,56 @@ import kotlin.jvm.JvmField
internal class Common : ProtoBuf { internal class Common : ProtoBuf {
@Serializable @Serializable
internal class BindInfo( internal class BindInfo(
@ProtoId(1) @JvmField val friUin: Long = 0L, @ProtoNumber(1) @JvmField val friUin: Long = 0L,
@ProtoId(2) @JvmField val friNick: String = "", @ProtoNumber(2) @JvmField val friNick: String = "",
@ProtoId(3) @JvmField val time: Long = 0L, @ProtoNumber(3) @JvmField val time: Long = 0L,
@ProtoId(4) @JvmField val bindStatus: Int = 0 @ProtoNumber(4) @JvmField val bindStatus: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MedalInfo( internal class MedalInfo(
@ProtoId(1) @JvmField val id: Int = 0, @ProtoNumber(1) @JvmField val id: Int = 0,
@ProtoId(2) @JvmField val type: Int = 0, @ProtoNumber(2) @JvmField val type: Int = 0,
@ProtoId(4) @JvmField val seq: Long = 0, @ProtoNumber(4) @JvmField val seq: Long = 0,
@ProtoId(5) @JvmField val name: String = "", @ProtoNumber(5) @JvmField val name: String = "",
@ProtoId(6) @JvmField val newflag: Int = 0, @ProtoNumber(6) @JvmField val newflag: Int = 0,
@ProtoId(7) @JvmField val time: Long = 0L, @ProtoNumber(7) @JvmField val time: Long = 0L,
@ProtoId(8) @JvmField val msgBindFri: BindInfo? = null, @ProtoNumber(8) @JvmField val msgBindFri: BindInfo? = null,
@ProtoId(11) @JvmField val desc: String = "", @ProtoNumber(11) @JvmField val desc: String = "",
@ProtoId(31) @JvmField val level: Int = 0, @ProtoNumber(31) @JvmField val level: Int = 0,
@ProtoId(36) @JvmField val taskinfos: List<MedalTaskInfo>? = null, @ProtoNumber(36) @JvmField val taskinfos: List<MedalTaskInfo>? = null,
@ProtoId(40) @JvmField val point: Int = 0, @ProtoNumber(40) @JvmField val point: Int = 0,
@ProtoId(41) @JvmField val pointLevel2: Int = 0, @ProtoNumber(41) @JvmField val pointLevel2: Int = 0,
@ProtoId(42) @JvmField val pointLevel3: Int = 0, @ProtoNumber(42) @JvmField val pointLevel3: Int = 0,
@ProtoId(43) @JvmField val seqLevel2: Long = 0, @ProtoNumber(43) @JvmField val seqLevel2: Long = 0,
@ProtoId(44) @JvmField val seqLevel3: Long = 0, @ProtoNumber(44) @JvmField val seqLevel3: Long = 0,
@ProtoId(45) @JvmField val timeLevel2: Long = 0L, @ProtoNumber(45) @JvmField val timeLevel2: Long = 0L,
@ProtoId(46) @JvmField val timeLevel3: Long = 0L, @ProtoNumber(46) @JvmField val timeLevel3: Long = 0L,
@ProtoId(47) @JvmField val descLevel2: String = "", @ProtoNumber(47) @JvmField val descLevel2: String = "",
@ProtoId(48) @JvmField val descLevel3: String = "", @ProtoNumber(48) @JvmField val descLevel3: String = "",
@ProtoId(49) @JvmField val endtime: Int = 0, @ProtoNumber(49) @JvmField val endtime: Int = 0,
@ProtoId(50) @JvmField val detailUrl: String = "", @ProtoNumber(50) @JvmField val detailUrl: String = "",
@ProtoId(51) @JvmField val detailUrl2: String = "", @ProtoNumber(51) @JvmField val detailUrl2: String = "",
@ProtoId(52) @JvmField val detailUrl3: String = "", @ProtoNumber(52) @JvmField val detailUrl3: String = "",
@ProtoId(53) @JvmField val taskDesc: String = "", @ProtoNumber(53) @JvmField val taskDesc: String = "",
@ProtoId(54) @JvmField val taskDesc2: String = "", @ProtoNumber(54) @JvmField val taskDesc2: String = "",
@ProtoId(55) @JvmField val taskDesc3: String = "", @ProtoNumber(55) @JvmField val taskDesc3: String = "",
@ProtoId(56) @JvmField val levelCount: Int = 0, @ProtoNumber(56) @JvmField val levelCount: Int = 0,
@ProtoId(57) @JvmField val noProgress: Int = 0, @ProtoNumber(57) @JvmField val noProgress: Int = 0,
@ProtoId(58) @JvmField val resource: String = "", @ProtoNumber(58) @JvmField val resource: String = "",
@ProtoId(59) @JvmField val fromuinLevel: Int = 0, @ProtoNumber(59) @JvmField val fromuinLevel: Int = 0,
@ProtoId(60) @JvmField val unread: Int = 0, @ProtoNumber(60) @JvmField val unread: Int = 0,
@ProtoId(61) @JvmField val unread2: Int = 0, @ProtoNumber(61) @JvmField val unread2: Int = 0,
@ProtoId(62) @JvmField val unread3: Int = 0 @ProtoNumber(62) @JvmField val unread3: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MedalTaskInfo( internal class MedalTaskInfo(
@ProtoId(1) @JvmField val taskid: Int = 0, @ProtoNumber(1) @JvmField val taskid: Int = 0,
@ProtoId(32) @JvmField val int32TaskValue: Int = 0, @ProtoNumber(32) @JvmField val int32TaskValue: Int = 0,
@ProtoId(33) @JvmField val tarValue: Int = 0, @ProtoNumber(33) @JvmField val tarValue: Int = 0,
@ProtoId(34) @JvmField val tarValueLevel2: Int = 0, @ProtoNumber(34) @JvmField val tarValueLevel2: Int = 0,
@ProtoId(35) @JvmField val tarValueLevel3: Int = 0 @ProtoNumber(35) @JvmField val tarValueLevel3: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -66,475 +66,475 @@ internal class Common : ProtoBuf {
internal class AppointDefine : ProtoBuf { internal class AppointDefine : ProtoBuf {
@Serializable @Serializable
internal class ADFeedContent( internal class ADFeedContent(
@ProtoId(1) @JvmField val msgUserInfo: UserInfo? = null, @ProtoNumber(1) @JvmField val msgUserInfo: UserInfo? = null,
@ProtoId(2) @JvmField val strPicUrl: List<String> = listOf(), @ProtoNumber(2) @JvmField val strPicUrl: List<String> = listOf(),
@ProtoId(3) @JvmField val msgText: RichText? = null, @ProtoNumber(3) @JvmField val msgText: RichText? = null,
@ProtoId(4) @JvmField val attendInfo: String = "", @ProtoNumber(4) @JvmField val attendInfo: String = "",
@ProtoId(5) @JvmField val actionUrl: String = "", @ProtoNumber(5) @JvmField val actionUrl: String = "",
@ProtoId(6) @JvmField val publishTime: Int = 0, @ProtoNumber(6) @JvmField val publishTime: Int = 0,
@ProtoId(7) @JvmField val msgHotTopicList: HotTopicList? = null, @ProtoNumber(7) @JvmField val msgHotTopicList: HotTopicList? = null,
@ProtoId(8) @JvmField val moreUrl: String = "", @ProtoNumber(8) @JvmField val moreUrl: String = "",
@ProtoId(9) @JvmField val recordDuration: String = "" @ProtoNumber(9) @JvmField val recordDuration: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RichText( internal class RichText(
@ProtoId(1) @JvmField val msgElems: List<Elem>? = null @ProtoNumber(1) @JvmField val msgElems: List<Elem>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RankEvent( internal class RankEvent(
@ProtoId(1) @JvmField val listtype: Int = 0, @ProtoNumber(1) @JvmField val listtype: Int = 0,
@ProtoId(2) @JvmField val notifytype: Int = 0, @ProtoNumber(2) @JvmField val notifytype: Int = 0,
@ProtoId(3) @JvmField val eventtime: Int = 0, @ProtoNumber(3) @JvmField val eventtime: Int = 0,
@ProtoId(4) @JvmField val seq: Int = 0, @ProtoNumber(4) @JvmField val seq: Int = 0,
@ProtoId(5) @JvmField val notifyTips: String = "" @ProtoNumber(5) @JvmField val notifyTips: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Wifi( internal class Wifi(
@ProtoId(1) @JvmField val mac: Long = 0L, @ProtoNumber(1) @JvmField val mac: Long = 0L,
@ProtoId(2) @JvmField val int32Rssi: Int = 0 @ProtoNumber(2) @JvmField val int32Rssi: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class InterestItem( internal class InterestItem(
@ProtoId(1) @JvmField val tagId: Long = 0L, @ProtoNumber(1) @JvmField val tagId: Long = 0L,
@ProtoId(2) @JvmField val tagName: String = "", @ProtoNumber(2) @JvmField val tagName: String = "",
@ProtoId(3) @JvmField val tagIconUrl: String = "", @ProtoNumber(3) @JvmField val tagIconUrl: String = "",
@ProtoId(4) @JvmField val tagHref: String = "", @ProtoNumber(4) @JvmField val tagHref: String = "",
@ProtoId(5) @JvmField val tagBackColor: String = "", @ProtoNumber(5) @JvmField val tagBackColor: String = "",
@ProtoId(6) @JvmField val tagFontColor: String = "", @ProtoNumber(6) @JvmField val tagFontColor: String = "",
@ProtoId(7) @JvmField val tagVid: String = "", @ProtoNumber(7) @JvmField val tagVid: String = "",
@ProtoId(8) @JvmField val tagType: Int = 0, @ProtoNumber(8) @JvmField val tagType: Int = 0,
@ProtoId(9) @JvmField val addTime: Int = 0, @ProtoNumber(9) @JvmField val addTime: Int = 0,
@ProtoId(10) @JvmField val tagCategory: String = "", @ProtoNumber(10) @JvmField val tagCategory: String = "",
@ProtoId(11) @JvmField val tagOtherUrl: String = "", @ProtoNumber(11) @JvmField val tagOtherUrl: String = "",
@ProtoId(12) @JvmField val bid: Int = 0 @ProtoNumber(12) @JvmField val bid: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShopID( internal class ShopID(
@ProtoId(1) @JvmField val shopid: String = "", @ProtoNumber(1) @JvmField val shopid: String = "",
@ProtoId(2) @JvmField val sp: Int = 0 @ProtoNumber(2) @JvmField val sp: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FeedComment( internal class FeedComment(
@ProtoId(1) @JvmField val commentId: String = "", @ProtoNumber(1) @JvmField val commentId: String = "",
@ProtoId(2) @JvmField val feedId: String = "", @ProtoNumber(2) @JvmField val feedId: String = "",
@ProtoId(3) @JvmField val msgPublisherInfo: StrangerInfo? = null, @ProtoNumber(3) @JvmField val msgPublisherInfo: StrangerInfo? = null,
@ProtoId(4) @JvmField val time: Int = 0, @ProtoNumber(4) @JvmField val time: Int = 0,
@ProtoId(6) @JvmField val msgReplyInfo: ReplyInfo? = null, @ProtoNumber(6) @JvmField val msgReplyInfo: ReplyInfo? = null,
@ProtoId(7) @JvmField val flag: Int = 0, @ProtoNumber(7) @JvmField val flag: Int = 0,
@ProtoId(8) @JvmField val msgContent: RichText? = null, @ProtoNumber(8) @JvmField val msgContent: RichText? = null,
@ProtoId(9) @JvmField val hot: Int = 0 @ProtoNumber(9) @JvmField val hot: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ADFeed( internal class ADFeed(
@ProtoId(1) @JvmField val taskId: Int = 0, @ProtoNumber(1) @JvmField val taskId: Int = 0,
@ProtoId(2) @JvmField val style: Int = 0, @ProtoNumber(2) @JvmField val style: Int = 0,
@ProtoId(3) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Cell( internal class Cell(
@ProtoId(1) @JvmField val int32Mcc: Int = -1, @ProtoNumber(1) @JvmField val int32Mcc: Int = -1,
@ProtoId(2) @JvmField val int32Mnc: Int = -1, @ProtoNumber(2) @JvmField val int32Mnc: Int = -1,
@ProtoId(3) @JvmField val int32Lac: Int = -1, @ProtoNumber(3) @JvmField val int32Lac: Int = -1,
@ProtoId(4) @JvmField val int32Cellid: Int = -1, @ProtoNumber(4) @JvmField val int32Cellid: Int = -1,
@ProtoId(5) @JvmField val int32Rssi: Int = 0 @ProtoNumber(5) @JvmField val int32Rssi: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RecentVistorEvent( internal class RecentVistorEvent(
@ProtoId(1) @JvmField val eventtype: Int = 0, @ProtoNumber(1) @JvmField val eventtype: Int = 0,
@ProtoId(2) @JvmField val eventTinyid: Long = 0L, @ProtoNumber(2) @JvmField val eventTinyid: Long = 0L,
@ProtoId(3) @JvmField val unreadCount: Int = 0 @ProtoNumber(3) @JvmField val unreadCount: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class OrganizerInfo( internal class OrganizerInfo(
@ProtoId(1) @JvmField val hostName: String = "", @ProtoNumber(1) @JvmField val hostName: String = "",
@ProtoId(2) @JvmField val hostUrl: String = "", @ProtoNumber(2) @JvmField val hostUrl: String = "",
@ProtoId(3) @JvmField val hostCover: String = "" @ProtoNumber(3) @JvmField val hostCover: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class InterestTag( internal class InterestTag(
@ProtoId(1) @JvmField val tagType: Int = 0, @ProtoNumber(1) @JvmField val tagType: Int = 0,
@ProtoId(2) @JvmField val msgTagList: List<InterestItem>? = null @ProtoNumber(2) @JvmField val msgTagList: List<InterestItem>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AppointInfoEx( internal class AppointInfoEx(
@ProtoId(1) @JvmField val feedsPicUrl: String = "", @ProtoNumber(1) @JvmField val feedsPicUrl: String = "",
@ProtoId(2) @JvmField val feedsUrl: String = "", @ProtoNumber(2) @JvmField val feedsUrl: String = "",
@ProtoId(3) @JvmField val detailTitle: String = "", @ProtoNumber(3) @JvmField val detailTitle: String = "",
@ProtoId(4) @JvmField val detailDescribe: String = "", @ProtoNumber(4) @JvmField val detailDescribe: String = "",
@ProtoId(5) @JvmField val showPublisher: Int = 0, @ProtoNumber(5) @JvmField val showPublisher: Int = 0,
@ProtoId(6) @JvmField val detailPicUrl: String = "", @ProtoNumber(6) @JvmField val detailPicUrl: String = "",
@ProtoId(7) @JvmField val detailUrl: String = "", @ProtoNumber(7) @JvmField val detailUrl: String = "",
@ProtoId(8) @JvmField val showAttend: Int = 0 @ProtoNumber(8) @JvmField val showAttend: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DateComment( internal class DateComment(
@ProtoId(1) @JvmField val commentId: String = "", @ProtoNumber(1) @JvmField val commentId: String = "",
@ProtoId(2) @JvmField val msgAppointId: AppointID? = null, @ProtoNumber(2) @JvmField val msgAppointId: AppointID? = null,
@ProtoId(3) @JvmField val msgPublisherInfo: StrangerInfo? = null, @ProtoNumber(3) @JvmField val msgPublisherInfo: StrangerInfo? = null,
@ProtoId(4) @JvmField val time: Int = 0, @ProtoNumber(4) @JvmField val time: Int = 0,
@ProtoId(6) @JvmField val msgReplyInfo: ReplyInfo? = null, @ProtoNumber(6) @JvmField val msgReplyInfo: ReplyInfo? = null,
@ProtoId(7) @JvmField val flag: Int = 0, @ProtoNumber(7) @JvmField val flag: Int = 0,
@ProtoId(8) @JvmField val msgContent: RichText? = null @ProtoNumber(8) @JvmField val msgContent: RichText? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AppointContent( internal class AppointContent(
@ProtoId(1) @JvmField val appointSubject: Int = 0, @ProtoNumber(1) @JvmField val appointSubject: Int = 0,
@ProtoId(2) @JvmField val payType: Int = 0, @ProtoNumber(2) @JvmField val payType: Int = 0,
@ProtoId(3) @JvmField val appointDate: Int = 0, @ProtoNumber(3) @JvmField val appointDate: Int = 0,
@ProtoId(4) @JvmField val appointGender: Int = 0, @ProtoNumber(4) @JvmField val appointGender: Int = 0,
@ProtoId(5) @JvmField val appointIntroduce: String = "", @ProtoNumber(5) @JvmField val appointIntroduce: String = "",
@ProtoId(6) @JvmField val msgAppointAddress: AddressInfo? = null, @ProtoNumber(6) @JvmField val msgAppointAddress: AddressInfo? = null,
@ProtoId(7) @JvmField val msgTravelInfo: TravelInfo? = null @ProtoNumber(7) @JvmField val msgTravelInfo: TravelInfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FeedInfo( internal class FeedInfo(
@ProtoId(1) @JvmField val feedType: Long = 0L, @ProtoNumber(1) @JvmField val feedType: Long = 0L,
@ProtoId(2) @JvmField val feedId: String = "", @ProtoNumber(2) @JvmField val feedId: String = "",
@ProtoId(3) @JvmField val msgFeedContent: FeedContent? = null, @ProtoNumber(3) @JvmField val msgFeedContent: FeedContent? = null,
@ProtoId(4) @JvmField val msgTopicInfo: NearbyTopic? = null, @ProtoNumber(4) @JvmField val msgTopicInfo: NearbyTopic? = null,
@ProtoId(5) @JvmField val publishTime: Long = 0, @ProtoNumber(5) @JvmField val publishTime: Long = 0,
@ProtoId(6) @JvmField val praiseCount: Int = 0, @ProtoNumber(6) @JvmField val praiseCount: Int = 0,
@ProtoId(7) @JvmField val praiseFlag: Int = 0, @ProtoNumber(7) @JvmField val praiseFlag: Int = 0,
@ProtoId(8) @JvmField val msgPraiseUser: List<StrangerInfo>? = null, @ProtoNumber(8) @JvmField val msgPraiseUser: List<StrangerInfo>? = null,
@ProtoId(9) @JvmField val commentCount: Int = 0, @ProtoNumber(9) @JvmField val commentCount: Int = 0,
@ProtoId(10) @JvmField val msgCommentList: List<FeedComment>? = null, @ProtoNumber(10) @JvmField val msgCommentList: List<FeedComment>? = null,
@ProtoId(11) @JvmField val commentRetAll: Int = 0, @ProtoNumber(11) @JvmField val commentRetAll: Int = 0,
@ProtoId(12) @JvmField val hotFlag: Int = 0, @ProtoNumber(12) @JvmField val hotFlag: Int = 0,
@ProtoId(13) @JvmField val svrReserved: Long = 0L, @ProtoNumber(13) @JvmField val svrReserved: Long = 0L,
@ProtoId(14) @JvmField val msgHotEntry: HotEntry? = null @ProtoNumber(14) @JvmField val msgHotEntry: HotEntry? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HotTopicList( internal class HotTopicList(
@ProtoId(1) @JvmField val topicList: List<HotTopic>? = null @ProtoNumber(1) @JvmField val topicList: List<HotTopic>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FeedContent( internal class FeedContent(
@ProtoId(1) @JvmField val strPicUrl: List<String> = listOf(), @ProtoNumber(1) @JvmField val strPicUrl: List<String> = listOf(),
@ProtoId(2) @JvmField val msgText: RichText? = null, @ProtoNumber(2) @JvmField val msgText: RichText? = null,
@ProtoId(3) @JvmField val hrefUrl: String = "", @ProtoNumber(3) @JvmField val hrefUrl: String = "",
@ProtoId(5) @JvmField val groupName: String = "", @ProtoNumber(5) @JvmField val groupName: String = "",
@ProtoId(6) @JvmField val groupBulletin: String = "", @ProtoNumber(6) @JvmField val groupBulletin: String = "",
@ProtoId(7) @JvmField val feedType: Int = 0, @ProtoNumber(7) @JvmField val feedType: Int = 0,
@ProtoId(8) @JvmField val poiId: String = "", @ProtoNumber(8) @JvmField val poiId: String = "",
@ProtoId(9) @JvmField val poiTitle: String = "", @ProtoNumber(9) @JvmField val poiTitle: String = "",
@ProtoId(20) @JvmField val effectiveTime: Int = 0, @ProtoNumber(20) @JvmField val effectiveTime: Int = 0,
@ProtoId(21) @JvmField val expiationTime: Int = 0, @ProtoNumber(21) @JvmField val expiationTime: Int = 0,
@ProtoId(22) @JvmField val msgLocale: LocaleInfo? = null, @ProtoNumber(22) @JvmField val msgLocale: LocaleInfo? = null,
@ProtoId(23) @JvmField val feedsIndex: Int = 0, @ProtoNumber(23) @JvmField val feedsIndex: Int = 0,
@ProtoId(24) @JvmField val msgAd: ADFeed? = null, @ProtoNumber(24) @JvmField val msgAd: ADFeed? = null,
@ProtoId(25) @JvmField val privateData: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(25) @JvmField val privateData: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class TravelInfo( internal class TravelInfo(
@ProtoId(1) @JvmField val msgDepartLocale: LocaleInfo? = null, @ProtoNumber(1) @JvmField val msgDepartLocale: LocaleInfo? = null,
@ProtoId(2) @JvmField val msgDestination: LocaleInfo? = null, @ProtoNumber(2) @JvmField val msgDestination: LocaleInfo? = null,
@ProtoId(3) @JvmField val vehicle: Int = 0, @ProtoNumber(3) @JvmField val vehicle: Int = 0,
@ProtoId(4) @JvmField val partnerCount: Int = 0, @ProtoNumber(4) @JvmField val partnerCount: Int = 0,
@ProtoId(5) @JvmField val placePicUrl: String = "", @ProtoNumber(5) @JvmField val placePicUrl: String = "",
@ProtoId(6) @JvmField val placeUrl: String = "" @ProtoNumber(6) @JvmField val placeUrl: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RecentFreshFeed( internal class RecentFreshFeed(
@ProtoId(1) @JvmField val freshFeedInfo: List<FreshFeedInfo>? = null, @ProtoNumber(1) @JvmField val freshFeedInfo: List<FreshFeedInfo>? = null,
@ProtoId(2) @JvmField val uid: Long = 0L @ProtoNumber(2) @JvmField val uid: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GPS( internal class GPS(
@ProtoId(1) @JvmField val int32Lat: Int = 900000000, @ProtoNumber(1) @JvmField val int32Lat: Int = 900000000,
@ProtoId(2) @JvmField val int32Lon: Int = 900000000, @ProtoNumber(2) @JvmField val int32Lon: Int = 900000000,
@ProtoId(3) @JvmField val int32Alt: Int = -10000000, @ProtoNumber(3) @JvmField val int32Alt: Int = -10000000,
@ProtoId(4) @JvmField val int32Type: Int = 0 @ProtoNumber(4) @JvmField val int32Type: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AppointID( internal class AppointID(
@ProtoId(1) @JvmField val requestId: String = "" @ProtoNumber(1) @JvmField val requestId: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LocaleInfo( internal class LocaleInfo(
@ProtoId(1) @JvmField val name: String = "", @ProtoNumber(1) @JvmField val name: String = "",
@ProtoId(2) @JvmField val country: String = "", @ProtoNumber(2) @JvmField val country: String = "",
@ProtoId(3) @JvmField val province: String = "", @ProtoNumber(3) @JvmField val province: String = "",
@ProtoId(4) @JvmField val city: String = "", @ProtoNumber(4) @JvmField val city: String = "",
@ProtoId(5) @JvmField val region: String = "", @ProtoNumber(5) @JvmField val region: String = "",
@ProtoId(6) @JvmField val poi: String = "", @ProtoNumber(6) @JvmField val poi: String = "",
@ProtoId(7) @JvmField val msgGps: GPS? = null, @ProtoNumber(7) @JvmField val msgGps: GPS? = null,
@ProtoId(8) @JvmField val address: String = "" @ProtoNumber(8) @JvmField val address: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LBSInfo( internal class LBSInfo(
@ProtoId(1) @JvmField val msgGps: GPS? = null, @ProtoNumber(1) @JvmField val msgGps: GPS? = null,
@ProtoId(2) @JvmField val msgWifis: List<Wifi>? = null, @ProtoNumber(2) @JvmField val msgWifis: List<Wifi>? = null,
@ProtoId(3) @JvmField val msgCells: List<Cell>? = null @ProtoNumber(3) @JvmField val msgCells: List<Cell>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FeedEvent( internal class FeedEvent(
@ProtoId(1) @JvmField val eventId: Long = 0L, @ProtoNumber(1) @JvmField val eventId: Long = 0L,
@ProtoId(2) @JvmField val time: Int = 0, @ProtoNumber(2) @JvmField val time: Int = 0,
@ProtoId(3) @JvmField val eventtype: Int = 0, @ProtoNumber(3) @JvmField val eventtype: Int = 0,
@ProtoId(4) @JvmField val msgUserInfo: StrangerInfo? = null, @ProtoNumber(4) @JvmField val msgUserInfo: StrangerInfo? = null,
@ProtoId(5) @JvmField val msgFeedInfo: FeedInfo? = null, @ProtoNumber(5) @JvmField val msgFeedInfo: FeedInfo? = null,
@ProtoId(6) @JvmField val eventTips: String = "", @ProtoNumber(6) @JvmField val eventTips: String = "",
@ProtoId(7) @JvmField val msgComment: FeedComment? = null, @ProtoNumber(7) @JvmField val msgComment: FeedComment? = null,
@ProtoId(8) @JvmField val cancelEventId: Long = 0L @ProtoNumber(8) @JvmField val cancelEventId: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FeedsCookie( internal class FeedsCookie(
@ProtoId(1) @JvmField val strList: List<String> = listOf(), @ProtoNumber(1) @JvmField val strList: List<String> = listOf(),
@ProtoId(2) @JvmField val pose: Int = 0, @ProtoNumber(2) @JvmField val pose: Int = 0,
@ProtoId(3) @JvmField val cookie: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val cookie: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val uint64Topics: List<Long>? = null @ProtoNumber(4) @JvmField val uint64Topics: List<Long>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NearbyTopic( internal class NearbyTopic(
@ProtoId(1) @JvmField val topicId: Long = 0L, @ProtoNumber(1) @JvmField val topicId: Long = 0L,
@ProtoId(2) @JvmField val topic: String = "", @ProtoNumber(2) @JvmField val topic: String = "",
@ProtoId(3) @JvmField val foreword: String = "", @ProtoNumber(3) @JvmField val foreword: String = "",
@ProtoId(4) @JvmField val createTime: Int = 0, @ProtoNumber(4) @JvmField val createTime: Int = 0,
@ProtoId(5) @JvmField val updateTime: Int = 0, @ProtoNumber(5) @JvmField val updateTime: Int = 0,
@ProtoId(6) @JvmField val hotFlag: Int = 0, @ProtoNumber(6) @JvmField val hotFlag: Int = 0,
@ProtoId(7) @JvmField val buttonStyle: Int = 0, @ProtoNumber(7) @JvmField val buttonStyle: Int = 0,
@ProtoId(8) @JvmField val buttonSrc: String = "", @ProtoNumber(8) @JvmField val buttonSrc: String = "",
@ProtoId(9) @JvmField val backgroundSrc: String = "", @ProtoNumber(9) @JvmField val backgroundSrc: String = "",
@ProtoId(10) @JvmField val attendeeInfo: String = "", @ProtoNumber(10) @JvmField val attendeeInfo: String = "",
@ProtoId(11) @JvmField val index: Int = 0, @ProtoNumber(11) @JvmField val index: Int = 0,
@ProtoId(12) @JvmField val publishScope: Int = 0, @ProtoNumber(12) @JvmField val publishScope: Int = 0,
@ProtoId(13) @JvmField val effectiveTime: Int = 0, @ProtoNumber(13) @JvmField val effectiveTime: Int = 0,
@ProtoId(14) @JvmField val expiationTime: Int = 0, @ProtoNumber(14) @JvmField val expiationTime: Int = 0,
@ProtoId(15) @JvmField val pushedUsrCount: Int = 0, @ProtoNumber(15) @JvmField val pushedUsrCount: Int = 0,
@ProtoId(16) @JvmField val timerangeLeft: Int = 0, @ProtoNumber(16) @JvmField val timerangeLeft: Int = 0,
@ProtoId(17) @JvmField val timerangeRight: Int = 0, @ProtoNumber(17) @JvmField val timerangeRight: Int = 0,
@ProtoId(18) @JvmField val area: String = "" @ProtoNumber(18) @JvmField val area: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NearbyEvent( internal class NearbyEvent(
@ProtoId(1) @JvmField val eventtype: Int = 0, @ProtoNumber(1) @JvmField val eventtype: Int = 0,
@ProtoId(2) @JvmField val msgRankevent: RankEvent? = null, @ProtoNumber(2) @JvmField val msgRankevent: RankEvent? = null,
@ProtoId(3) @JvmField val eventUin: Long = 0L, @ProtoNumber(3) @JvmField val eventUin: Long = 0L,
@ProtoId(4) @JvmField val eventTinyid: Long = 0L @ProtoNumber(4) @JvmField val eventTinyid: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Feed( internal class Feed(
@ProtoId(1) @JvmField val msgUserInfo: PublisherInfo? = null, @ProtoNumber(1) @JvmField val msgUserInfo: PublisherInfo? = null,
@ProtoId(2) @JvmField val msgFeedInfo: FeedInfo? = null, @ProtoNumber(2) @JvmField val msgFeedInfo: FeedInfo? = null,
@ProtoId(3) @JvmField val ownerFlag: Int = 0 @ProtoNumber(3) @JvmField val ownerFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ActivityInfo( internal class ActivityInfo(
@ProtoId(2) @JvmField val name: String = "", @ProtoNumber(2) @JvmField val name: String = "",
@ProtoId(3) @JvmField val cover: String = "", @ProtoNumber(3) @JvmField val cover: String = "",
@ProtoId(4) @JvmField val url: String = "", @ProtoNumber(4) @JvmField val url: String = "",
@ProtoId(5) @JvmField val startTime: Int = 0, @ProtoNumber(5) @JvmField val startTime: Int = 0,
@ProtoId(6) @JvmField val endTime: Int = 0, @ProtoNumber(6) @JvmField val endTime: Int = 0,
@ProtoId(7) @JvmField val locName: String = "", @ProtoNumber(7) @JvmField val locName: String = "",
@ProtoId(8) @JvmField val enroll: Long = 0L, @ProtoNumber(8) @JvmField val enroll: Long = 0L,
@ProtoId(9) @JvmField val createUin: Long = 0L, @ProtoNumber(9) @JvmField val createUin: Long = 0L,
@ProtoId(10) @JvmField val createTime: Int = 0, @ProtoNumber(10) @JvmField val createTime: Int = 0,
@ProtoId(11) @JvmField val organizerInfo: OrganizerInfo = OrganizerInfo(), @ProtoNumber(11) @JvmField val organizerInfo: OrganizerInfo = OrganizerInfo(),
@ProtoId(12) @JvmField val flag: Long? = null @ProtoNumber(12) @JvmField val flag: Long? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HotEntry( internal class HotEntry(
@ProtoId(1) @JvmField val openFlag: Int = 0, @ProtoNumber(1) @JvmField val openFlag: Int = 0,
@ProtoId(2) @JvmField val restTime: Int = 0, @ProtoNumber(2) @JvmField val restTime: Int = 0,
@ProtoId(3) @JvmField val foreword: String = "", @ProtoNumber(3) @JvmField val foreword: String = "",
@ProtoId(4) @JvmField val backgroundSrc: String = "" @ProtoNumber(4) @JvmField val backgroundSrc: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class UserFeed( internal class UserFeed(
@ProtoId(1) @JvmField val msgUserInfo: PublisherInfo? = null, @ProtoNumber(1) @JvmField val msgUserInfo: PublisherInfo? = null,
@ProtoId(2) @JvmField val msgFeedInfo: FeedInfo? = null, @ProtoNumber(2) @JvmField val msgFeedInfo: FeedInfo? = null,
@ProtoId(3) @JvmField val ownerFlag: Int = 0, @ProtoNumber(3) @JvmField val ownerFlag: Int = 0,
@ProtoId(4) @JvmField val msgActivityInfo: ActivityInfo? = null @ProtoNumber(4) @JvmField val msgActivityInfo: ActivityInfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Elem( internal class Elem(
@ProtoId(1) @JvmField val content: String = "", @ProtoNumber(1) @JvmField val content: String = "",
@ProtoId(2) @JvmField val msgFaceInfo: Face? = null @ProtoNumber(2) @JvmField val msgFaceInfo: Face? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HotFreshFeedList( internal class HotFreshFeedList(
@ProtoId(1) @JvmField val msgFeeds: List<HotUserFeed>? = null, @ProtoNumber(1) @JvmField val msgFeeds: List<HotUserFeed>? = null,
@ProtoId(2) @JvmField val updateTime: Int = 0 @ProtoNumber(2) @JvmField val updateTime: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RptInterestTag( internal class RptInterestTag(
@ProtoId(1) @JvmField val interestTags: List<InterestTag>? = null @ProtoNumber(1) @JvmField val interestTags: List<InterestTag>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AddressInfo( internal class AddressInfo(
@ProtoId(1) @JvmField val companyZone: String = "", @ProtoNumber(1) @JvmField val companyZone: String = "",
@ProtoId(2) @JvmField val companyName: String = "", @ProtoNumber(2) @JvmField val companyName: String = "",
@ProtoId(3) @JvmField val companyAddr: String = "", @ProtoNumber(3) @JvmField val companyAddr: String = "",
@ProtoId(4) @JvmField val companyPicUrl: String = "", @ProtoNumber(4) @JvmField val companyPicUrl: String = "",
@ProtoId(5) @JvmField val companyUrl: String = "", @ProtoNumber(5) @JvmField val companyUrl: String = "",
@ProtoId(6) @JvmField val msgCompanyId: ShopID? = null @ProtoNumber(6) @JvmField val msgCompanyId: ShopID? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PublisherInfo( internal class PublisherInfo(
@ProtoId(1) @JvmField val tinyid: Long = 0L, @ProtoNumber(1) @JvmField val tinyid: Long = 0L,
@ProtoId(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val age: Int = 0, @ProtoNumber(3) @JvmField val age: Int = 0,
@ProtoId(4) @JvmField val gender: Int = 0, @ProtoNumber(4) @JvmField val gender: Int = 0,
@ProtoId(5) @JvmField val constellation: String = "", @ProtoNumber(5) @JvmField val constellation: String = "",
@ProtoId(6) @JvmField val profession: Int = 0, @ProtoNumber(6) @JvmField val profession: Int = 0,
@ProtoId(7) @JvmField val distance: String = "", @ProtoNumber(7) @JvmField val distance: String = "",
@ProtoId(8) @JvmField val marriage: Int = 0, @ProtoNumber(8) @JvmField val marriage: Int = 0,
@ProtoId(9) @JvmField val vipinfo: String = "", @ProtoNumber(9) @JvmField val vipinfo: String = "",
@ProtoId(10) @JvmField val recommend: Int = 0, @ProtoNumber(10) @JvmField val recommend: Int = 0,
@ProtoId(11) @JvmField val godflag: Int = 0, @ProtoNumber(11) @JvmField val godflag: Int = 0,
@ProtoId(12) @JvmField val chatflag: Int = 0, @ProtoNumber(12) @JvmField val chatflag: Int = 0,
@ProtoId(13) @JvmField val chatupCount: Int = 0, @ProtoNumber(13) @JvmField val chatupCount: Int = 0,
@ProtoId(14) @JvmField val charm: Int = 0, @ProtoNumber(14) @JvmField val charm: Int = 0,
@ProtoId(15) @JvmField val charmLevel: Int = 0, @ProtoNumber(15) @JvmField val charmLevel: Int = 0,
@ProtoId(16) @JvmField val pubNumber: Int = 0, @ProtoNumber(16) @JvmField val pubNumber: Int = 0,
@ProtoId(17) @JvmField val msgCommonLabel: CommonLabel? = null, @ProtoNumber(17) @JvmField val msgCommonLabel: CommonLabel? = null,
@ProtoId(18) @JvmField val recentVistorTime: Int = 0, @ProtoNumber(18) @JvmField val recentVistorTime: Int = 0,
@ProtoId(19) @JvmField val strangerDeclare: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(19) @JvmField val strangerDeclare: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(20) @JvmField val friendUin: Long = 0L, @ProtoNumber(20) @JvmField val friendUin: Long = 0L,
@ProtoId(21) @JvmField val historyFlag: Int = 0, @ProtoNumber(21) @JvmField val historyFlag: Int = 0,
@ProtoId(22) @JvmField val followflag: Long = 0L @ProtoNumber(22) @JvmField val followflag: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HotUserFeed( internal class HotUserFeed(
@ProtoId(1) @JvmField val feedId: String = "", @ProtoNumber(1) @JvmField val feedId: String = "",
@ProtoId(2) @JvmField val praiseCount: Int = 0, @ProtoNumber(2) @JvmField val praiseCount: Int = 0,
@ProtoId(3) @JvmField val publishUid: Long = 0L, @ProtoNumber(3) @JvmField val publishUid: Long = 0L,
@ProtoId(4) @JvmField val publishTime: Int = 0 @ProtoNumber(4) @JvmField val publishTime: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FreshFeedInfo( internal class FreshFeedInfo(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val time: Int = 0, @ProtoNumber(2) @JvmField val time: Int = 0,
@ProtoId(3) @JvmField val feedId: String = "", @ProtoNumber(3) @JvmField val feedId: String = "",
@ProtoId(4) @JvmField val feedType: Long = 0L @ProtoNumber(4) @JvmField val feedType: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class CommonLabel( internal class CommonLabel(
@ProtoId(1) @JvmField val lableId: Int = 0, @ProtoNumber(1) @JvmField val lableId: Int = 0,
@ProtoId(2) @JvmField val lableMsgPre: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val lableMsgPre: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val lableMsgLast: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val lableMsgLast: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val interstName: List<ByteArray>? = null, @ProtoNumber(4) @JvmField val interstName: List<ByteArray>? = null,
@ProtoId(5) @JvmField val interstType: List<Int>? = null @ProtoNumber(5) @JvmField val interstType: List<Int>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Face( internal class Face(
@ProtoId(1) @JvmField val index: Int = 0 @ProtoNumber(1) @JvmField val index: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class StrangerInfo( internal class StrangerInfo(
@ProtoId(1) @JvmField val tinyid: Long = 0L, @ProtoNumber(1) @JvmField val tinyid: Long = 0L,
@ProtoId(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val age: Int = 0, @ProtoNumber(3) @JvmField val age: Int = 0,
@ProtoId(4) @JvmField val gender: Int = 0, @ProtoNumber(4) @JvmField val gender: Int = 0,
@ProtoId(5) @JvmField val dating: Int = 0, @ProtoNumber(5) @JvmField val dating: Int = 0,
@ProtoId(6) @JvmField val listIdx: Int = 0, @ProtoNumber(6) @JvmField val listIdx: Int = 0,
@ProtoId(7) @JvmField val constellation: String = "", @ProtoNumber(7) @JvmField val constellation: String = "",
@ProtoId(8) @JvmField val profession: Int = 0, @ProtoNumber(8) @JvmField val profession: Int = 0,
@ProtoId(9) @JvmField val marriage: Int = 0, @ProtoNumber(9) @JvmField val marriage: Int = 0,
@ProtoId(10) @JvmField val vipinfo: String = "", @ProtoNumber(10) @JvmField val vipinfo: String = "",
@ProtoId(11) @JvmField val recommend: Int = 0, @ProtoNumber(11) @JvmField val recommend: Int = 0,
@ProtoId(12) @JvmField val godflag: Int = 0, @ProtoNumber(12) @JvmField val godflag: Int = 0,
@ProtoId(13) @JvmField val charm: Int = 0, @ProtoNumber(13) @JvmField val charm: Int = 0,
@ProtoId(14) @JvmField val charmLevel: Int = 0, @ProtoNumber(14) @JvmField val charmLevel: Int = 0,
@ProtoId(15) @JvmField val uin: Long = 0L @ProtoNumber(15) @JvmField val uin: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HotTopic( internal class HotTopic(
@ProtoId(1) @JvmField val id: Long = 0L, @ProtoNumber(1) @JvmField val id: Long = 0L,
@ProtoId(2) @JvmField val title: String = "", @ProtoNumber(2) @JvmField val title: String = "",
@ProtoId(3) @JvmField val topicType: Long = 0L, @ProtoNumber(3) @JvmField val topicType: Long = 0L,
@ProtoId(4) @JvmField val total: Long = 0L, @ProtoNumber(4) @JvmField val total: Long = 0L,
@ProtoId(5) @JvmField val times: Long = 0L, @ProtoNumber(5) @JvmField val times: Long = 0L,
@ProtoId(6) @JvmField val historyTimes: Long = 0L, @ProtoNumber(6) @JvmField val historyTimes: Long = 0L,
@ProtoId(7) @JvmField val bgUrl: String = "", @ProtoNumber(7) @JvmField val bgUrl: String = "",
@ProtoId(8) @JvmField val url: String = "", @ProtoNumber(8) @JvmField val url: String = "",
@ProtoId(9) @JvmField val extraInfo: String = "" @ProtoNumber(9) @JvmField val extraInfo: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DateEvent( internal class DateEvent(
@ProtoId(1) @JvmField val eventId: Long = 0L, @ProtoNumber(1) @JvmField val eventId: Long = 0L,
@ProtoId(2) @JvmField val time: Int = 0, @ProtoNumber(2) @JvmField val time: Int = 0,
@ProtoId(3) @JvmField val type: Int = 0, @ProtoNumber(3) @JvmField val type: Int = 0,
@ProtoId(4) @JvmField val msgUserInfo: StrangerInfo? = null, @ProtoNumber(4) @JvmField val msgUserInfo: StrangerInfo? = null,
@ProtoId(5) @JvmField val msgDateInfo: AppointInfo? = null, @ProtoNumber(5) @JvmField val msgDateInfo: AppointInfo? = null,
@ProtoId(6) @JvmField val attendIdx: Int = 0, @ProtoNumber(6) @JvmField val attendIdx: Int = 0,
@ProtoId(7) @JvmField val eventTips: String = "", @ProtoNumber(7) @JvmField val eventTips: String = "",
@ProtoId(8) @JvmField val msgComment: DateComment? = null, @ProtoNumber(8) @JvmField val msgComment: DateComment? = null,
@ProtoId(9) @JvmField val cancelEventId: Long = 0L @ProtoNumber(9) @JvmField val cancelEventId: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class AppointInfo( internal class AppointInfo(
@ProtoId(1) @JvmField val msgAppointId: AppointID? = null, @ProtoNumber(1) @JvmField val msgAppointId: AppointID? = null,
@ProtoId(2) @JvmField val msgAppointment: AppointContent? = null, @ProtoNumber(2) @JvmField val msgAppointment: AppointContent? = null,
@ProtoId(3) @JvmField val appointStatus: Int = 0, @ProtoNumber(3) @JvmField val appointStatus: Int = 0,
@ProtoId(4) @JvmField val joinWording: String = "", @ProtoNumber(4) @JvmField val joinWording: String = "",
@ProtoId(5) @JvmField val viewWording: String = "", @ProtoNumber(5) @JvmField val viewWording: String = "",
@ProtoId(6) @JvmField val unreadCount: Int = 0, @ProtoNumber(6) @JvmField val unreadCount: Int = 0,
@ProtoId(7) @JvmField val owner: Int = 0, @ProtoNumber(7) @JvmField val owner: Int = 0,
@ProtoId(8) @JvmField val join: Int = 0, @ProtoNumber(8) @JvmField val join: Int = 0,
@ProtoId(9) @JvmField val view: Int = 0, @ProtoNumber(9) @JvmField val view: Int = 0,
@ProtoId(10) @JvmField val commentWording: String = "", @ProtoNumber(10) @JvmField val commentWording: String = "",
@ProtoId(11) @JvmField val commentNum: Int = 0, @ProtoNumber(11) @JvmField val commentNum: Int = 0,
@ProtoId(12) @JvmField val attendStatus: Int = 0, @ProtoNumber(12) @JvmField val attendStatus: Int = 0,
@ProtoId(13) @JvmField val msgAppointmentEx: AppointInfoEx? = null @ProtoNumber(13) @JvmField val msgAppointmentEx: AppointInfoEx? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class UserInfo( internal class UserInfo(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val nickname: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val age: Int = 0, @ProtoNumber(3) @JvmField val age: Int = 0,
@ProtoId(4) @JvmField val gender: Int = 0, @ProtoNumber(4) @JvmField val gender: Int = 0,
@ProtoId(5) @JvmField val avatar: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val avatar: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReplyInfo( internal class ReplyInfo(
@ProtoId(1) @JvmField val commentId: String = "", @ProtoNumber(1) @JvmField val commentId: String = "",
@ProtoId(2) @JvmField val msgStrangerInfo: StrangerInfo? = null @ProtoNumber(2) @JvmField val msgStrangerInfo: StrangerInfo? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -3,7 +3,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -12,40 +12,40 @@ import kotlin.jvm.JvmField
internal class Vec0xd50 : ProtoBuf { internal class Vec0xd50 : ProtoBuf {
@Serializable @Serializable
internal class ExtSnsFrdData( internal class ExtSnsFrdData(
@ProtoId(1) @JvmField val frdUin: Long = 0L, @ProtoNumber(1) @JvmField val frdUin: Long = 0L,
@ProtoId(91001) @JvmField val musicSwitch: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(91001) @JvmField val musicSwitch: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(101001) @JvmField val mutualmarkAlienation: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(101001) @JvmField val mutualmarkAlienation: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(141001) @JvmField val mutualmarkScore: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(141001) @JvmField val mutualmarkScore: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(151001) @JvmField val ksingSwitch: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(151001) @JvmField val ksingSwitch: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(181001) @JvmField val lbsShare: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(181001) @JvmField val lbsShare: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val msgUpdateData: List<ExtSnsFrdData>? = null, @ProtoNumber(1) @JvmField val msgUpdateData: List<ExtSnsFrdData>? = null,
@ProtoId(11) @JvmField val over: Int = 0, @ProtoNumber(11) @JvmField val over: Int = 0,
@ProtoId(12) @JvmField val nextStart: Int = 0, @ProtoNumber(12) @JvmField val nextStart: Int = 0,
@ProtoId(13) @JvmField val uint64UnfinishedUins: List<Long>? = null @ProtoNumber(13) @JvmField val uint64UnfinishedUins: List<Long>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val appid: Long = 0L, @ProtoNumber(1) @JvmField val appid: Long = 0L,
@ProtoId(2) @JvmField val maxPkgSize: Int = 0, @ProtoNumber(2) @JvmField val maxPkgSize: Int = 0,
@ProtoId(3) @JvmField val startTime: Int = 0, @ProtoNumber(3) @JvmField val startTime: Int = 0,
@ProtoId(4) @JvmField val startIndex: Int = 0, @ProtoNumber(4) @JvmField val startIndex: Int = 0,
@ProtoId(5) @JvmField val reqNum: Int = 0, @ProtoNumber(5) @JvmField val reqNum: Int = 0,
@ProtoId(6) @JvmField val uinList: List<Long>? = null, @ProtoNumber(6) @JvmField val uinList: List<Long>? = null,
@ProtoId(91001) @JvmField val reqMusicSwitch: Int = 0, @ProtoNumber(91001) @JvmField val reqMusicSwitch: Int = 0,
@ProtoId(101001) @JvmField val reqMutualmarkAlienation: Int = 0, @ProtoNumber(101001) @JvmField val reqMutualmarkAlienation: Int = 0,
@ProtoId(141001) @JvmField val reqMutualmarkScore: Int = 0, @ProtoNumber(141001) @JvmField val reqMutualmarkScore: Int = 0,
@ProtoId(151001) @JvmField val reqKsingSwitch: Int = 0, @ProtoNumber(151001) @JvmField val reqKsingSwitch: Int = 0,
@ProtoId(181001) @JvmField val reqMutualmarkLbsshare: Int = 0 @ProtoNumber(181001) @JvmField val reqMutualmarkLbsshare: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class KSingRelationInfo( internal class KSingRelationInfo(
@ProtoId(1) @JvmField val flag: Int = 0 @ProtoNumber(1) @JvmField val flag: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -53,21 +53,21 @@ internal class Vec0xd50 : ProtoBuf {
internal class Vec0xd6b : ProtoBuf { internal class Vec0xd6b : ProtoBuf {
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val maxPkgSize: Int = 0, @ProtoNumber(1) @JvmField val maxPkgSize: Int = 0,
@ProtoId(2) @JvmField val startTime: Int = 0, @ProtoNumber(2) @JvmField val startTime: Int = 0,
@ProtoId(11) @JvmField val uinList: List<Long>? = null @ProtoNumber(11) @JvmField val uinList: List<Long>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(11) @JvmField val msgMutualmarkData: List<MutualMarkData>? = null, @ProtoNumber(11) @JvmField val msgMutualmarkData: List<MutualMarkData>? = null,
@ProtoId(12) @JvmField val uint64UnfinishedUins: List<Long>? = null @ProtoNumber(12) @JvmField val uint64UnfinishedUins: List<Long>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MutualMarkData( internal class MutualMarkData(
@ProtoId(1) @JvmField val frdUin: Long = 0L, @ProtoNumber(1) @JvmField val frdUin: Long = 0L,
@ProtoId(2) @JvmField val result: Int = 0 @ProtoNumber(2) @JvmField val result: Int = 0
// @SerialId(11) @JvmField val mutualmarkInfo: List<net.mamoe.mirai.qqandroid.network.protocol.data.proto.Mutualmark.MutualMark>? = null // @SerialId(11) @JvmField val mutualmarkInfo: List<net.mamoe.mirai.qqandroid.network.protocol.data.proto.Mutualmark.MutualMark>? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -10,51 +10,51 @@ import kotlin.jvm.JvmField
internal class GroupLabel : ProtoBuf { internal class GroupLabel : ProtoBuf {
@Serializable @Serializable
internal class Label( internal class Label(
@ProtoId(1) @JvmField val name: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val name: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val enumType: Int /* enum */ = 1, @ProtoNumber(2) @JvmField val enumType: Int /* enum */ = 1,
@ProtoId(3) @JvmField val textColor: Color? = null, @ProtoNumber(3) @JvmField val textColor: Color? = null,
@ProtoId(4) @JvmField val edgingColor: Color? = null, @ProtoNumber(4) @JvmField val edgingColor: Color? = null,
@ProtoId(5) @JvmField val labelAttr: Int = 0, @ProtoNumber(5) @JvmField val labelAttr: Int = 0,
@ProtoId(6) @JvmField val labelType: Int = 0 @ProtoNumber(6) @JvmField val labelType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val error: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val error: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val groupInfo: List<GroupInfo>? = null @ProtoNumber(2) @JvmField val groupInfo: List<GroupInfo>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SourceId( internal class SourceId(
@ProtoId(1) @JvmField val sourceId: Int = 0 @ProtoNumber(1) @JvmField val sourceId: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupInfo( internal class GroupInfo(
@ProtoId(1) @JvmField val int32Result: Int = 0, @ProtoNumber(1) @JvmField val int32Result: Int = 0,
@ProtoId(2) @JvmField val groupCode: Long = 0L, @ProtoNumber(2) @JvmField val groupCode: Long = 0L,
@ProtoId(3) @JvmField val groupLabel: List<Label>? = null @ProtoNumber(3) @JvmField val groupLabel: List<Label>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Color( internal class Color(
@ProtoId(1) @JvmField val r: Int = 0, @ProtoNumber(1) @JvmField val r: Int = 0,
@ProtoId(2) @JvmField val g: Int = 0, @ProtoNumber(2) @JvmField val g: Int = 0,
@ProtoId(3) @JvmField val b: Int = 0 @ProtoNumber(3) @JvmField val b: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val sourceId: SourceId? = null, @ProtoNumber(1) @JvmField val sourceId: SourceId? = null,
@ProtoId(2) @JvmField val uinInfo: UinInfo? = null, @ProtoNumber(2) @JvmField val uinInfo: UinInfo? = null,
@ProtoId(3) @JvmField val numberLabel: Int = 5, @ProtoNumber(3) @JvmField val numberLabel: Int = 5,
@ProtoId(4) @JvmField val groupCode: List<Long>? = null, @ProtoNumber(4) @JvmField val groupCode: List<Long>? = null,
@ProtoId(5) @JvmField val labelStyle: Int = 0 @ProtoNumber(5) @JvmField val labelStyle: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class UinInfo( internal class UinInfo(
@ProtoId(1) @JvmField val int64Longitude: Long = 0L, @ProtoNumber(1) @JvmField val int64Longitude: Long = 0L,
@ProtoId(2) @JvmField val int64Latitude: Long = 0L @ProtoNumber(2) @JvmField val int64Latitude: Long = 0L
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,8 +1,8 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoIntegerType
import kotlinx.serialization.protobuf.ProtoNumberType import kotlinx.serialization.protobuf.ProtoNumber
import kotlinx.serialization.protobuf.ProtoType import kotlinx.serialization.protobuf.ProtoType
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
@@ -12,90 +12,90 @@ import kotlin.jvm.JvmField
internal class BdhExtinfo : ProtoBuf { internal class BdhExtinfo : ProtoBuf {
@Serializable @Serializable
internal class CommFileExtReq( internal class CommFileExtReq(
@ProtoId(1) @JvmField val actionType: Int = 0, @ProtoNumber(1) @JvmField val actionType: Int = 0,
@ProtoId(2) @JvmField val uuid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val uuid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class CommFileExtRsp( internal class CommFileExtRsp(
@ProtoId(1) @JvmField val int32Retcode: Int = 0, @ProtoNumber(1) @JvmField val int32Retcode: Int = 0,
@ProtoId(2) @JvmField val downloadUrl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val downloadUrl: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PicInfo( internal class PicInfo(
@ProtoId(1) @JvmField val idx: Int = 0, @ProtoNumber(1) @JvmField val idx: Int = 0,
@ProtoId(2) @JvmField val size: Int = 0, @ProtoNumber(2) @JvmField val size: Int = 0,
@ProtoId(3) @JvmField val binMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val binMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val type: Int = 0 @ProtoNumber(4) @JvmField val type: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class QQVoiceExtReq( internal class QQVoiceExtReq(
@ProtoId(1) @JvmField val qid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val qid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val fmt: Int = 0, @ProtoNumber(2) @JvmField val fmt: Int = 0,
@ProtoId(3) @JvmField val rate: Int = 0, @ProtoNumber(3) @JvmField val rate: Int = 0,
@ProtoId(4) @JvmField val bits: Int = 0, @ProtoNumber(4) @JvmField val bits: Int = 0,
@ProtoId(5) @JvmField val channel: Int = 0, @ProtoNumber(5) @JvmField val channel: Int = 0,
@ProtoId(6) @JvmField val pinyin: Int = 0 @ProtoNumber(6) @JvmField val pinyin: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class QQVoiceExtRsp( internal class QQVoiceExtRsp(
@ProtoId(1) @JvmField val qid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val qid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val int32Retcode: Int = 0, @ProtoNumber(2) @JvmField val int32Retcode: Int = 0,
@ProtoId(3) @JvmField val msgResult: List<QQVoiceResult>? = null @ProtoNumber(3) @JvmField val msgResult: List<QQVoiceResult>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class QQVoiceResult( internal class QQVoiceResult(
@ProtoId(1) @JvmField val text: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val text: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val pinyin: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val pinyin: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val source: Int = 0 @ProtoNumber(3) @JvmField val source: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShortVideoReqExtInfo( internal class ShortVideoReqExtInfo(
@ProtoId(1) @JvmField val cmd: Int = 0, @ProtoNumber(1) @JvmField val cmd: Int = 0,
@ProtoId(2) @JvmField val sessionId: Long = 0L, @ProtoNumber(2) @JvmField val sessionId: Long = 0L,
@ProtoId(3) @JvmField val msgThumbinfo: PicInfo? = null, @ProtoNumber(3) @JvmField val msgThumbinfo: PicInfo? = null,
@ProtoId(4) @JvmField val msgVideoinfo: VideoInfo? = null, @ProtoNumber(4) @JvmField val msgVideoinfo: VideoInfo? = null,
@ProtoId(5) @JvmField val msgShortvideoSureReq: ShortVideoSureReqInfo? = null, @ProtoNumber(5) @JvmField val msgShortvideoSureReq: ShortVideoSureReqInfo? = null,
@ProtoId(6) @JvmField val boolIsMergeCmdBeforeData: Boolean = false @ProtoNumber(6) @JvmField val boolIsMergeCmdBeforeData: Boolean = false
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShortVideoRspExtInfo( internal class ShortVideoRspExtInfo(
@ProtoId(1) @JvmField val cmd: Int = 0, @ProtoNumber(1) @JvmField val cmd: Int = 0,
@ProtoId(2) @JvmField val sessionId: Long = 0L, @ProtoNumber(2) @JvmField val sessionId: Long = 0L,
@ProtoId(3) @JvmField val int32Retcode: Int = 0, @ProtoNumber(3) @JvmField val int32Retcode: Int = 0,
@ProtoId(4) @JvmField val errinfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val errinfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val msgThumbinfo: PicInfo? = null, @ProtoNumber(5) @JvmField val msgThumbinfo: PicInfo? = null,
@ProtoId(6) @JvmField val msgVideoinfo: VideoInfo? = null, @ProtoNumber(6) @JvmField val msgVideoinfo: VideoInfo? = null,
@ProtoId(7) @JvmField val msgShortvideoSureRsp: ShortVideoSureRspInfo? = null, @ProtoNumber(7) @JvmField val msgShortvideoSureRsp: ShortVideoSureRspInfo? = null,
@ProtoId(8) @JvmField val retryFlag: Int = 0 @ProtoNumber(8) @JvmField val retryFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShortVideoSureReqInfo( internal class ShortVideoSureReqInfo(
@ProtoId(1) @JvmField val fromuin: Long = 0L, @ProtoNumber(1) @JvmField val fromuin: Long = 0L,
@ProtoId(2) @JvmField val chatType: Int = 0, @ProtoNumber(2) @JvmField val chatType: Int = 0,
@ProtoId(3) @JvmField val touin: Long = 0L, @ProtoNumber(3) @JvmField val touin: Long = 0L,
@ProtoId(4) @JvmField val groupCode: Long = 0L, @ProtoNumber(4) @JvmField val groupCode: Long = 0L,
@ProtoId(5) @JvmField val clientType: Int = 0, @ProtoNumber(5) @JvmField val clientType: Int = 0,
@ProtoId(6) @JvmField val msgThumbinfo: PicInfo? = null, @ProtoNumber(6) @JvmField val msgThumbinfo: PicInfo? = null,
@ProtoId(7) @JvmField val msgMergeVideoinfo: List<VideoInfo>? = null, @ProtoNumber(7) @JvmField val msgMergeVideoinfo: List<VideoInfo>? = null,
@ProtoId(8) @JvmField val msgDropVideoinfo: List<VideoInfo>? = null, @ProtoNumber(8) @JvmField val msgDropVideoinfo: List<VideoInfo>? = null,
@ProtoId(9) @JvmField val businessType: Int = 0, @ProtoNumber(9) @JvmField val businessType: Int = 0,
@ProtoId(10) @JvmField val subBusinessType: Int = 0 @ProtoNumber(10) @JvmField val subBusinessType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShortVideoSureRspInfo( internal class ShortVideoSureRspInfo(
@ProtoId(1) @JvmField val fileid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val ukey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val ukey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val msgVideoinfo: VideoInfo? = null, @ProtoNumber(3) @JvmField val msgVideoinfo: VideoInfo? = null,
@ProtoId(4) @JvmField val mergeCost: Int = 0 @ProtoNumber(4) @JvmField val mergeCost: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
@@ -103,31 +103,31 @@ internal class BdhExtinfo : ProtoBuf {
@Serializable @Serializable
internal class StoryVideoExtRsp( internal class StoryVideoExtRsp(
@ProtoId(1) @JvmField val int32Retcode: Int = 0, @ProtoNumber(1) @JvmField val int32Retcode: Int = 0,
@ProtoId(2) @JvmField val msg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val msg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val cdnUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val cdnUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val fileKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val fileId: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val fileId: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class UploadPicExtInfo( internal class UploadPicExtInfo(
@ProtoId(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val fileResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val downloadUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val downloadUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val thumbDownloadUrl: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val thumbDownloadUrl: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class VideoInfo( internal class VideoInfo(
@ProtoId(1) @JvmField val idx: Int = 0, @ProtoNumber(1) @JvmField val idx: Int = 0,
@ProtoId(2) @JvmField val size: Int = 0, @ProtoNumber(2) @JvmField val size: Int = 0,
@ProtoId(3) @JvmField val binMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val binMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val format: Int = 0, @ProtoNumber(4) @JvmField val format: Int = 0,
@ProtoId(5) @JvmField val resLen: Int = 0, @ProtoNumber(5) @JvmField val resLen: Int = 0,
@ProtoId(6) @JvmField val resWidth: Int = 0, @ProtoNumber(6) @JvmField val resWidth: Int = 0,
@ProtoId(7) @JvmField val time: Int = 0, @ProtoNumber(7) @JvmField val time: Int = 0,
@ProtoId(8) @JvmField val starttime: Long = 0L, @ProtoNumber(8) @JvmField val starttime: Long = 0L,
@ProtoId(9) @JvmField val isAudio: Int = 0 @ProtoNumber(9) @JvmField val isAudio: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -135,142 +135,142 @@ internal class BdhExtinfo : ProtoBuf {
internal class CSDataHighwayHead : ProtoBuf { internal class CSDataHighwayHead : ProtoBuf {
@Serializable @Serializable
internal class C2CCommonExtendinfo( internal class C2CCommonExtendinfo(
@ProtoId(1) @JvmField val infoId: Int = 0, @ProtoNumber(1) @JvmField val infoId: Int = 0,
@ProtoId(2) @JvmField val msgFilterExtendinfo: FilterExtendinfo? = null @ProtoNumber(2) @JvmField val msgFilterExtendinfo: FilterExtendinfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DataHighwayHead( internal class DataHighwayHead(
@ProtoId(1) @JvmField val version: Int = 0, @ProtoNumber(1) @JvmField val version: Int = 0,
@ProtoId(2) @JvmField val uin: String = "", // yes @ProtoNumber(2) @JvmField val uin: String = "", // yes
@ProtoId(3) @JvmField val command: String = "", @ProtoNumber(3) @JvmField val command: String = "",
@ProtoId(4) @JvmField val seq: Int = 0, @ProtoNumber(4) @JvmField val seq: Int = 0,
@ProtoId(5) @JvmField val retryTimes: Int = 0, @ProtoNumber(5) @JvmField val retryTimes: Int = 0,
@ProtoId(6) @JvmField val appid: Int = 0, @ProtoNumber(6) @JvmField val appid: Int = 0,
@ProtoId(7) @JvmField val dataflag: Int = 0, @ProtoNumber(7) @JvmField val dataflag: Int = 0,
@ProtoId(8) @JvmField val commandId: Int = 0, @ProtoNumber(8) @JvmField val commandId: Int = 0,
@ProtoId(9) @JvmField val buildVer: String = "", @ProtoNumber(9) @JvmField val buildVer: String = "",
@ProtoId(10) @JvmField val localeId: Int = 0 @ProtoNumber(10) @JvmField val localeId: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DataHole( internal class DataHole(
@ProtoId(1) @JvmField val begin: Long = 0L, @ProtoNumber(1) @JvmField val begin: Long = 0L,
@ProtoId(2) @JvmField val end: Long = 0L @ProtoNumber(2) @JvmField val end: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FilterExtendinfo( internal class FilterExtendinfo(
@ProtoId(1) @JvmField val filterFlag: Int = 0, @ProtoNumber(1) @JvmField val filterFlag: Int = 0,
@ProtoId(2) @JvmField val msgImageFilterRequest: ImageFilterRequest? = null @ProtoNumber(2) @JvmField val msgImageFilterRequest: ImageFilterRequest? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FilterStyle( internal class FilterStyle(
@ProtoId(1) @JvmField val styleId: Int = 0, @ProtoNumber(1) @JvmField val styleId: Int = 0,
@ProtoId(2) @JvmField val styleName: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val styleName: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ImageFilterRequest( internal class ImageFilterRequest(
@ProtoId(1) @JvmField val sessionId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val sessionId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val clientIp: Int = 0, @ProtoNumber(2) @JvmField val clientIp: Int = 0,
@ProtoId(3) @JvmField val uin: Long = 0L, @ProtoNumber(3) @JvmField val uin: Long = 0L,
@ProtoId(4) @JvmField val style: FilterStyle? = null, @ProtoNumber(4) @JvmField val style: FilterStyle? = null,
@ProtoId(5) @JvmField val width: Int = 0, @ProtoNumber(5) @JvmField val width: Int = 0,
@ProtoId(6) @JvmField val height: Int = 0, @ProtoNumber(6) @JvmField val height: Int = 0,
@ProtoId(7) @JvmField val imageData: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(7) @JvmField val imageData: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ImageFilterResponse( internal class ImageFilterResponse(
@ProtoId(1) @JvmField val retCode: Int = 0, @ProtoNumber(1) @JvmField val retCode: Int = 0,
@ProtoId(2) @JvmField val imageData: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val imageData: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val costTime: Int = 0 @ProtoNumber(3) @JvmField val costTime: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LoginSigHead( internal class LoginSigHead(
@ProtoId(1) @JvmField val loginsigType: Int = 0, @ProtoNumber(1) @JvmField val loginsigType: Int = 0,
@ProtoId(2) @JvmField val loginsig: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val loginsig: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NewServiceTicket( internal class NewServiceTicket(
@ProtoId(1) @JvmField val signature: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val signature: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val ukey: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val ukey: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PicInfoExt( internal class PicInfoExt(
@ProtoId(1) @JvmField val picWidth: Int = 0, @ProtoNumber(1) @JvmField val picWidth: Int = 0,
@ProtoId(2) @JvmField val picHeight: Int = 0, @ProtoNumber(2) @JvmField val picHeight: Int = 0,
@ProtoId(3) @JvmField val picFlag: Int = 0, @ProtoNumber(3) @JvmField val picFlag: Int = 0,
@ProtoId(4) @JvmField val busiType: Int = 0, @ProtoNumber(4) @JvmField val busiType: Int = 0,
@ProtoId(5) @JvmField val srcTerm: Int = 0, @ProtoNumber(5) @JvmField val srcTerm: Int = 0,
@ProtoId(6) @JvmField val platType: Int = 0, @ProtoNumber(6) @JvmField val platType: Int = 0,
@ProtoId(7) @JvmField val netType: Int = 0, @ProtoNumber(7) @JvmField val netType: Int = 0,
@ProtoId(8) @JvmField val imgType: Int = 0, @ProtoNumber(8) @JvmField val imgType: Int = 0,
@ProtoId(9) @JvmField val appPicType: Int = 0 @ProtoNumber(9) @JvmField val appPicType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PicRspExtInfo( internal class PicRspExtInfo(
@ProtoId(1) @JvmField val skey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val skey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val clientIp: Int = 0, @ProtoNumber(2) @JvmField val clientIp: Int = 0,
@ProtoId(3) @JvmField val upOffset: Long = 0L, @ProtoNumber(3) @JvmField val upOffset: Long = 0L,
@ProtoId(4) @JvmField val blockSize: Long = 0L @ProtoNumber(4) @JvmField val blockSize: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class QueryHoleRsp( internal class QueryHoleRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val dataHole: List<DataHole>? = null, @ProtoNumber(2) @JvmField val dataHole: List<DataHole>? = null,
@ProtoId(3) @JvmField val boolCompFlag: Boolean = false @ProtoNumber(3) @JvmField val boolCompFlag: Boolean = false
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqDataHighwayHead( internal class ReqDataHighwayHead(
@ProtoId(1) @JvmField val msgBasehead: DataHighwayHead? = null, @ProtoNumber(1) @JvmField val msgBasehead: DataHighwayHead? = null,
@ProtoId(2) @JvmField val msgSeghead: SegHead? = null, @ProtoNumber(2) @JvmField val msgSeghead: SegHead? = null,
@ProtoId(3) @JvmField val reqExtendinfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val reqExtendinfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val timestamp: Long = 0L, @ProtoNumber(4) @JvmField val timestamp: Long = 0L,
@ProtoId(5) @JvmField val msgLoginSigHead: LoginSigHead? = null @ProtoNumber(5) @JvmField val msgLoginSigHead: LoginSigHead? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val msgQueryHoleRsp: QueryHoleRsp? = null @ProtoNumber(1) @JvmField val msgQueryHoleRsp: QueryHoleRsp? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspDataHighwayHead( internal class RspDataHighwayHead(
@ProtoId(1) @JvmField val msgBasehead: DataHighwayHead? = null, @ProtoNumber(1) @JvmField val msgBasehead: DataHighwayHead? = null,
@ProtoId(2) @JvmField val msgSeghead: SegHead? = null, @ProtoNumber(2) @JvmField val msgSeghead: SegHead? = null,
@ProtoId(3) @JvmField val errorCode: Int = 0, @ProtoNumber(3) @JvmField val errorCode: Int = 0,
@ProtoId(4) @JvmField val allowRetry: Int = 0, @ProtoNumber(4) @JvmField val allowRetry: Int = 0,
@ProtoId(5) @JvmField val cachecost: Int = 0, @ProtoNumber(5) @JvmField val cachecost: Int = 0,
@ProtoId(6) @JvmField val htcost: Int = 0, @ProtoNumber(6) @JvmField val htcost: Int = 0,
@ProtoId(7) @JvmField val rspExtendinfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val rspExtendinfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val timestamp: Long = 0L, @ProtoNumber(8) @JvmField val timestamp: Long = 0L,
@ProtoId(9) @JvmField val range: Long = 0L, @ProtoNumber(9) @JvmField val range: Long = 0L,
@ProtoId(10) @JvmField val isReset: Int = 0 @ProtoNumber(10) @JvmField val isReset: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SegHead( internal class SegHead(
@ProtoId(1) @JvmField val serviceid: Int = 0, @ProtoNumber(1) @JvmField val serviceid: Int = 0,
@ProtoId(2) @JvmField val filesize: Long = 0L, @ProtoNumber(2) @JvmField val filesize: Long = 0L,
@ProtoId(3) @JvmField val dataoffset: Long = 0L, @ProtoNumber(3) @JvmField val dataoffset: Long = 0L,
@ProtoId(4) @JvmField val datalength: Int = 0, @ProtoNumber(4) @JvmField val datalength: Int = 0,
@ProtoId(5) @JvmField val rtcode: Int = 0, @ProtoNumber(5) @JvmField val rtcode: Int = 0,
@ProtoId(6) @JvmField val serviceticket: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val serviceticket: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val flag: Int = 0, @ProtoNumber(7) @JvmField val flag: Int = 0,
@ProtoId(8) @JvmField val md5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(8) @JvmField val md5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(9) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val fileMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val cacheAddr: Int = 0, @ProtoNumber(10) @JvmField val cacheAddr: Int = 0,
@ProtoId(11) @JvmField val queryTimes: Int = 0, @ProtoNumber(11) @JvmField val queryTimes: Int = 0,
@ProtoId(12) @JvmField val updateCacheip: Int = 0 @ProtoNumber(12) @JvmField val updateCacheip: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -278,31 +278,31 @@ internal class CSDataHighwayHead : ProtoBuf {
internal class HwConfigPersistentPB : ProtoBuf { internal class HwConfigPersistentPB : ProtoBuf {
@Serializable @Serializable
internal class HwConfigItemPB( internal class HwConfigItemPB(
@ProtoId(1) @JvmField val ingKey: String = "", @ProtoNumber(1) @JvmField val ingKey: String = "",
@ProtoId(2) @JvmField val endPointList: List<HwEndPointPB>? = null @ProtoNumber(2) @JvmField val endPointList: List<HwEndPointPB>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HwConfigPB( internal class HwConfigPB(
@ProtoId(1) @JvmField val configItemList: List<HwConfigItemPB>? = null, @ProtoNumber(1) @JvmField val configItemList: List<HwConfigItemPB>? = null,
@ProtoId(2) @JvmField val netSegConfList: List<HwNetSegConfPB>? = null, @ProtoNumber(2) @JvmField val netSegConfList: List<HwNetSegConfPB>? = null,
@ProtoId(3) @JvmField val shortVideoNetConf: List<HwNetSegConfPB>? = null, @ProtoNumber(3) @JvmField val shortVideoNetConf: List<HwNetSegConfPB>? = null,
@ProtoId(4) @JvmField val configItemListIp6: List<HwConfigItemPB>? = null @ProtoNumber(4) @JvmField val configItemListIp6: List<HwConfigItemPB>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HwEndPointPB( internal class HwEndPointPB(
@ProtoId(1) @JvmField val ingHost: String = "", @ProtoNumber(1) @JvmField val ingHost: String = "",
@ProtoId(2) @JvmField val int32Port: Int = 0, @ProtoNumber(2) @JvmField val int32Port: Int = 0,
@ProtoId(3) @JvmField val int64Timestampe: Long = 0L @ProtoNumber(3) @JvmField val int64Timestampe: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class HwNetSegConfPB( internal class HwNetSegConfPB(
@ProtoId(1) @JvmField val int64NetType: Long = 0L, @ProtoNumber(1) @JvmField val int64NetType: Long = 0L,
@ProtoId(2) @JvmField val int64SegSize: Long = 0L, @ProtoNumber(2) @JvmField val int64SegSize: Long = 0L,
@ProtoId(3) @JvmField val int64SegNum: Long = 0L, @ProtoNumber(3) @JvmField val int64SegNum: Long = 0L,
@ProtoId(4) @JvmField val int64CurConnNum: Long = 0L @ProtoNumber(4) @JvmField val int64CurConnNum: Long = 0L
) : ProtoBuf ) : ProtoBuf
} }
@@ -310,8 +310,8 @@ internal class HwConfigPersistentPB : ProtoBuf {
internal class HwSessionInfoPersistentPB : ProtoBuf { internal class HwSessionInfoPersistentPB : ProtoBuf {
@Serializable @Serializable
internal class HwSessionInfoPB( internal class HwSessionInfoPB(
@ProtoId(1) @JvmField val httpconnSigSession: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val httpconnSigSession: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val sessionKey: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val sessionKey: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
} }
@@ -319,137 +319,137 @@ internal class HwSessionInfoPersistentPB : ProtoBuf {
internal class Subcmd0x501 : ProtoBuf { internal class Subcmd0x501 : ProtoBuf {
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1281) @JvmField val msgSubcmd0x501ReqBody: SubCmd0x501ReqBody? = null @ProtoNumber(1281) @JvmField val msgSubcmd0x501ReqBody: SubCmd0x501ReqBody? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1281) @JvmField val msgSubcmd0x501RspBody: SubCmd0x501Rspbody? = null @ProtoNumber(1281) @JvmField val msgSubcmd0x501RspBody: SubCmd0x501Rspbody? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SubCmd0x501ReqBody( internal class SubCmd0x501ReqBody(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val idcId: Int = 0, @ProtoNumber(2) @JvmField val idcId: Int = 0,
@ProtoId(3) @JvmField val appid: Int = 0, @ProtoNumber(3) @JvmField val appid: Int = 0,
@ProtoId(4) @JvmField val loginSigType: Int = 0, @ProtoNumber(4) @JvmField val loginSigType: Int = 0,
@ProtoId(5) @JvmField val loginSigTicket: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val loginSigTicket: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val requestFlag: Int = 0, @ProtoNumber(6) @JvmField val requestFlag: Int = 0,
@ProtoId(7) @JvmField val uint32ServiceTypes: List<Int>? = null, @ProtoNumber(7) @JvmField val uint32ServiceTypes: List<Int>? = null,
@ProtoId(8) @JvmField val bid: Int = 0, @ProtoNumber(8) @JvmField val bid: Int = 0,
@ProtoId(9) @JvmField val term: Int = 0, @ProtoNumber(9) @JvmField val term: Int = 0,
@ProtoId(10) @JvmField val plat: Int = 0, @ProtoNumber(10) @JvmField val plat: Int = 0,
@ProtoId(11) @JvmField val net: Int = 0, @ProtoNumber(11) @JvmField val net: Int = 0,
@ProtoId(12) @JvmField val caller: Int = 0 @ProtoNumber(12) @JvmField val caller: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SubCmd0x501Rspbody( internal class SubCmd0x501Rspbody(
@ProtoId(1) @JvmField val httpconnSigSession: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val httpconnSigSession: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val sessionKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val sessionKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val msgHttpconnAddrs: List<SrvAddrs>? = null, @ProtoNumber(3) @JvmField val msgHttpconnAddrs: List<SrvAddrs>? = null,
@ProtoId(4) @JvmField val preConnection: Int = 0, @ProtoNumber(4) @JvmField val preConnection: Int = 0,
@ProtoId(5) @JvmField val csConn: Int = 0, @ProtoNumber(5) @JvmField val csConn: Int = 0,
@ProtoId(6) @JvmField val msgIpLearnConf: IpLearnConf? = null, @ProtoNumber(6) @JvmField val msgIpLearnConf: IpLearnConf? = null,
@ProtoId(7) @JvmField val msgDynTimeoutConf: DynTimeOutConf? = null, @ProtoNumber(7) @JvmField val msgDynTimeoutConf: DynTimeOutConf? = null,
@ProtoId(8) @JvmField val msgOpenUpConf: OpenUpConf? = null, @ProtoNumber(8) @JvmField val msgOpenUpConf: OpenUpConf? = null,
@ProtoId(9) @JvmField val msgDownloadEncryptConf: DownloadEncryptConf? = null, @ProtoNumber(9) @JvmField val msgDownloadEncryptConf: DownloadEncryptConf? = null,
@ProtoId(10) @JvmField val msgShortVideoConf: ShortVideoConf? = null, @ProtoNumber(10) @JvmField val msgShortVideoConf: ShortVideoConf? = null,
@ProtoId(11) @JvmField val msgPtvConf: PTVConf? = null @ProtoNumber(11) @JvmField val msgPtvConf: PTVConf? = null
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class DownloadEncryptConf( internal class DownloadEncryptConf(
@ProtoId(1) @JvmField val boolEnableEncryptRequest: Boolean = false, @ProtoNumber(1) @JvmField val boolEnableEncryptRequest: Boolean = false,
@ProtoId(2) @JvmField val boolEnableEncryptedPic: Boolean = false, @ProtoNumber(2) @JvmField val boolEnableEncryptedPic: Boolean = false,
@ProtoId(3) @JvmField val ctrlFlag: Int = 0 @ProtoNumber(3) @JvmField val ctrlFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DynTimeOutConf( internal class DynTimeOutConf(
@ProtoId(1) @JvmField val tbase2g: Int = 0, @ProtoNumber(1) @JvmField val tbase2g: Int = 0,
@ProtoId(2) @JvmField val tbase3g: Int = 0, @ProtoNumber(2) @JvmField val tbase3g: Int = 0,
@ProtoId(3) @JvmField val tbase4g: Int = 0, @ProtoNumber(3) @JvmField val tbase4g: Int = 0,
@ProtoId(4) @JvmField val tbaseWifi: Int = 0, @ProtoNumber(4) @JvmField val tbaseWifi: Int = 0,
@ProtoId(5) @JvmField val torg2g: Int = 0, @ProtoNumber(5) @JvmField val torg2g: Int = 0,
@ProtoId(6) @JvmField val torg3g: Int = 0, @ProtoNumber(6) @JvmField val torg3g: Int = 0,
@ProtoId(7) @JvmField val torg4g: Int = 0, @ProtoNumber(7) @JvmField val torg4g: Int = 0,
@ProtoId(8) @JvmField val torgWifi: Int = 0, @ProtoNumber(8) @JvmField val torgWifi: Int = 0,
@ProtoId(9) @JvmField val maxTimeout: Int = 0, @ProtoNumber(9) @JvmField val maxTimeout: Int = 0,
@ProtoId(10) @JvmField val enableDynTimeout: Int = 0, @ProtoNumber(10) @JvmField val enableDynTimeout: Int = 0,
@ProtoId(11) @JvmField val maxTimeout2g: Int = 0, @ProtoNumber(11) @JvmField val maxTimeout2g: Int = 0,
@ProtoId(12) @JvmField val maxTimeout3g: Int = 0, @ProtoNumber(12) @JvmField val maxTimeout3g: Int = 0,
@ProtoId(13) @JvmField val maxTimeout4g: Int = 0, @ProtoNumber(13) @JvmField val maxTimeout4g: Int = 0,
@ProtoId(14) @JvmField val maxTimeoutWifi: Int = 0, @ProtoNumber(14) @JvmField val maxTimeoutWifi: Int = 0,
@ProtoId(15) @JvmField val hbTimeout2g: Int = 0, @ProtoNumber(15) @JvmField val hbTimeout2g: Int = 0,
@ProtoId(16) @JvmField val hbTimeout3g: Int = 0, @ProtoNumber(16) @JvmField val hbTimeout3g: Int = 0,
@ProtoId(17) @JvmField val hbTimeout4g: Int = 0, @ProtoNumber(17) @JvmField val hbTimeout4g: Int = 0,
@ProtoId(18) @JvmField val hbTimeoutWifi: Int = 0, @ProtoNumber(18) @JvmField val hbTimeoutWifi: Int = 0,
@ProtoId(19) @JvmField val hbTimeoutDefault: Int = 0 @ProtoNumber(19) @JvmField val hbTimeoutDefault: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Ip6Addr( internal class Ip6Addr(
@ProtoId(1) @JvmField val type: Int = 0, @ProtoNumber(1) @JvmField val type: Int = 0,
@ProtoId(2) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val ip6: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val port: Int = 0, @ProtoNumber(3) @JvmField val port: Int = 0,
@ProtoId(4) @JvmField val area: Int = 0, @ProtoNumber(4) @JvmField val area: Int = 0,
@ProtoId(5) @JvmField val sameIsp: Int = 0 @ProtoNumber(5) @JvmField val sameIsp: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class IpAddr( internal class IpAddr(
@ProtoId(1) @JvmField val type: Int = 0, @ProtoNumber(1) @JvmField val type: Int = 0,
@ProtoType(ProtoNumberType.FIXED) @ProtoId(2) @JvmField val ip: Int = 0, @ProtoType(ProtoIntegerType.FIXED) @ProtoNumber(2) @JvmField val ip: Int = 0,
@ProtoId(3) @JvmField val port: Int = 0, @ProtoNumber(3) @JvmField val port: Int = 0,
@ProtoId(4) @JvmField val area: Int = 0, @ProtoNumber(4) @JvmField val area: Int = 0,
@ProtoId(5) @JvmField val sameIsp: Int = 0 @ProtoNumber(5) @JvmField val sameIsp: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class IpLearnConf( internal class IpLearnConf(
@ProtoId(1) @JvmField val refreshCachedIp: Int = 0, @ProtoNumber(1) @JvmField val refreshCachedIp: Int = 0,
@ProtoId(2) @JvmField val enableIpLearn: Int = 0 @ProtoNumber(2) @JvmField val enableIpLearn: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class NetSegConf( internal class NetSegConf(
@ProtoId(1) @JvmField val netType: Int = 0, @ProtoNumber(1) @JvmField val netType: Int = 0,
@ProtoId(2) @JvmField val segsize: Int = 0, @ProtoNumber(2) @JvmField val segsize: Int = 0,
@ProtoId(3) @JvmField val segnum: Int = 0, @ProtoNumber(3) @JvmField val segnum: Int = 0,
@ProtoId(4) @JvmField val curconnnum: Int = 0 @ProtoNumber(4) @JvmField val curconnnum: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class OpenUpConf( internal class OpenUpConf(
@ProtoId(1) @JvmField val boolEnableOpenup: Boolean = false, @ProtoNumber(1) @JvmField val boolEnableOpenup: Boolean = false,
@ProtoId(2) @JvmField val preSendSegnum: Int = 0, @ProtoNumber(2) @JvmField val preSendSegnum: Int = 0,
@ProtoId(3) @JvmField val preSendSegnum3g: Int = 0, @ProtoNumber(3) @JvmField val preSendSegnum3g: Int = 0,
@ProtoId(4) @JvmField val preSendSegnum4g: Int = 0, @ProtoNumber(4) @JvmField val preSendSegnum4g: Int = 0,
@ProtoId(5) @JvmField val preSendSegnumWifi: Int = 0 @ProtoNumber(5) @JvmField val preSendSegnumWifi: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PTVConf( internal class PTVConf(
@ProtoId(1) @JvmField val channelType: Int = 0, @ProtoNumber(1) @JvmField val channelType: Int = 0,
@ProtoId(2) @JvmField val msgNetsegconf: List<NetSegConf>? = null, @ProtoNumber(2) @JvmField val msgNetsegconf: List<NetSegConf>? = null,
@ProtoId(3) @JvmField val boolOpenHardwareCodec: Boolean = false @ProtoNumber(3) @JvmField val boolOpenHardwareCodec: Boolean = false
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ShortVideoConf( internal class ShortVideoConf(
@ProtoId(1) @JvmField val channelType: Int = 0, @ProtoNumber(1) @JvmField val channelType: Int = 0,
@ProtoId(2) @JvmField val msgNetsegconf: List<NetSegConf>? = null, @ProtoNumber(2) @JvmField val msgNetsegconf: List<NetSegConf>? = null,
@ProtoId(3) @JvmField val boolOpenHardwareCodec: Boolean = false, @ProtoNumber(3) @JvmField val boolOpenHardwareCodec: Boolean = false,
@ProtoId(4) @JvmField val boolSendAheadSignal: Boolean = false @ProtoNumber(4) @JvmField val boolSendAheadSignal: Boolean = false
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SrvAddrs( internal class SrvAddrs(
@ProtoId(1) @JvmField val serviceType: Int = 0, @ProtoNumber(1) @JvmField val serviceType: Int = 0,
@ProtoId(2) @JvmField val msgAddrs: List<IpAddr>? = null, @ProtoNumber(2) @JvmField val msgAddrs: List<IpAddr>? = null,
@ProtoId(3) @JvmField val fragmentSize: Int = 0, @ProtoNumber(3) @JvmField val fragmentSize: Int = 0,
@ProtoId(4) @JvmField val msgNetsegconf: List<NetSegConf>? = null, @ProtoNumber(4) @JvmField val msgNetsegconf: List<NetSegConf>? = null,
@ProtoId(5) @JvmField val msgAddrsV6: List<Ip6Addr>? = null @ProtoNumber(5) @JvmField val msgAddrsV6: List<Ip6Addr>? = null
) : ProtoBuf ) : ProtoBuf
} }
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,256 +9,256 @@ import kotlin.jvm.JvmField
internal class HummerCommelem : ProtoBuf { internal class HummerCommelem : ProtoBuf {
@Serializable @Serializable
internal class MsgElemInfoServtype1( internal class MsgElemInfoServtype1(
@ProtoId(1) @JvmField val rewardId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val rewardId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val senderUin: Long = 0L, @ProtoNumber(2) @JvmField val senderUin: Long = 0L,
@ProtoId(3) @JvmField val picType: Int = 0, @ProtoNumber(3) @JvmField val picType: Int = 0,
@ProtoId(4) @JvmField val rewardMoney: Int = 0, @ProtoNumber(4) @JvmField val rewardMoney: Int = 0,
@ProtoId(5) @JvmField val url: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val url: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val content: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val createTimestamp: Int = 0, @ProtoNumber(7) @JvmField val createTimestamp: Int = 0,
@ProtoId(8) @JvmField val status: Int = 0, @ProtoNumber(8) @JvmField val status: Int = 0,
@ProtoId(9) @JvmField val size: Int = 0, @ProtoNumber(9) @JvmField val size: Int = 0,
@ProtoId(10) @JvmField val videoDuration: Int = 0, @ProtoNumber(10) @JvmField val videoDuration: Int = 0,
@ProtoId(11) @JvmField val seq: Long = 0L, @ProtoNumber(11) @JvmField val seq: Long = 0L,
@ProtoId(12) @JvmField val rewardTypeExt: Int = 0 @ProtoNumber(12) @JvmField val rewardTypeExt: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype11( internal class MsgElemInfoServtype11(
@ProtoId(1) @JvmField val resID: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val resID: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val resMD5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val resMD5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val reserveInfo1: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val reserveInfo1: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val reserveInfo2: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val reserveInfo2: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val doodleDataOffset: Int = 0, @ProtoNumber(5) @JvmField val doodleDataOffset: Int = 0,
@ProtoId(6) @JvmField val doodleGifId: Int = 0, @ProtoNumber(6) @JvmField val doodleGifId: Int = 0,
@ProtoId(7) @JvmField val doodleUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val doodleUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val doodleMd5: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(8) @JvmField val doodleMd5: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype13( internal class MsgElemInfoServtype13(
@ProtoId(1) @JvmField val sysHeadId: Int = 0, @ProtoNumber(1) @JvmField val sysHeadId: Int = 0,
@ProtoId(2) @JvmField val headFlag: Int = 0 @ProtoNumber(2) @JvmField val headFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype14( internal class MsgElemInfoServtype14(
@ProtoId(1) @JvmField val id: Int = 0, @ProtoNumber(1) @JvmField val id: Int = 0,
@ProtoId(2) @JvmField val reserveInfo: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val reserveInfo: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype15( internal class MsgElemInfoServtype15(
@ProtoId(1) @JvmField val vid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val vid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val cover: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val cover: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val title: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val title: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val summary: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val summary: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val createTime: Long = 0L, @ProtoNumber(5) @JvmField val createTime: Long = 0L,
@ProtoId(6) @JvmField val commentContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val commentContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val author: Long = 0L, @ProtoNumber(7) @JvmField val author: Long = 0L,
@ProtoId(8) @JvmField val ctrVersion: Int = 0 @ProtoNumber(8) @JvmField val ctrVersion: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype16( internal class MsgElemInfoServtype16(
@ProtoId(1) @JvmField val uid: Long = 0L, @ProtoNumber(1) @JvmField val uid: Long = 0L,
@ProtoId(2) @JvmField val unionID: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val unionID: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val storyID: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val storyID: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val md5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val md5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val thumbUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val thumbUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val doodleUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val doodleUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val videoWidth: Int = 0, @ProtoNumber(7) @JvmField val videoWidth: Int = 0,
@ProtoId(8) @JvmField val videoHeight: Int = 0, @ProtoNumber(8) @JvmField val videoHeight: Int = 0,
@ProtoId(9) @JvmField val sourceName: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val sourceName: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val sourceActionType: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val sourceActionType: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val sourceActionData: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(11) @JvmField val sourceActionData: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(12) @JvmField val ctrVersion: Int = 0 @ProtoNumber(12) @JvmField val ctrVersion: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype18( internal class MsgElemInfoServtype18(
@ProtoId(1) @JvmField val currentAmount: Long = 0L, @ProtoNumber(1) @JvmField val currentAmount: Long = 0L,
@ProtoId(2) @JvmField val totalAmount: Long = 0L, @ProtoNumber(2) @JvmField val totalAmount: Long = 0L,
@ProtoId(3) @JvmField val listid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val listid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val authKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val authKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val number: Int = 0 @ProtoNumber(5) @JvmField val number: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype19( internal class MsgElemInfoServtype19(
@ProtoId(1) @JvmField val data: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val data: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype2( internal class MsgElemInfoServtype2(
@ProtoId(1) @JvmField val pokeType: Int = 0, @ProtoNumber(1) @JvmField val pokeType: Int = 0,
@ProtoId(2) @JvmField val pokeSummary: String = "", @ProtoNumber(2) @JvmField val pokeSummary: String = "",
@ProtoId(3) @JvmField val doubleHit: Int = 0, @ProtoNumber(3) @JvmField val doubleHit: Int = 0,
@ProtoId(4) @JvmField val vaspokeId: Int = 0, @ProtoNumber(4) @JvmField val vaspokeId: Int = 0,
@ProtoId(5) @JvmField val vaspokeName: String = "", @ProtoNumber(5) @JvmField val vaspokeName: String = "",
@ProtoId(6) @JvmField val vaspokeMinver: String = "", @ProtoNumber(6) @JvmField val vaspokeMinver: String = "",
@ProtoId(7) @JvmField val pokeStrength: Int = 0, @ProtoNumber(7) @JvmField val pokeStrength: Int = 0,
@ProtoId(8) @JvmField val msgType: Int = 0, @ProtoNumber(8) @JvmField val msgType: Int = 0,
@ProtoId(9) @JvmField val faceBubbleCount: Int = 0, @ProtoNumber(9) @JvmField val faceBubbleCount: Int = 0,
@ProtoId(10) @JvmField val pokeFlag: Int = 0 @ProtoNumber(10) @JvmField val pokeFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype20( internal class MsgElemInfoServtype20(
@ProtoId(1) @JvmField val data: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val data: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype21( internal class MsgElemInfoServtype21(
@ProtoId(1) @JvmField val topicId: Int = 0, @ProtoNumber(1) @JvmField val topicId: Int = 0,
@ProtoId(2) @JvmField val confessorUin: Long = 0L, @ProtoNumber(2) @JvmField val confessorUin: Long = 0L,
@ProtoId(3) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val confessorSex: Int = 0, @ProtoNumber(4) @JvmField val confessorSex: Int = 0,
@ProtoId(5) @JvmField val sysmsgFlag: Int = 0, @ProtoNumber(5) @JvmField val sysmsgFlag: Int = 0,
@ProtoId(6) @JvmField val c2cConfessCtx: C2CConfessContext? = null, @ProtoNumber(6) @JvmField val c2cConfessCtx: C2CConfessContext? = null,
@ProtoId(7) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(7) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(8) @JvmField val confessTime: Long = 0L, @ProtoNumber(8) @JvmField val confessTime: Long = 0L,
@ProtoId(9) @JvmField val groupConfessMsg: GroupConfessMsg? = null, @ProtoNumber(9) @JvmField val groupConfessMsg: GroupConfessMsg? = null,
@ProtoId(10) @JvmField val groupConfessCtx: GroupConfessContext? = null @ProtoNumber(10) @JvmField val groupConfessCtx: GroupConfessContext? = null
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class C2CConfessContext( internal class C2CConfessContext(
@ProtoId(1) @JvmField val confessorUin: Long = 0L, @ProtoNumber(1) @JvmField val confessorUin: Long = 0L,
@ProtoId(2) @JvmField val confessToUin: Long = 0L, @ProtoNumber(2) @JvmField val confessToUin: Long = 0L,
@ProtoId(3) @JvmField val sendUin: Long = 0L, @ProtoNumber(3) @JvmField val sendUin: Long = 0L,
@ProtoId(4) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val confess: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val confess: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val bgType: Int = 0, @ProtoNumber(6) @JvmField val bgType: Int = 0,
@ProtoId(7) @JvmField val topicId: Int = 0, @ProtoNumber(7) @JvmField val topicId: Int = 0,
@ProtoId(8) @JvmField val confessTime: Long = 0L, @ProtoNumber(8) @JvmField val confessTime: Long = 0L,
@ProtoId(9) @JvmField val confessorSex: Int = 0, @ProtoNumber(9) @JvmField val confessorSex: Int = 0,
@ProtoId(10) @JvmField val bizType: Int = 0, @ProtoNumber(10) @JvmField val bizType: Int = 0,
@ProtoId(11) @JvmField val confessNum: Int = 0, @ProtoNumber(11) @JvmField val confessNum: Int = 0,
@ProtoId(12) @JvmField val confessToSex: Int = 0 @ProtoNumber(12) @JvmField val confessToSex: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupConfessContext( internal class GroupConfessContext(
@ProtoId(1) @JvmField val confessorUin: Long = 0L, @ProtoNumber(1) @JvmField val confessorUin: Long = 0L,
@ProtoId(2) @JvmField val confessToUin: Long = 0L, @ProtoNumber(2) @JvmField val confessToUin: Long = 0L,
@ProtoId(3) @JvmField val sendUin: Long = 0L, @ProtoNumber(3) @JvmField val sendUin: Long = 0L,
@ProtoId(4) @JvmField val confessorSex: Int = 0, @ProtoNumber(4) @JvmField val confessorSex: Int = 0,
@ProtoId(5) @JvmField val confessToNick: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val confessToNick: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val topicId: Int = 0, @ProtoNumber(7) @JvmField val topicId: Int = 0,
@ProtoId(8) @JvmField val confessTime: Long = 0L, @ProtoNumber(8) @JvmField val confessTime: Long = 0L,
@ProtoId(9) @JvmField val confessToNickType: Int = 0, @ProtoNumber(9) @JvmField val confessToNickType: Int = 0,
@ProtoId(10) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(10) @JvmField val confessorNick: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupConfessItem( internal class GroupConfessItem(
@ProtoId(1) @JvmField val topicId: Int = 0, @ProtoNumber(1) @JvmField val topicId: Int = 0,
@ProtoId(2) @JvmField val confessToUin: Long = 0L, @ProtoNumber(2) @JvmField val confessToUin: Long = 0L,
@ProtoId(3) @JvmField val confessToNick: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val confessToNick: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val topic: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val confessToNickType: Int = 0 @ProtoNumber(5) @JvmField val confessToNickType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupConfessMsg( internal class GroupConfessMsg(
@ProtoId(1) @JvmField val confessTime: Long = 0L, @ProtoNumber(1) @JvmField val confessTime: Long = 0L,
@ProtoId(2) @JvmField val confessorUin: Long = 0L, @ProtoNumber(2) @JvmField val confessorUin: Long = 0L,
@ProtoId(3) @JvmField val confessorSex: Int = 0, @ProtoNumber(3) @JvmField val confessorSex: Int = 0,
@ProtoId(4) @JvmField val sysmsgFlag: Int = 0, @ProtoNumber(4) @JvmField val sysmsgFlag: Int = 0,
@ProtoId(5) @JvmField val confessItems: List<GroupConfessItem>? = null, @ProtoNumber(5) @JvmField val confessItems: List<GroupConfessItem>? = null,
@ProtoId(6) @JvmField val totalTopicCount: Int = 0 @ProtoNumber(6) @JvmField val totalTopicCount: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class MsgElemInfoServtype23( internal class MsgElemInfoServtype23(
@ProtoId(1) @JvmField val faceType: Int = 0, @ProtoNumber(1) @JvmField val faceType: Int = 0,
@ProtoId(2) @JvmField val faceBubbleCount: Int = 0, @ProtoNumber(2) @JvmField val faceBubbleCount: Int = 0,
@ProtoId(3) @JvmField val faceSummary: String = "", @ProtoNumber(3) @JvmField val faceSummary: String = "",
@ProtoId(4) @JvmField val flag: Int = 0, @ProtoNumber(4) @JvmField val flag: Int = 0,
@ProtoId(5) @JvmField val others: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val others: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype24( internal class MsgElemInfoServtype24(
@ProtoId(1) @JvmField val limitChatEnter: LimitChatEnter? = null, @ProtoNumber(1) @JvmField val limitChatEnter: LimitChatEnter? = null,
@ProtoId(2) @JvmField val limitChatExit: LimitChatExit? = null @ProtoNumber(2) @JvmField val limitChatExit: LimitChatExit? = null
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class LimitChatEnter( internal class LimitChatEnter(
@ProtoId(1) @JvmField val tipsWording: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val tipsWording: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val leftChatTime: Int = 0, @ProtoNumber(2) @JvmField val leftChatTime: Int = 0,
@ProtoId(3) @JvmField val matchTs: Long = 0L, @ProtoNumber(3) @JvmField val matchTs: Long = 0L,
@ProtoId(4) @JvmField val matchExpiredTime: Int = 0, @ProtoNumber(4) @JvmField val matchExpiredTime: Int = 0,
@ProtoId(5) @JvmField val c2cExpiredTime: Int = 0, @ProtoNumber(5) @JvmField val c2cExpiredTime: Int = 0,
@ProtoId(6) @JvmField val readyTs: Long = 0L, @ProtoNumber(6) @JvmField val readyTs: Long = 0L,
@ProtoId(7) @JvmField val matchNick: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(7) @JvmField val matchNick: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class LimitChatExit( internal class LimitChatExit(
@ProtoId(1) @JvmField val exitMethod: Int = 0, @ProtoNumber(1) @JvmField val exitMethod: Int = 0,
@ProtoId(2) @JvmField val matchTs: Long = 0L @ProtoNumber(2) @JvmField val matchTs: Long = 0L
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class MsgElemInfoServtype27( internal class MsgElemInfoServtype27(
@ProtoId(1) @JvmField val videoFile: ImMsgBody.VideoFile? = null @ProtoNumber(1) @JvmField val videoFile: ImMsgBody.VideoFile? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype29( internal class MsgElemInfoServtype29(
@ProtoId(1) @JvmField val luckybagMsg: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val luckybagMsg: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype3( internal class MsgElemInfoServtype3(
@ProtoId(1) @JvmField val flashTroopPic: ImMsgBody.CustomFace? = null, @ProtoNumber(1) @JvmField val flashTroopPic: ImMsgBody.CustomFace? = null,
@ProtoId(2) @JvmField val flashC2cPic: ImMsgBody.NotOnlineImage? = null @ProtoNumber(2) @JvmField val flashC2cPic: ImMsgBody.NotOnlineImage? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype31( internal class MsgElemInfoServtype31(
@ProtoId(1) @JvmField val text: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val text: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val ext: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val ext: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype4( internal class MsgElemInfoServtype4(
@ProtoId(1) @JvmField val imsgType: Int = 0, @ProtoNumber(1) @JvmField val imsgType: Int = 0,
@ProtoId(4) @JvmField val stStoryAioObjMsg: StoryAioObjMsg? = null @ProtoNumber(4) @JvmField val stStoryAioObjMsg: StoryAioObjMsg? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype5( internal class MsgElemInfoServtype5(
@ProtoId(1) @JvmField val vid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val vid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val cover: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val cover: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val title: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val title: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val summary: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val summary: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val createTime: Long = 0L, @ProtoNumber(5) @JvmField val createTime: Long = 0L,
@ProtoId(6) @JvmField val commentContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val commentContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val author: Long = 0L @ProtoNumber(7) @JvmField val author: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype8( internal class MsgElemInfoServtype8(
@ProtoId(1) @JvmField val wifiDeliverGiftMsg: ImMsgBody.DeliverGiftMsg? = null @ProtoNumber(1) @JvmField val wifiDeliverGiftMsg: ImMsgBody.DeliverGiftMsg? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgElemInfoServtype9( internal class MsgElemInfoServtype9(
@ProtoId(1) @JvmField val anchorStatus: Int = 0, @ProtoNumber(1) @JvmField val anchorStatus: Int = 0,
@ProtoId(2) @JvmField val jumpSchema: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val jumpSchema: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val anchorNickname: String = "", @ProtoNumber(3) @JvmField val anchorNickname: String = "",
@ProtoId(4) @JvmField val anchorHeadUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val anchorHeadUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val liveTitle: String = "" @ProtoNumber(5) @JvmField val liveTitle: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class StoryAioObjMsg( internal class StoryAioObjMsg(
@ProtoId(1) @JvmField val uiUrl: String = "", @ProtoNumber(1) @JvmField val uiUrl: String = "",
@ProtoId(2) @JvmField val jmpUrl: String = "" @ProtoNumber(2) @JvmField val jmpUrl: String = ""
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import net.mamoe.mirai.utils.currentTimeSeconds import net.mamoe.mirai.utils.currentTimeSeconds
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -12,22 +12,22 @@ internal interface ImgReq : ProtoBuf
@Serializable @Serializable
internal class GetImgUrlReq( internal class GetImgUrlReq(
@ProtoId(1) @JvmField val srcUni: Int, @ProtoNumber(1) @JvmField val srcUni: Int,
@ProtoId(2) @JvmField val dstUni: Int, @ProtoNumber(2) @JvmField val dstUni: Int,
@ProtoId(3) @JvmField val fileResID: String,//UUID @ProtoNumber(3) @JvmField val fileResID: String,//UUID
/** /**
* UUID例子: 没有找到 * UUID例子: 没有找到
*/ */
@ProtoId(4) @JvmField val urlFlag: Int = 1, @ProtoNumber(4) @JvmField val urlFlag: Int = 1,
//5 unknown, 好像没用 //5 unknown, 好像没用
@ProtoId(6) @JvmField val urlType: Int = 4, @ProtoNumber(6) @JvmField val urlType: Int = 4,
@ProtoId(7) @JvmField val requestTerm: Int = 5,//确定 @ProtoNumber(7) @JvmField val requestTerm: Int = 5,//确定
@ProtoId(8) @JvmField val requestPlatformType: Int = 9,//确定 @ProtoNumber(8) @JvmField val requestPlatformType: Int = 9,//确定
@ProtoId(9) @JvmField val srcFileType: Int = 1,//2=ftn1=picplatform255 @ProtoNumber(9) @JvmField val srcFileType: Int = 1,//2=ftn1=picplatform255
@ProtoId(10) @JvmField val innerIP: Int = 0,//确定 @ProtoNumber(10) @JvmField val innerIP: Int = 0,//确定
@ProtoId(11) @JvmField val addressBook: Int = 0,//[ChatType.internalID]== 1006为1[为CONTACT时] 我觉得发0没问题 @ProtoNumber(11) @JvmField val addressBook: Int = 0,//[ChatType.internalID]== 1006为1[为CONTACT时] 我觉得发0没问题
@ProtoId(12) @JvmField val buType: Int = 1,//确定 @ProtoNumber(12) @JvmField val buType: Int = 1,//确定
@ProtoId(13) @JvmField val buildVer: String = "8.2.7.4410",//版本号 @ProtoNumber(13) @JvmField val buildVer: String = "8.2.7.4410",//版本号
@ProtoId(14) @JvmField val timestamp: Int = currentTimeSeconds.toInt(),//(pic_up_timestamp) @ProtoNumber(14) @JvmField val timestamp: Int = currentTimeSeconds.toInt(),//(pic_up_timestamp)
@ProtoId(15) @JvmField val requestTransferType: Int = 1 @ProtoNumber(15) @JvmField val requestTransferType: Int = 1
) : ImgReq ) : ImgReq

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,65 +9,65 @@ import kotlin.jvm.JvmField
internal class LongMsg : ProtoBuf { internal class LongMsg : ProtoBuf {
@Serializable @Serializable
internal class MsgDeleteReq( internal class MsgDeleteReq(
@ProtoId(1) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val msgType: Int = 0 @ProtoNumber(2) @JvmField val msgType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgDeleteRsp( internal class MsgDeleteRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgDownReq( internal class MsgDownReq(
@ProtoId(1) @JvmField val srcUin: Int = 0, @ProtoNumber(1) @JvmField val srcUin: Int = 0,
@ProtoId(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val msgType: Int = 0, @ProtoNumber(3) @JvmField val msgType: Int = 0,
@ProtoId(4) @JvmField val needCache: Int = 0 @ProtoNumber(4) @JvmField val needCache: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgDownRsp( internal class MsgDownRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgUpReq( internal class MsgUpReq(
@ProtoId(1) @JvmField val msgType: Int = 0, @ProtoNumber(1) @JvmField val msgType: Int = 0,
@ProtoId(2) @JvmField val dstUin: Long = 0L, @ProtoNumber(2) @JvmField val dstUin: Long = 0L,
@ProtoId(3) @JvmField val msgId: Int = 0, @ProtoNumber(3) @JvmField val msgId: Int = 0,
@ProtoId(4) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val storeType: Int = 0, @ProtoNumber(5) @JvmField val storeType: Int = 0,
@ProtoId(6) @JvmField val msgUkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val msgUkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val needCache: Int = 0 @ProtoNumber(7) @JvmField val needCache: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgUpRsp( internal class MsgUpRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val msgId: Int = 0, @ProtoNumber(2) @JvmField val msgId: Int = 0,
@ProtoId(3) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(3) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, @ProtoNumber(1) @JvmField val subcmd: Int = 0,
@ProtoId(2) @JvmField val termType: Int = 0, @ProtoNumber(2) @JvmField val termType: Int = 0,
@ProtoId(3) @JvmField val platformType: Int = 0, @ProtoNumber(3) @JvmField val platformType: Int = 0,
@ProtoId(4) @JvmField val msgUpReq: List<LongMsg.MsgUpReq>? = null, @ProtoNumber(4) @JvmField val msgUpReq: List<LongMsg.MsgUpReq>? = null,
@ProtoId(5) @JvmField val msgDownReq: List<LongMsg.MsgDownReq>? = null, @ProtoNumber(5) @JvmField val msgDownReq: List<LongMsg.MsgDownReq>? = null,
@ProtoId(6) @JvmField val msgDelReq: List<LongMsg.MsgDeleteReq>? = null, @ProtoNumber(6) @JvmField val msgDelReq: List<LongMsg.MsgDeleteReq>? = null,
@ProtoId(10) @JvmField val agentType: Int = 0 @ProtoNumber(10) @JvmField val agentType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, @ProtoNumber(1) @JvmField val subcmd: Int = 0,
@ProtoId(2) @JvmField val msgUpRsp: List<LongMsg.MsgUpRsp>? = null, @ProtoNumber(2) @JvmField val msgUpRsp: List<LongMsg.MsgUpRsp>? = null,
@ProtoId(3) @JvmField val msgDownRsp: List<LongMsg.MsgDownRsp>? = null, @ProtoNumber(3) @JvmField val msgDownRsp: List<LongMsg.MsgDownRsp>? = null,
@ProtoId(4) @JvmField val msgDelRsp: List<LongMsg.MsgDeleteRsp>? = null @ProtoNumber(4) @JvmField val msgDelRsp: List<LongMsg.MsgDeleteRsp>? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -13,143 +13,143 @@ import kotlin.jvm.JvmField
internal class MsgComm : ProtoBuf { internal class MsgComm : ProtoBuf {
@Serializable @Serializable
internal class AppShareInfo( internal class AppShareInfo(
@ProtoId(1) @JvmField val appshareId: Int = 0, @ProtoNumber(1) @JvmField val appshareId: Int = 0,
@ProtoId(2) @JvmField val appshareCookie: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val appshareCookie: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val appshareResource: PluginInfo? = null @ProtoNumber(3) @JvmField val appshareResource: PluginInfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class C2CTmpMsgHead( internal class C2CTmpMsgHead(
@ProtoId(1) @JvmField val c2cType: Int = 0, @ProtoNumber(1) @JvmField val c2cType: Int = 0,
@ProtoId(2) @JvmField val serviceType: Int = 0, @ProtoNumber(2) @JvmField val serviceType: Int = 0,
@ProtoId(3) @JvmField val groupUin: Long = 0L, @ProtoNumber(3) @JvmField val groupUin: Long = 0L,
@ProtoId(4) @JvmField val groupCode: Long = 0L, @ProtoNumber(4) @JvmField val groupCode: Long = 0L,
@ProtoId(5) @JvmField val sig: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val sig: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val sigType: Int = 0, @ProtoNumber(6) @JvmField val sigType: Int = 0,
@ProtoId(7) @JvmField val fromPhone: String = "", @ProtoNumber(7) @JvmField val fromPhone: String = "",
@ProtoId(8) @JvmField val toPhone: String = "", @ProtoNumber(8) @JvmField val toPhone: String = "",
@ProtoId(9) @JvmField val lockDisplay: Int = 0, @ProtoNumber(9) @JvmField val lockDisplay: Int = 0,
@ProtoId(10) @JvmField val directionFlag: Int = 0, @ProtoNumber(10) @JvmField val directionFlag: Int = 0,
@ProtoId(11) @JvmField val reserved: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(11) @JvmField val reserved: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ContentHead( internal class ContentHead(
@ProtoId(1) @JvmField val pkgNum: Int = 0, @ProtoNumber(1) @JvmField val pkgNum: Int = 0,
@ProtoId(2) @JvmField val pkgIndex: Int = 0, @ProtoNumber(2) @JvmField val pkgIndex: Int = 0,
@ProtoId(3) @JvmField val divSeq: Int = 0, @ProtoNumber(3) @JvmField val divSeq: Int = 0,
@ProtoId(4) @JvmField val autoReply: Int = 0 @ProtoNumber(4) @JvmField val autoReply: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DiscussInfo( internal class DiscussInfo(
@ProtoId(1) @JvmField val discussUin: Long = 0L, @ProtoNumber(1) @JvmField val discussUin: Long = 0L,
@ProtoId(2) @JvmField val discussType: Int = 0, @ProtoNumber(2) @JvmField val discussType: Int = 0,
@ProtoId(3) @JvmField val discussInfoSeq: Long = 0L, @ProtoNumber(3) @JvmField val discussInfoSeq: Long = 0L,
@ProtoId(4) @JvmField val discussRemark: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val discussRemark: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val discussName: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(5) @JvmField val discussName: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ExtGroupKeyInfo( internal class ExtGroupKeyInfo(
@ProtoId(1) @JvmField val curMaxSeq: Int = 0, @ProtoNumber(1) @JvmField val curMaxSeq: Int = 0,
@ProtoId(2) @JvmField val curTime: Long = 0L @ProtoNumber(2) @JvmField val curTime: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupInfo( internal class GroupInfo(
@ProtoId(1) @JvmField val groupCode: Long = 0L, @ProtoNumber(1) @JvmField val groupCode: Long = 0L,
@ProtoId(2) @JvmField val groupType: Int = 0, @ProtoNumber(2) @JvmField val groupType: Int = 0,
@ProtoId(3) @JvmField val groupInfoSeq: Long = 0L, @ProtoNumber(3) @JvmField val groupInfoSeq: Long = 0L,
@ProtoId(4) @JvmField val groupCard: String = "", @ProtoNumber(4) @JvmField val groupCard: String = "",
@ProtoId(5) @JvmField val groupRank: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(5) @JvmField val groupRank: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(6) @JvmField val groupLevel: Int = 0, @ProtoNumber(6) @JvmField val groupLevel: Int = 0,
@ProtoId(7) @JvmField val groupCardType: Int = 0, @ProtoNumber(7) @JvmField val groupCardType: Int = 0,
@ProtoId(8) @JvmField val groupName: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(8) @JvmField val groupName: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Msg( internal class Msg(
@ProtoId(1) @JvmField val msgHead: MsgHead, @ProtoNumber(1) @JvmField val msgHead: MsgHead,
@ProtoId(2) @JvmField val contentHead: ContentHead? = null, @ProtoNumber(2) @JvmField val contentHead: ContentHead? = null,
@ProtoId(3) @JvmField val msgBody: ImMsgBody.MsgBody, @ProtoNumber(3) @JvmField val msgBody: ImMsgBody.MsgBody,
@ProtoId(4) @JvmField val appshareInfo: AppShareInfo? = null @ProtoNumber(4) @JvmField val appshareInfo: AppShareInfo? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgHead( internal class MsgHead(
@ProtoId(1) @JvmField val fromUin: Long = 0L, @ProtoNumber(1) @JvmField val fromUin: Long = 0L,
@ProtoId(2) @JvmField val toUin: Long = 0L, @ProtoNumber(2) @JvmField val toUin: Long = 0L,
@ProtoId(3) @JvmField val msgType: Int = 0, @ProtoNumber(3) @JvmField val msgType: Int = 0,
@ProtoId(4) @JvmField val c2cCmd: Int = 0, @ProtoNumber(4) @JvmField val c2cCmd: Int = 0,
@ProtoId(5) @JvmField val msgSeq: Int = 0, @ProtoNumber(5) @JvmField val msgSeq: Int = 0,
@ProtoId(6) @JvmField val msgTime: Int = 0, @ProtoNumber(6) @JvmField val msgTime: Int = 0,
@ProtoId(7) var msgUid: Long = 0L, @ProtoNumber(7) var msgUid: Long = 0L,
@ProtoId(8) @JvmField val c2cTmpMsgHead: C2CTmpMsgHead? = null, @ProtoNumber(8) @JvmField val c2cTmpMsgHead: C2CTmpMsgHead? = null,
@ProtoId(9) @JvmField val groupInfo: GroupInfo? = null, @ProtoNumber(9) @JvmField val groupInfo: GroupInfo? = null,
@ProtoId(10) @JvmField val fromAppid: Int = 0, @ProtoNumber(10) @JvmField val fromAppid: Int = 0,
@ProtoId(11) @JvmField val fromInstid: Int = 0, @ProtoNumber(11) @JvmField val fromInstid: Int = 0,
@ProtoId(12) @JvmField val userActive: Int = 0, @ProtoNumber(12) @JvmField val userActive: Int = 0,
@ProtoId(13) @JvmField val discussInfo: DiscussInfo? = null, @ProtoNumber(13) @JvmField val discussInfo: DiscussInfo? = null,
@ProtoId(14) @JvmField val fromNick: String = "", @ProtoNumber(14) @JvmField val fromNick: String = "",
@ProtoId(15) @JvmField val authUin: Long = 0L, @ProtoNumber(15) @JvmField val authUin: Long = 0L,
@ProtoId(16) @JvmField val authNick: String = "", @ProtoNumber(16) @JvmField val authNick: String = "",
@ProtoId(17) @JvmField val msgFlag: Int = 0, @ProtoNumber(17) @JvmField val msgFlag: Int = 0,
@ProtoId(18) @JvmField val authRemark: String = "", @ProtoNumber(18) @JvmField val authRemark: String = "",
@ProtoId(19) @JvmField val groupName: String = "", @ProtoNumber(19) @JvmField val groupName: String = "",
@ProtoId(20) @JvmField val mutiltransHead: MutilTransHead? = null, @ProtoNumber(20) @JvmField val mutiltransHead: MutilTransHead? = null,
@ProtoId(21) @JvmField val msgInstCtrl: ImMsgHead.InstCtrl? = null, @ProtoNumber(21) @JvmField val msgInstCtrl: ImMsgHead.InstCtrl? = null,
@ProtoId(22) @JvmField val publicAccountGroupSendFlag: Int = 0, @ProtoNumber(22) @JvmField val publicAccountGroupSendFlag: Int = 0,
@ProtoId(23) @JvmField val wseqInC2cMsghead: Int = 0, @ProtoNumber(23) @JvmField val wseqInC2cMsghead: Int = 0,
@ProtoId(24) @JvmField val cpid: Long = 0L, @ProtoNumber(24) @JvmField val cpid: Long = 0L,
@ProtoId(25) @JvmField val extGroupKeyInfo: ExtGroupKeyInfo? = null, @ProtoNumber(25) @JvmField val extGroupKeyInfo: ExtGroupKeyInfo? = null,
@ProtoId(26) @JvmField val multiCompatibleText: String = "", @ProtoNumber(26) @JvmField val multiCompatibleText: String = "",
@ProtoId(27) @JvmField val authSex: Int = 0, @ProtoNumber(27) @JvmField val authSex: Int = 0,
@ProtoId(28) @JvmField val isSrcMsg: Boolean = false @ProtoNumber(28) @JvmField val isSrcMsg: Boolean = false
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgType0x210( internal class MsgType0x210(
@ProtoId(1) @JvmField val subMsgType: Int = 0, @ProtoNumber(1) @JvmField val subMsgType: Int = 0,
@ProtoId(2) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val msgContent: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MutilTransHead( internal class MutilTransHead(
@ProtoId(1) @JvmField val status: Int = 0, @ProtoNumber(1) @JvmField val status: Int = 0,
@ProtoId(2) @JvmField val msgId: Int = 0 @ProtoNumber(2) @JvmField val msgId: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PluginInfo( internal class PluginInfo(
@ProtoId(1) @JvmField val resId: Int = 0, @ProtoNumber(1) @JvmField val resId: Int = 0,
@ProtoId(2) @JvmField val pkgName: String = "", @ProtoNumber(2) @JvmField val pkgName: String = "",
@ProtoId(3) @JvmField val newVer: Int = 0, @ProtoNumber(3) @JvmField val newVer: Int = 0,
@ProtoId(4) @JvmField val resType: Int = 0, @ProtoNumber(4) @JvmField val resType: Int = 0,
@ProtoId(5) @JvmField val lanType: Int = 0, @ProtoNumber(5) @JvmField val lanType: Int = 0,
@ProtoId(6) @JvmField val priority: Int = 0, @ProtoNumber(6) @JvmField val priority: Int = 0,
@ProtoId(7) @JvmField val resName: String = "", @ProtoNumber(7) @JvmField val resName: String = "",
@ProtoId(8) @JvmField val resDesc: String = "", @ProtoNumber(8) @JvmField val resDesc: String = "",
@ProtoId(9) @JvmField val resUrlBig: String = "", @ProtoNumber(9) @JvmField val resUrlBig: String = "",
@ProtoId(10) @JvmField val resUrlSmall: String = "", @ProtoNumber(10) @JvmField val resUrlSmall: String = "",
@ProtoId(11) @JvmField val resConf: String = "" @ProtoNumber(11) @JvmField val resConf: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Uin2Nick( internal class Uin2Nick(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val nick: String = "" @ProtoNumber(2) @JvmField val nick: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class UinPairMsg( internal class UinPairMsg(
@ProtoId(1) @JvmField val lastReadTime: Int = 0, @ProtoNumber(1) @JvmField val lastReadTime: Int = 0,
@ProtoId(2) @JvmField val peerUin: Long = 0L, @ProtoNumber(2) @JvmField val peerUin: Long = 0L,
@ProtoId(3) @JvmField val msgCompleted: Int = 0, @ProtoNumber(3) @JvmField val msgCompleted: Int = 0,
@ProtoId(4) @JvmField val msg: List<Msg>? = null, @ProtoNumber(4) @JvmField val msg: List<Msg>? = null,
@ProtoId(5) @JvmField val unreadMsgNum: Int = 0, @ProtoNumber(5) @JvmField val unreadMsgNum: Int = 0,
@ProtoId(8) @JvmField val c2cType: Int = 0, @ProtoNumber(8) @JvmField val c2cType: Int = 0,
@ProtoId(9) @JvmField val serviceType: Int = 0, @ProtoNumber(9) @JvmField val serviceType: Int = 0,
@ProtoId(10) @JvmField val pbReserve: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(10) @JvmField val pbReserve: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,30 +1,30 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
class MsgRevokeUserDef : ProtoBuf { internal class MsgRevokeUserDef : ProtoBuf {
@Serializable @Serializable
internal class MsgInfoUserDef( internal class MsgInfoUserDef(
@ProtoId(1) @JvmField val longMessageFlag: Int = 0, @ProtoNumber(1) @JvmField val longMessageFlag: Int = 0,
@ProtoId(2) @JvmField val longMsgInfo: List<MsgInfoDef>? = null, @ProtoNumber(2) @JvmField val longMsgInfo: List<MsgInfoDef>? = null,
@ProtoId(3) @JvmField val fileUuid: List<String> = listOf() @ProtoNumber(3) @JvmField val fileUuid: List<String> = listOf()
) : ProtoBuf { ) : ProtoBuf {
@Serializable @Serializable
internal class MsgInfoDef( internal class MsgInfoDef(
@ProtoId(1) @JvmField val msgSeq: Int = 0, @ProtoNumber(1) @JvmField val msgSeq: Int = 0,
@ProtoId(2) @JvmField val longMsgId: Int = 0, @ProtoNumber(2) @JvmField val longMsgId: Int = 0,
@ProtoId(3) @JvmField val longMsgNum: Int = 0, @ProtoNumber(3) @JvmField val longMsgNum: Int = 0,
@ProtoId(4) @JvmField val longMsgIndex: Int = 0 @ProtoNumber(4) @JvmField val longMsgIndex: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@Serializable @Serializable
internal class UinTypeUserDef( internal class UinTypeUserDef(
@ProtoId(1) @JvmField val fromUinType: Int = 0, @ProtoNumber(1) @JvmField val fromUinType: Int = 0,
@ProtoId(2) @JvmField val fromGroupCode: Long = 0L, @ProtoNumber(2) @JvmField val fromGroupCode: Long = 0L,
@ProtoId(3) @JvmField val fileUuid: List<String> = listOf() @ProtoNumber(3) @JvmField val fileUuid: List<String> = listOf()
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,18 +9,18 @@ import kotlin.jvm.JvmField
internal class MsgTransmit : ProtoBuf { internal class MsgTransmit : ProtoBuf {
@Serializable @Serializable
internal class PbMultiMsgItem( internal class PbMultiMsgItem(
@ProtoId(1) @JvmField val fileName: String = "", @ProtoNumber(1) @JvmField val fileName: String = "",
@ProtoId(2) @JvmField val buffer: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(2) @JvmField val buffer: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PbMultiMsgNew( internal class PbMultiMsgNew(
@ProtoId(1) @JvmField val msg: List<MsgComm.Msg>? = null @ProtoNumber(1) @JvmField val msg: List<MsgComm.Msg>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PbMultiMsgTransmit( internal class PbMultiMsgTransmit(
@ProtoId(1) @JvmField val msg: List<MsgComm.Msg>? = null, @ProtoNumber(1) @JvmField val msg: List<MsgComm.Msg>? = null,
@ProtoId(2) @JvmField val pbItemList: List<MsgTransmit.PbMultiMsgItem>? = null @ProtoNumber(2) @JvmField val pbItemList: List<MsgTransmit.PbMultiMsgItem>? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -10,72 +10,72 @@ import kotlin.jvm.JvmField
internal class MultiMsg : ProtoBuf { internal class MultiMsg : ProtoBuf {
@Serializable @Serializable
internal class ExternMsg( internal class ExternMsg(
@ProtoId(1) @JvmField val channelType: Int = 0 @ProtoNumber(1) @JvmField val channelType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MultiMsgApplyDownReq( internal class MultiMsgApplyDownReq(
@ProtoId(1) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val msgType: Int = 0, @ProtoNumber(2) @JvmField val msgType: Int = 0,
@ProtoId(3) @JvmField val srcUin: Long = 0L @ProtoNumber(3) @JvmField val srcUin: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MultiMsgApplyDownRsp( internal class MultiMsgApplyDownRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val thumbDownPara: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val msgKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val msgKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val uint32DownIp: List<Int>? = null, @ProtoNumber(4) @JvmField val uint32DownIp: List<Int>? = null,
@ProtoId(5) @JvmField val uint32DownPort: List<Int>? = null, @ProtoNumber(5) @JvmField val uint32DownPort: List<Int>? = null,
@ProtoId(6) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val msgExternInfo: ExternMsg? = null, @ProtoNumber(7) @JvmField val msgExternInfo: ExternMsg? = null,
@ProtoId(8) @JvmField val bytesDownIpV6: List<ByteArray>? = null, @ProtoNumber(8) @JvmField val bytesDownIpV6: List<ByteArray>? = null,
@ProtoId(9) @JvmField val uint32DownV6Port: List<Int>? = null @ProtoNumber(9) @JvmField val uint32DownV6Port: List<Int>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MultiMsgApplyUpReq( internal class MultiMsgApplyUpReq(
@ProtoId(1) @JvmField val dstUin: Long = 0L, @ProtoNumber(1) @JvmField val dstUin: Long = 0L,
@ProtoId(2) @JvmField val msgSize: Long = 0L, @ProtoNumber(2) @JvmField val msgSize: Long = 0L,
@ProtoId(3) @JvmField val msgMd5: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val msgMd5: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val msgType: Int = 0, @ProtoNumber(4) @JvmField val msgType: Int = 0,
@ProtoId(5) @JvmField val applyId: Int = 0 @ProtoNumber(5) @JvmField val applyId: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MultiMsgApplyUpRsp( internal class MultiMsgApplyUpRsp(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val msgResid: String = "", @ProtoNumber(2) @JvmField val msgResid: String = "",
@ProtoId(3) @JvmField val msgUkey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val msgUkey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val uint32UpIp: List<Int> = listOf(), @ProtoNumber(4) @JvmField val uint32UpIp: List<Int> = listOf(),
@ProtoId(5) @JvmField val uint32UpPort: List<Int> = listOf(), @ProtoNumber(5) @JvmField val uint32UpPort: List<Int> = listOf(),
@ProtoId(6) @JvmField val blockSize: Long = 0L, @ProtoNumber(6) @JvmField val blockSize: Long = 0L,
@ProtoId(7) @JvmField val upOffset: Long = 0L, @ProtoNumber(7) @JvmField val upOffset: Long = 0L,
@ProtoId(8) @JvmField val applyId: Int = 0, @ProtoNumber(8) @JvmField val applyId: Int = 0,
@ProtoId(9) @JvmField val msgKey: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val msgKey: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val msgSig: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val msgSig: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val msgExternInfo: ExternMsg? = null, @ProtoNumber(11) @JvmField val msgExternInfo: ExternMsg? = null,
@ProtoId(12) @JvmField val bytesUpIpV6: List<ByteArray>? = null, @ProtoNumber(12) @JvmField val bytesUpIpV6: List<ByteArray>? = null,
@ProtoId(13) @JvmField val uint32UpV6Port: List<Int>? = null @ProtoNumber(13) @JvmField val uint32UpV6Port: List<Int>? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, @ProtoNumber(1) @JvmField val subcmd: Int = 0,
@ProtoId(2) @JvmField val termType: Int = 0, @ProtoNumber(2) @JvmField val termType: Int = 0,
@ProtoId(3) @JvmField val platformType: Int = 0, @ProtoNumber(3) @JvmField val platformType: Int = 0,
@ProtoId(4) @JvmField val netType: Int = 0, @ProtoNumber(4) @JvmField val netType: Int = 0,
@ProtoId(5) @JvmField val buildVer: String = "", @ProtoNumber(5) @JvmField val buildVer: String = "",
@ProtoId(6) @JvmField val multimsgApplyupReq: List<MultiMsg.MultiMsgApplyUpReq>? = null, @ProtoNumber(6) @JvmField val multimsgApplyupReq: List<MultiMsg.MultiMsgApplyUpReq>? = null,
@ProtoId(7) @JvmField val multimsgApplydownReq: List<MultiMsg.MultiMsgApplyDownReq>? = null, @ProtoNumber(7) @JvmField val multimsgApplydownReq: List<MultiMsg.MultiMsgApplyDownReq>? = null,
@ProtoId(8) @JvmField val buType: Int = 0, @ProtoNumber(8) @JvmField val buType: Int = 0,
@ProtoId(9) @JvmField val reqChannelType: Int = 0 @ProtoNumber(9) @JvmField val reqChannelType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val subcmd: Int = 0, @ProtoNumber(1) @JvmField val subcmd: Int = 0,
@ProtoId(2) @JvmField val multimsgApplyupRsp: List<MultiMsg.MultiMsgApplyUpRsp>? = null, @ProtoNumber(2) @JvmField val multimsgApplyupRsp: List<MultiMsg.MultiMsgApplyUpRsp>? = null,
@ProtoId(3) @JvmField val multimsgApplydownRsp: List<MultiMsg.MultiMsgApplyDownRsp>? = null @ProtoNumber(3) @JvmField val multimsgApplydownRsp: List<MultiMsg.MultiMsgApplyDownRsp>? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,14 +1,14 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
class Oidb0x769 { internal class Oidb0x769 {
@Serializable @Serializable
internal class RequestBody( internal class RequestBody(
@ProtoId(1) @JvmField val rpt_config_list: List<ConfigSeq> @ProtoNumber(1) @JvmField val rpt_config_list: List<ConfigSeq>
// @SerialId(2) @JvmField val msg_device_info: DeviceInfo, // @SerialId(2) @JvmField val msg_device_info: DeviceInfo,
// @SerialId(3) @JvmField val str_info: String = "", // @SerialId(3) @JvmField val str_info: String = "",
// @SerialId(4) @JvmField val province: String, // @SerialId(4) @JvmField val province: String,
@@ -18,70 +18,70 @@ internal class RequestBody(
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class QueryUinPackageUsageReq( internal class QueryUinPackageUsageReq(
@ProtoId(1) @JvmField val type: Int, @ProtoNumber(1) @JvmField val type: Int,
@ProtoId(2) @JvmField val uinFileSize: Long = 0 @ProtoNumber(2) @JvmField val uinFileSize: Long = 0
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ConfigSeq( internal class ConfigSeq(
@ProtoId(1) @JvmField val type: Int, // uint @ProtoNumber(1) @JvmField val type: Int, // uint
@ProtoId(2) @JvmField val version: Int // uint @ProtoNumber(2) @JvmField val version: Int // uint
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class DeviceInfo( internal class DeviceInfo(
@ProtoId(1) @JvmField val brand: String, @ProtoNumber(1) @JvmField val brand: String,
@ProtoId(2) @JvmField val model: String @ProtoNumber(2) @JvmField val model: String
//@SerialId(3) @JvmField val os: OS, //@SerialId(3) @JvmField val os: OS,
//@SerialId(4) @JvmField val cpu: CPU, //@SerialId(4) @JvmField val cpu: CPU,
//@SerialId(5) @JvmField val memory: Memory, //@SerialId(5) @JvmField val memory: Memory,
//@SerialId(6) @JvmField val storage: Storage, //@SerialId(6) @JvmField val storage: Storage,
//@SerialId(7) @JvmField val screen: Screen, //@SerialId(7) @JvmField val screen: Screen,
//@SerialId(8) @JvmField val camera: Camera //@SerialId(8) @JvmField val camera: Camera
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class OS( internal class OS(
@ProtoId(1) @JvmField val type: Int = 1, @ProtoNumber(1) @JvmField val type: Int = 1,
@ProtoId(2) @JvmField val version: String, @ProtoNumber(2) @JvmField val version: String,
@ProtoId(3) @JvmField val sdk: String, @ProtoNumber(3) @JvmField val sdk: String,
@ProtoId(4) @JvmField val kernel: String, @ProtoNumber(4) @JvmField val kernel: String,
@ProtoId(5) @JvmField val rom: String @ProtoNumber(5) @JvmField val rom: String
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Camera( internal class Camera(
@ProtoId(1) @JvmField val primary: Long, @ProtoNumber(1) @JvmField val primary: Long,
@ProtoId(2) @JvmField val secondary: Long, @ProtoNumber(2) @JvmField val secondary: Long,
@ProtoId(3) @JvmField val flag: Boolean @ProtoNumber(3) @JvmField val flag: Boolean
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class CPU( internal class CPU(
@ProtoId(1) @JvmField val model: String, @ProtoNumber(1) @JvmField val model: String,
@ProtoId(2) @JvmField val frequency: Int, @ProtoNumber(2) @JvmField val frequency: Int,
@ProtoId(3) @JvmField val cores: Int @ProtoNumber(3) @JvmField val cores: Int
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Memory( internal class Memory(
@ProtoId(1) @JvmField val total: Int, @ProtoNumber(1) @JvmField val total: Int,
@ProtoId(2) @JvmField val process: Int @ProtoNumber(2) @JvmField val process: Int
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Screen( internal class Screen(
@ProtoId(1) @JvmField val model: String, @ProtoNumber(1) @JvmField val model: String,
@ProtoId(2) @JvmField val width: Int, @ProtoNumber(2) @JvmField val width: Int,
@ProtoId(3) @JvmField val height: Int, @ProtoNumber(3) @JvmField val height: Int,
@ProtoId(4) @JvmField val dpi: Int, @ProtoNumber(4) @JvmField val dpi: Int,
@ProtoId(5) @JvmField val multiTouch: Boolean @ProtoNumber(5) @JvmField val multiTouch: Boolean
): ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class Storage( internal class Storage(
@ProtoId(1) @JvmField val builtin: Int, @ProtoNumber(1) @JvmField val builtin: Int,
@ProtoId(2) @JvmField val external: Int @ProtoNumber(2) @JvmField val external: Int
): ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -10,11 +10,11 @@ import kotlin.jvm.JvmField
internal class MsgOnlinePush { internal class MsgOnlinePush {
@Serializable @Serializable
internal class PbPushMsg( internal class PbPushMsg(
@ProtoId(1) @JvmField val msg: MsgComm.Msg, @ProtoNumber(1) @JvmField val msg: MsgComm.Msg,
@ProtoId(2) @JvmField val svrip: Int = 0, @ProtoNumber(2) @JvmField val svrip: Int = 0,
@ProtoId(3) @JvmField val pushToken: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val pushToken: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val pingFlag: Int = 0, @ProtoNumber(4) @JvmField val pingFlag: Int = 0,
@ProtoId(9) @JvmField val generalFlag: Int = 0 @ProtoNumber(9) @JvmField val generalFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -22,24 +22,24 @@ internal class MsgOnlinePush {
internal class OnlinePushTrans : ProtoBuf { internal class OnlinePushTrans : ProtoBuf {
@Serializable @Serializable
internal class ExtGroupKeyInfo( internal class ExtGroupKeyInfo(
@ProtoId(1) @JvmField val curMaxSeq: Int = 0, @ProtoNumber(1) @JvmField val curMaxSeq: Int = 0,
@ProtoId(2) @JvmField val curTime: Long = 0L @ProtoNumber(2) @JvmField val curTime: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class PbMsgInfo( internal class PbMsgInfo(
@ProtoId(1) @JvmField val fromUin: Long = 0L, @ProtoNumber(1) @JvmField val fromUin: Long = 0L,
@ProtoId(2) @JvmField val toUin: Long = 0L, @ProtoNumber(2) @JvmField val toUin: Long = 0L,
@ProtoId(3) @JvmField val msgType: Int = 0, @ProtoNumber(3) @JvmField val msgType: Int = 0,
@ProtoId(4) @JvmField val msgSubtype: Int = 0, @ProtoNumber(4) @JvmField val msgSubtype: Int = 0,
@ProtoId(5) @JvmField val msgSeq: Int = 0, @ProtoNumber(5) @JvmField val msgSeq: Int = 0,
@ProtoId(6) @JvmField val msgUid: Long = 0L, @ProtoNumber(6) @JvmField val msgUid: Long = 0L,
@ProtoId(7) @JvmField val msgTime: Int = 0, @ProtoNumber(7) @JvmField val msgTime: Int = 0,
@ProtoId(8) @JvmField val realMsgTime: Int = 0, @ProtoNumber(8) @JvmField val realMsgTime: Int = 0,
@ProtoId(9) @JvmField val nickName: String = "", @ProtoNumber(9) @JvmField val nickName: String = "",
@ProtoId(10) @JvmField val msgData: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val msgData: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val svrIp: Int = 0, @ProtoNumber(11) @JvmField val svrIp: Int = 0,
@ProtoId(12) @JvmField val extGroupKeyInfo: ExtGroupKeyInfo? = null, @ProtoNumber(12) @JvmField val extGroupKeyInfo: ExtGroupKeyInfo? = null,
@ProtoId(17) @JvmField val generalFlag: Int = 0 @ProtoNumber(17) @JvmField val generalFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,68 +9,68 @@ import kotlin.jvm.JvmField
internal class Generalflags : ProtoBuf { internal class Generalflags : ProtoBuf {
@Serializable @Serializable
internal class ResvAttr( internal class ResvAttr(
@ProtoId(1) @JvmField val globalGroupLevel: Int = 0, @ProtoNumber(1) @JvmField val globalGroupLevel: Int = 0,
@ProtoId(2) @JvmField val nearbyCharmLevel: Int = 0, @ProtoNumber(2) @JvmField val nearbyCharmLevel: Int = 0,
@ProtoId(3) @JvmField val redbagMsgSenderUin: Long = 0L, @ProtoNumber(3) @JvmField val redbagMsgSenderUin: Long = 0L,
@ProtoId(4) @JvmField val titleId: Int = 0, @ProtoNumber(4) @JvmField val titleId: Int = 0,
@ProtoId(5) @JvmField val robotMsgFlag: Int = 0, @ProtoNumber(5) @JvmField val robotMsgFlag: Int = 0,
@ProtoId(6) @JvmField val wantGiftSenderUin: Long = 0L, @ProtoNumber(6) @JvmField val wantGiftSenderUin: Long = 0L,
@ProtoId(7) @JvmField val stickerX: Float = 0.0f, @ProtoNumber(7) @JvmField val stickerX: Float = 0.0f,
@ProtoId(8) @JvmField val stickerY: Float = 0.0f, @ProtoNumber(8) @JvmField val stickerY: Float = 0.0f,
@ProtoId(9) @JvmField val stickerWidth: Float = 0.0f, @ProtoNumber(9) @JvmField val stickerWidth: Float = 0.0f,
@ProtoId(10) @JvmField val stickerHeight: Float = 0.0f, @ProtoNumber(10) @JvmField val stickerHeight: Float = 0.0f,
@ProtoId(11) @JvmField val stickerRotate: Int = 0, @ProtoNumber(11) @JvmField val stickerRotate: Int = 0,
@ProtoId(12) @JvmField val stickerHostMsgseq: Long = 0L, @ProtoNumber(12) @JvmField val stickerHostMsgseq: Long = 0L,
@ProtoId(13) @JvmField val stickerHostMsguid: Long = 0L, @ProtoNumber(13) @JvmField val stickerHostMsguid: Long = 0L,
@ProtoId(14) @JvmField val stickerHostTime: Long = 0L, @ProtoNumber(14) @JvmField val stickerHostTime: Long = 0L,
@ProtoId(15) @JvmField val mobileCustomFont: Int = 0, @ProtoNumber(15) @JvmField val mobileCustomFont: Int = 0,
@ProtoId(16) @JvmField val tailKey: Int = 0, @ProtoNumber(16) @JvmField val tailKey: Int = 0,
@ProtoId(17) @JvmField val showTailFlag: Int = 0, @ProtoNumber(17) @JvmField val showTailFlag: Int = 0,
@ProtoId(18) @JvmField val doutuMsgType: Int = 0, @ProtoNumber(18) @JvmField val doutuMsgType: Int = 0,
@ProtoId(19) @JvmField val doutuCombo: Int = 0, @ProtoNumber(19) @JvmField val doutuCombo: Int = 0,
@ProtoId(20) @JvmField val customFeatureid: Int = 0, @ProtoNumber(20) @JvmField val customFeatureid: Int = 0,
@ProtoId(21) @JvmField val goldenMsgType: Int = 0, @ProtoNumber(21) @JvmField val goldenMsgType: Int = 0,
@ProtoId(22) @JvmField val goldenMsgInfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(22) @JvmField val goldenMsgInfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(23) @JvmField val botMessageClassId: Int = 0, @ProtoNumber(23) @JvmField val botMessageClassId: Int = 0,
@ProtoId(24) @JvmField val subscriptionUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(24) @JvmField val subscriptionUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(25) @JvmField val pendantDiyId: Int = 0, @ProtoNumber(25) @JvmField val pendantDiyId: Int = 0,
@ProtoId(26) @JvmField val timedMessage: Int = 0, @ProtoNumber(26) @JvmField val timedMessage: Int = 0,
@ProtoId(27) @JvmField val holidayFlag: Int = 0, @ProtoNumber(27) @JvmField val holidayFlag: Int = 0,
@ProtoId(29) @JvmField val kplInfo: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(29) @JvmField val kplInfo: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(30) @JvmField val faceId: Int = 0, @ProtoNumber(30) @JvmField val faceId: Int = 0,
@ProtoId(31) @JvmField val diyFontTimestamp: Int = 0, @ProtoNumber(31) @JvmField val diyFontTimestamp: Int = 0,
@ProtoId(32) @JvmField val redEnvelopeType: Int = 0, @ProtoNumber(32) @JvmField val redEnvelopeType: Int = 0,
@ProtoId(33) @JvmField val shortVideoId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(33) @JvmField val shortVideoId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(34) @JvmField val reqFontEffectId: Int = 0, @ProtoNumber(34) @JvmField val reqFontEffectId: Int = 0,
@ProtoId(35) @JvmField val loveLanguageFlag: Int = 0, @ProtoNumber(35) @JvmField val loveLanguageFlag: Int = 0,
@ProtoId(36) @JvmField val aioSyncToStoryFlag: Int = 0, @ProtoNumber(36) @JvmField val aioSyncToStoryFlag: Int = 0,
@ProtoId(37) @JvmField val uploadImageToQzoneFlag: Int = 0, @ProtoNumber(37) @JvmField val uploadImageToQzoneFlag: Int = 0,
@ProtoId(39) @JvmField val uploadImageToQzoneParam: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(39) @JvmField val uploadImageToQzoneParam: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(40) @JvmField val groupConfessSig: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(40) @JvmField val groupConfessSig: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(41) @JvmField val subfontId: Long = 0L, @ProtoNumber(41) @JvmField val subfontId: Long = 0L,
@ProtoId(42) @JvmField val msgFlagType: Int = 0, @ProtoNumber(42) @JvmField val msgFlagType: Int = 0,
@ProtoId(43) @JvmField val uint32CustomFeatureid: List<Int>? = null, @ProtoNumber(43) @JvmField val uint32CustomFeatureid: List<Int>? = null,
@ProtoId(44) @JvmField val richCardNameVer: Int = 0, @ProtoNumber(44) @JvmField val richCardNameVer: Int = 0,
@ProtoId(47) @JvmField val msgInfoFlag: Int = 0, @ProtoNumber(47) @JvmField val msgInfoFlag: Int = 0,
@ProtoId(48) @JvmField val serviceMsgType: Int = 0, @ProtoNumber(48) @JvmField val serviceMsgType: Int = 0,
@ProtoId(49) @JvmField val serviceMsgRemindType: Int = 0, @ProtoNumber(49) @JvmField val serviceMsgRemindType: Int = 0,
@ProtoId(50) @JvmField val serviceMsgName: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(50) @JvmField val serviceMsgName: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(51) @JvmField val vipType: Int = 0, @ProtoNumber(51) @JvmField val vipType: Int = 0,
@ProtoId(52) @JvmField val vipLevel: Int = 0, @ProtoNumber(52) @JvmField val vipLevel: Int = 0,
@ProtoId(53) @JvmField val pbPttWaveform: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(53) @JvmField val pbPttWaveform: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(54) @JvmField val userBigclubLevel: Int = 0, @ProtoNumber(54) @JvmField val userBigclubLevel: Int = 0,
@ProtoId(55) @JvmField val userBigclubFlag: Int = 0, @ProtoNumber(55) @JvmField val userBigclubFlag: Int = 0,
@ProtoId(56) @JvmField val nameplate: Int = 0, @ProtoNumber(56) @JvmField val nameplate: Int = 0,
@ProtoId(57) @JvmField val autoReply: Int = 0, @ProtoNumber(57) @JvmField val autoReply: Int = 0,
@ProtoId(58) @JvmField val reqIsBigclubHidden: Int = 0, @ProtoNumber(58) @JvmField val reqIsBigclubHidden: Int = 0,
@ProtoId(59) @JvmField val showInMsgList: Int = 0, @ProtoNumber(59) @JvmField val showInMsgList: Int = 0,
@ProtoId(60) @JvmField val oacMsgExtend: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(60) @JvmField val oacMsgExtend: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(61) @JvmField val groupMemberFlagEx2: Int = 0, @ProtoNumber(61) @JvmField val groupMemberFlagEx2: Int = 0,
@ProtoId(62) @JvmField val groupRingtoneId: Int = 0, @ProtoNumber(62) @JvmField val groupRingtoneId: Int = 0,
@ProtoId(63) @JvmField val robotGeneralTrans: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(63) @JvmField val robotGeneralTrans: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(64) @JvmField val troopPobingTemplate: Int = 0, @ProtoNumber(64) @JvmField val troopPobingTemplate: Int = 0,
@ProtoId(65) @JvmField val hudongMark: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(65) @JvmField val hudongMark: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(66) @JvmField val groupInfoFlagEx3: Int = 0 @ProtoNumber(66) @JvmField val groupInfoFlagEx3: Int = 0
) : ProtoBuf ) : ProtoBuf
} }
@@ -78,27 +78,27 @@ internal class ResvAttr(
internal class ResvAttrForGiftMsg : ProtoBuf { internal class ResvAttrForGiftMsg : ProtoBuf {
@Serializable @Serializable
internal class ActivityGiftInfo( internal class ActivityGiftInfo(
@ProtoId(1) @JvmField val isActivityGift: Int = 0, @ProtoNumber(1) @JvmField val isActivityGift: Int = 0,
@ProtoId(2) @JvmField val textColor: String = "", @ProtoNumber(2) @JvmField val textColor: String = "",
@ProtoId(3) @JvmField val text: String = "", @ProtoNumber(3) @JvmField val text: String = "",
@ProtoId(4) @JvmField val url: String = "" @ProtoNumber(4) @JvmField val url: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class InteractGift( internal class InteractGift(
@ProtoId(1) @JvmField val interactId: ByteArray = EMPTY_BYTE_ARRAY @ProtoNumber(1) @JvmField val interactId: ByteArray = EMPTY_BYTE_ARRAY
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ResvAttr( internal class ResvAttr(
@ProtoId(1) @JvmField val int32SendScore: Int = 0, @ProtoNumber(1) @JvmField val int32SendScore: Int = 0,
@ProtoId(2) @JvmField val int32RecvScore: Int = 0, @ProtoNumber(2) @JvmField val int32RecvScore: Int = 0,
@ProtoId(3) @JvmField val charmHeroism: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val charmHeroism: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val buttonFlag: Int = 0, @ProtoNumber(4) @JvmField val buttonFlag: Int = 0,
@ProtoId(5) @JvmField val objColor: Int = 0, @ProtoNumber(5) @JvmField val objColor: Int = 0,
@ProtoId(6) @JvmField val animationType: Int = 0, @ProtoNumber(6) @JvmField val animationType: Int = 0,
@ProtoId(7) @JvmField val msgInteractGift: InteractGift? = null, @ProtoNumber(7) @JvmField val msgInteractGift: InteractGift? = null,
@ProtoId(8) @JvmField val activityGiftInfo: ActivityGiftInfo? = null @ProtoNumber(8) @JvmField val activityGiftInfo: ActivityGiftInfo? = null
) : ProtoBuf ) : ProtoBuf
} }
@@ -106,9 +106,9 @@ internal class ResvAttr(
internal class SourceMsg : ProtoBuf { internal class SourceMsg : ProtoBuf {
@Serializable @Serializable
internal class ResvAttr( internal class ResvAttr(
@ProtoId(1) @JvmField val richMsg2: ByteArray? = null, @ProtoNumber(1) @JvmField val richMsg2: ByteArray? = null,
@ProtoId(2) @JvmField val oriMsgtype: Int? = null, @ProtoNumber(2) @JvmField val oriMsgtype: Int? = null,
@ProtoId(3) @JvmField val origUids: Long? = null // 原来是 list @ProtoNumber(3) @JvmField val origUids: Long? = null // 原来是 list
) : ProtoBuf ) : ProtoBuf
} }
@@ -116,17 +116,17 @@ internal class ResvAttr(
internal class VideoFile : ProtoBuf { internal class VideoFile : ProtoBuf {
@Serializable @Serializable
internal class ResvAttr( internal class ResvAttr(
@ProtoId(1) @JvmField val hotvideoIcon: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(1) @JvmField val hotvideoIcon: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(2) @JvmField val hotvideoTitle: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(2) @JvmField val hotvideoTitle: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(3) @JvmField val hotvideoUrl: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val hotvideoUrl: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(4) @JvmField val hotvideoIconSub: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val hotvideoIconSub: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(5) @JvmField val specialVideoType: Int = 0, @ProtoNumber(5) @JvmField val specialVideoType: Int = 0,
@ProtoId(6) @JvmField val dynamicText: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(6) @JvmField val dynamicText: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(7) @JvmField val msgTailType: Int = 0, @ProtoNumber(7) @JvmField val msgTailType: Int = 0,
@ProtoId(8) @JvmField val redEnvelopeType: Int = 0, @ProtoNumber(8) @JvmField val redEnvelopeType: Int = 0,
@ProtoId(9) @JvmField val shortVideoId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val shortVideoId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val animojiModelId: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(10) @JvmField val animojiModelId: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(11) @JvmField val longVideoKandianType: Int = 0, @ProtoNumber(11) @JvmField val longVideoKandianType: Int = 0,
@ProtoId(12) @JvmField val source: Int = 0 @ProtoNumber(12) @JvmField val source: Int = 0
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,30 +1,30 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
class StatSvcGetOnline { internal class StatSvcGetOnline {
@Serializable @Serializable
internal class Instance( internal class Instance(
@ProtoId(1) @JvmField val instanceId: Int = 0, @ProtoNumber(1) @JvmField val instanceId: Int = 0,
@ProtoId(2) @JvmField val clientType: Int = 0 @ProtoNumber(2) @JvmField val clientType: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqBody( internal class ReqBody(
@ProtoId(1) @JvmField val uin: Long = 0L, @ProtoNumber(1) @JvmField val uin: Long = 0L,
@ProtoId(2) @JvmField val appid: Int = 0 @ProtoNumber(2) @JvmField val appid: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspBody( internal class RspBody(
@ProtoId(1) @JvmField val errorCode: Int = 0, @ProtoNumber(1) @JvmField val errorCode: Int = 0,
@ProtoId(2) @JvmField val errorMsg: String = "", @ProtoNumber(2) @JvmField val errorMsg: String = "",
@ProtoId(3) @JvmField val uin: Long = 0L, @ProtoNumber(3) @JvmField val uin: Long = 0L,
@ProtoId(4) @JvmField val appid: Int = 0, @ProtoNumber(4) @JvmField val appid: Int = 0,
@ProtoId(5) @JvmField val timeInterval: Int = 0, @ProtoNumber(5) @JvmField val timeInterval: Int = 0,
@ProtoId(6) @JvmField val msgInstances: List<StatSvcGetOnline.Instance>? = null @ProtoNumber(6) @JvmField val msgInstances: List<StatSvcGetOnline.Instance>? = null
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,7 +1,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
@@ -9,289 +9,289 @@ import kotlin.jvm.JvmField
internal class QPayReminderMsg : ProtoBuf { internal class QPayReminderMsg : ProtoBuf {
@Serializable @Serializable
internal class GetInfoReq( internal class GetInfoReq(
@ProtoId(1) @JvmField val scene: String = "", @ProtoNumber(1) @JvmField val scene: String = "",
@ProtoId(2) @JvmField val subCmd: String = "", @ProtoNumber(2) @JvmField val subCmd: String = "",
@ProtoId(3) @JvmField val infoDate: String = "" @ProtoNumber(3) @JvmField val infoDate: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GetInfoRsp( internal class GetInfoRsp(
@ProtoId(1) @JvmField val resultCode: Int = 0, @ProtoNumber(1) @JvmField val resultCode: Int = 0,
@ProtoId(2) @JvmField val resultInfo: String = "", @ProtoNumber(2) @JvmField val resultInfo: String = "",
@ProtoId(3) @JvmField val urgency: Int = 0, @ProtoNumber(3) @JvmField val urgency: Int = 0,
@ProtoId(4) @JvmField val templateNo: Int = 0, @ProtoNumber(4) @JvmField val templateNo: Int = 0,
@ProtoId(5) @JvmField val content: String = "", @ProtoNumber(5) @JvmField val content: String = "",
@ProtoId(6) @JvmField val infoDate: String = "" @ProtoNumber(6) @JvmField val infoDate: String = ""
) : ProtoBuf ) : ProtoBuf
} }
internal class Structmsg : ProtoBuf { internal class Structmsg : ProtoBuf {
@Serializable @Serializable
internal class AddFrdSNInfo( internal class AddFrdSNInfo(
@ProtoId(1) @JvmField val notSeeDynamic: Int = 0, @ProtoNumber(1) @JvmField val notSeeDynamic: Int = 0,
@ProtoId(2) @JvmField val setSn: Int = 0 @ProtoNumber(2) @JvmField val setSn: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FlagInfo( internal class FlagInfo(
@ProtoId(1) @JvmField val grpMsgKickAdmin: Int = 0, @ProtoNumber(1) @JvmField val grpMsgKickAdmin: Int = 0,
@ProtoId(2) @JvmField val grpMsgHiddenGrp: Int = 0, @ProtoNumber(2) @JvmField val grpMsgHiddenGrp: Int = 0,
@ProtoId(3) @JvmField val grpMsgWordingDown: Int = 0, @ProtoNumber(3) @JvmField val grpMsgWordingDown: Int = 0,
@ProtoId(4) @JvmField val frdMsgGetBusiCard: Int = 0, @ProtoNumber(4) @JvmField val frdMsgGetBusiCard: Int = 0,
@ProtoId(5) @JvmField val grpMsgGetOfficialAccount: Int = 0, @ProtoNumber(5) @JvmField val grpMsgGetOfficialAccount: Int = 0,
@ProtoId(6) @JvmField val grpMsgGetPayInGroup: Int = 0, @ProtoNumber(6) @JvmField val grpMsgGetPayInGroup: Int = 0,
@ProtoId(7) @JvmField val frdMsgDiscuss2ManyChat: Int = 0, @ProtoNumber(7) @JvmField val frdMsgDiscuss2ManyChat: Int = 0,
@ProtoId(8) @JvmField val grpMsgNotAllowJoinGrpInviteNotFrd: Int = 0, @ProtoNumber(8) @JvmField val grpMsgNotAllowJoinGrpInviteNotFrd: Int = 0,
@ProtoId(9) @JvmField val frdMsgNeedWaitingMsg: Int = 0, @ProtoNumber(9) @JvmField val frdMsgNeedWaitingMsg: Int = 0,
@ProtoId(10) @JvmField val frdMsgUint32NeedAllUnreadMsg: Int = 0, @ProtoNumber(10) @JvmField val frdMsgUint32NeedAllUnreadMsg: Int = 0,
@ProtoId(11) @JvmField val grpMsgNeedAutoAdminWording: Int = 0, @ProtoNumber(11) @JvmField val grpMsgNeedAutoAdminWording: Int = 0,
@ProtoId(12) @JvmField val grpMsgGetTransferGroupMsgFlag: Int = 0, @ProtoNumber(12) @JvmField val grpMsgGetTransferGroupMsgFlag: Int = 0,
@ProtoId(13) @JvmField val grpMsgGetQuitPayGroupMsgFlag: Int = 0, @ProtoNumber(13) @JvmField val grpMsgGetQuitPayGroupMsgFlag: Int = 0,
@ProtoId(14) @JvmField val grpMsgSupportInviteAutoJoin: Int = 0, @ProtoNumber(14) @JvmField val grpMsgSupportInviteAutoJoin: Int = 0,
@ProtoId(15) @JvmField val grpMsgMaskInviteAutoJoin: Int = 0, @ProtoNumber(15) @JvmField val grpMsgMaskInviteAutoJoin: Int = 0,
@ProtoId(16) @JvmField val grpMsgGetDisbandedByAdmin: Int = 0, @ProtoNumber(16) @JvmField val grpMsgGetDisbandedByAdmin: Int = 0,
@ProtoId(17) @JvmField val grpMsgGetC2cInviteJoinGroup: Int = 0 @ProtoNumber(17) @JvmField val grpMsgGetC2cInviteJoinGroup: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class FriendInfo( internal class FriendInfo(
@ProtoId(1) @JvmField val msgJointFriend: String = "", @ProtoNumber(1) @JvmField val msgJointFriend: String = "",
@ProtoId(2) @JvmField val msgBlacklist: String = "" @ProtoNumber(2) @JvmField val msgBlacklist: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class GroupInfo( internal class GroupInfo(
@ProtoId(1) @JvmField val groupAuthType: Int = 0, @ProtoNumber(1) @JvmField val groupAuthType: Int = 0,
@ProtoId(2) @JvmField val displayAction: Int = 0, @ProtoNumber(2) @JvmField val displayAction: Int = 0,
@ProtoId(3) @JvmField val msgAlert: String = "", @ProtoNumber(3) @JvmField val msgAlert: String = "",
@ProtoId(4) @JvmField val msgDetailAlert: String = "", @ProtoNumber(4) @JvmField val msgDetailAlert: String = "",
@ProtoId(5) @JvmField val msgOtherAdminDone: String = "", @ProtoNumber(5) @JvmField val msgOtherAdminDone: String = "",
@ProtoId(6) @JvmField val appPrivilegeFlag: Int = 0 @ProtoNumber(6) @JvmField val appPrivilegeFlag: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgInviteExt( internal class MsgInviteExt(
@ProtoId(1) @JvmField val srcType: Int = 0, @ProtoNumber(1) @JvmField val srcType: Int = 0,
@ProtoId(2) @JvmField val srcCode: Long = 0L, @ProtoNumber(2) @JvmField val srcCode: Long = 0L,
@ProtoId(3) @JvmField val waitState: Int = 0 @ProtoNumber(3) @JvmField val waitState: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class MsgPayGroupExt( internal class MsgPayGroupExt(
@ProtoId(1) @JvmField val joinGrpTime: Long = 0L, @ProtoNumber(1) @JvmField val joinGrpTime: Long = 0L,
@ProtoId(2) @JvmField val quitGrpTime: Long = 0L @ProtoNumber(2) @JvmField val quitGrpTime: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqNextSystemMsg( internal class ReqNextSystemMsg(
@ProtoId(1) @JvmField val msgNum: Int = 0, @ProtoNumber(1) @JvmField val msgNum: Int = 0,
@ProtoId(2) @JvmField val followingFriendSeq: Long = 0L, @ProtoNumber(2) @JvmField val followingFriendSeq: Long = 0L,
@ProtoId(3) @JvmField val followingGroupSeq: Long = 0L, @ProtoNumber(3) @JvmField val followingGroupSeq: Long = 0L,
@ProtoId(4) @JvmField val checktype: Int /* enum */ = 1, @ProtoNumber(4) @JvmField val checktype: Int /* enum */ = 1,
@ProtoId(5) @JvmField val flag: FlagInfo? = null, @ProtoNumber(5) @JvmField val flag: FlagInfo? = null,
@ProtoId(6) @JvmField val language: Int = 0, @ProtoNumber(6) @JvmField val language: Int = 0,
@ProtoId(7) @JvmField val version: Int = 0, @ProtoNumber(7) @JvmField val version: Int = 0,
@ProtoId(8) @JvmField val friendMsgTypeFlag: Long = 0L @ProtoNumber(8) @JvmField val friendMsgTypeFlag: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqSystemMsg( internal class ReqSystemMsg(
@ProtoId(1) @JvmField val msgNum: Int = 0, @ProtoNumber(1) @JvmField val msgNum: Int = 0,
@ProtoId(2) @JvmField val latestFriendSeq: Long = 0L, @ProtoNumber(2) @JvmField val latestFriendSeq: Long = 0L,
@ProtoId(3) @JvmField val latestGroupSeq: Long = 0L, @ProtoNumber(3) @JvmField val latestGroupSeq: Long = 0L,
@ProtoId(4) @JvmField val version: Int = 0, @ProtoNumber(4) @JvmField val version: Int = 0,
@ProtoId(5) @JvmField val language: Int = 0 @ProtoNumber(5) @JvmField val language: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqSystemMsgAction( internal class ReqSystemMsgAction(
@ProtoId(1) @JvmField val msgType: Int /* enum */ = 1, @ProtoNumber(1) @JvmField val msgType: Int /* enum */ = 1,
@ProtoId(2) @JvmField val msgSeq: Long = 0L, @ProtoNumber(2) @JvmField val msgSeq: Long = 0L,
@ProtoId(3) @JvmField val reqUin: Long = 0L, @ProtoNumber(3) @JvmField val reqUin: Long = 0L,
@ProtoId(4) @JvmField val subType: Int = 0, @ProtoNumber(4) @JvmField val subType: Int = 0,
@ProtoId(5) @JvmField val srcId: Int = 0, @ProtoNumber(5) @JvmField val srcId: Int = 0,
@ProtoId(6) @JvmField val subSrcId: Int = 0, @ProtoNumber(6) @JvmField val subSrcId: Int = 0,
@ProtoId(7) @JvmField val groupMsgType: Int = 0, @ProtoNumber(7) @JvmField val groupMsgType: Int = 0,
@ProtoId(8) @JvmField val actionInfo: SystemMsgActionInfo? = null, @ProtoNumber(8) @JvmField val actionInfo: SystemMsgActionInfo? = null,
@ProtoId(9) @JvmField val language: Int = 0 @ProtoNumber(9) @JvmField val language: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqSystemMsgNew( internal class ReqSystemMsgNew(
@ProtoId(1) @JvmField val msgNum: Int = 0, @ProtoNumber(1) @JvmField val msgNum: Int = 0,
@ProtoId(2) @JvmField val latestFriendSeq: Long = 0L, @ProtoNumber(2) @JvmField val latestFriendSeq: Long = 0L,
@ProtoId(3) @JvmField val latestGroupSeq: Long = 0L, @ProtoNumber(3) @JvmField val latestGroupSeq: Long = 0L,
@ProtoId(4) @JvmField val version: Int = 0, @ProtoNumber(4) @JvmField val version: Int = 0,
@ProtoId(5) @JvmField val checktype: Int /* enum */ = 1, @ProtoNumber(5) @JvmField val checktype: Int /* enum */ = 1,
@ProtoId(6) @JvmField val flag: FlagInfo? = null, @ProtoNumber(6) @JvmField val flag: FlagInfo? = null,
@ProtoId(7) @JvmField val language: Int = 0, @ProtoNumber(7) @JvmField val language: Int = 0,
@ProtoId(8) @JvmField val isGetFrdRibbon: Boolean = true, @ProtoNumber(8) @JvmField val isGetFrdRibbon: Boolean = true,
@ProtoId(9) @JvmField val isGetGrpRibbon: Boolean = true, @ProtoNumber(9) @JvmField val isGetGrpRibbon: Boolean = true,
@ProtoId(10) @JvmField val friendMsgTypeFlag: Long = 0L @ProtoNumber(10) @JvmField val friendMsgTypeFlag: Long = 0L
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class ReqSystemMsgRead( internal class ReqSystemMsgRead(
@ProtoId(1) @JvmField val latestFriendSeq: Long = 0L, @ProtoNumber(1) @JvmField val latestFriendSeq: Long = 0L,
@ProtoId(2) @JvmField val latestGroupSeq: Long = 0L, @ProtoNumber(2) @JvmField val latestGroupSeq: Long = 0L,
@ProtoId(3) @JvmField val type: Int = 0, @ProtoNumber(3) @JvmField val type: Int = 0,
@ProtoId(4) @JvmField val checktype: Int /* enum */ = 1 @ProtoNumber(4) @JvmField val checktype: Int /* enum */ = 1
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspHead( internal class RspHead(
@ProtoId(1) @JvmField val result: Int = 0, @ProtoNumber(1) @JvmField val result: Int = 0,
@ProtoId(2) @JvmField val msgFail: String = "" @ProtoNumber(2) @JvmField val msgFail: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspNextSystemMsg( internal class RspNextSystemMsg(
@ProtoId(1) @JvmField val head: RspHead? = null, @ProtoNumber(1) @JvmField val head: RspHead? = null,
@ProtoId(2) @JvmField val msgs: List<StructMsg>? = null, @ProtoNumber(2) @JvmField val msgs: List<StructMsg>? = null,
@ProtoId(3) @JvmField val followingFriendSeq: Long = 0L, @ProtoNumber(3) @JvmField val followingFriendSeq: Long = 0L,
@ProtoId(4) @JvmField val followingGroupSeq: Long = 0L, @ProtoNumber(4) @JvmField val followingGroupSeq: Long = 0L,
@ProtoId(5) @JvmField val checktype: Int /* enum */ = 1, @ProtoNumber(5) @JvmField val checktype: Int /* enum */ = 1,
@ProtoId(100) @JvmField val gameNick: String = "", @ProtoNumber(100) @JvmField val gameNick: String = "",
@ProtoId(101) @JvmField val undecidForQim: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(101) @JvmField val undecidForQim: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(102) @JvmField val unReadCount3: Int = 0 @ProtoNumber(102) @JvmField val unReadCount3: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspSystemMsg( internal class RspSystemMsg(
@ProtoId(1) @JvmField val head: RspHead? = null, @ProtoNumber(1) @JvmField val head: RspHead? = null,
@ProtoId(2) @JvmField val msgs: List<StructMsg>? = null, @ProtoNumber(2) @JvmField val msgs: List<StructMsg>? = null,
@ProtoId(3) @JvmField val unreadCount: Int = 0, @ProtoNumber(3) @JvmField val unreadCount: Int = 0,
@ProtoId(4) @JvmField val latestFriendSeq: Long = 0L, @ProtoNumber(4) @JvmField val latestFriendSeq: Long = 0L,
@ProtoId(5) @JvmField val latestGroupSeq: Long = 0L, @ProtoNumber(5) @JvmField val latestGroupSeq: Long = 0L,
@ProtoId(6) @JvmField val followingFriendSeq: Long = 0L, @ProtoNumber(6) @JvmField val followingFriendSeq: Long = 0L,
@ProtoId(7) @JvmField val followingGroupSeq: Long = 0L, @ProtoNumber(7) @JvmField val followingGroupSeq: Long = 0L,
@ProtoId(8) @JvmField val msgDisplay: String = "" @ProtoNumber(8) @JvmField val msgDisplay: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspSystemMsgAction( internal class RspSystemMsgAction(
@ProtoId(1) @JvmField val head: RspHead? = null, @ProtoNumber(1) @JvmField val head: RspHead? = null,
@ProtoId(2) @JvmField val msgDetail: String = "", @ProtoNumber(2) @JvmField val msgDetail: String = "",
@ProtoId(3) @JvmField val type: Int = 0, @ProtoNumber(3) @JvmField val type: Int = 0,
@ProtoId(5) @JvmField val msgInvalidDecided: String = "", @ProtoNumber(5) @JvmField val msgInvalidDecided: String = "",
@ProtoId(6) @JvmField val remarkResult: Int = 0 @ProtoNumber(6) @JvmField val remarkResult: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspSystemMsgNew( internal class RspSystemMsgNew(
@ProtoId(1) @JvmField val head: RspHead? = null, @ProtoNumber(1) @JvmField val head: RspHead? = null,
@ProtoId(2) @JvmField val unreadFriendCount: Int = 0, @ProtoNumber(2) @JvmField val unreadFriendCount: Int = 0,
@ProtoId(3) @JvmField val unreadGroupCount: Int = 0, @ProtoNumber(3) @JvmField val unreadGroupCount: Int = 0,
@ProtoId(4) @JvmField val latestFriendSeq: Long = 0L, @ProtoNumber(4) @JvmField val latestFriendSeq: Long = 0L,
@ProtoId(5) @JvmField val latestGroupSeq: Long = 0L, @ProtoNumber(5) @JvmField val latestGroupSeq: Long = 0L,
@ProtoId(6) @JvmField val followingFriendSeq: Long = 0L, @ProtoNumber(6) @JvmField val followingFriendSeq: Long = 0L,
@ProtoId(7) @JvmField val followingGroupSeq: Long = 0L, @ProtoNumber(7) @JvmField val followingGroupSeq: Long = 0L,
@ProtoId(9) @JvmField val friendmsgs: List<StructMsg>? = null, @ProtoNumber(9) @JvmField val friendmsgs: List<StructMsg>? = null,
@ProtoId(10) @JvmField val groupmsgs: List<StructMsg>? = null, @ProtoNumber(10) @JvmField val groupmsgs: List<StructMsg>? = null,
@ProtoId(11) @JvmField val msgRibbonFriend: StructMsg? = null, @ProtoNumber(11) @JvmField val msgRibbonFriend: StructMsg? = null,
@ProtoId(12) @JvmField val msgRibbonGroup: StructMsg? = null, @ProtoNumber(12) @JvmField val msgRibbonGroup: StructMsg? = null,
@ProtoId(13) @JvmField val msgDisplay: String = "", @ProtoNumber(13) @JvmField val msgDisplay: String = "",
@ProtoId(14) @JvmField val grpMsgDisplay: String = "", @ProtoNumber(14) @JvmField val grpMsgDisplay: String = "",
@ProtoId(15) @JvmField val over: Int = 0, @ProtoNumber(15) @JvmField val over: Int = 0,
@ProtoId(20) @JvmField val checktype: Int /* enum */ = 1, @ProtoNumber(20) @JvmField val checktype: Int /* enum */ = 1,
@ProtoId(100) @JvmField val gameNick: String = "", @ProtoNumber(100) @JvmField val gameNick: String = "",
@ProtoId(101) @JvmField val undecidForQim: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(101) @JvmField val undecidForQim: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(102) @JvmField val unReadCount3: Int = 0 @ProtoNumber(102) @JvmField val unReadCount3: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class RspSystemMsgRead( internal class RspSystemMsgRead(
@ProtoId(1) @JvmField val head: RspHead? = null, @ProtoNumber(1) @JvmField val head: RspHead? = null,
@ProtoId(2) @JvmField val type: Int = 0, @ProtoNumber(2) @JvmField val type: Int = 0,
@ProtoId(3) @JvmField val checktype: Int /* enum */ = 1 @ProtoNumber(3) @JvmField val checktype: Int /* enum */ = 1
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class StructMsg( internal class StructMsg(
@ProtoId(1) @JvmField val version: Int = 0, @ProtoNumber(1) @JvmField val version: Int = 0,
@ProtoId(2) @JvmField val msgType: Int /* enum */ = 1, @ProtoNumber(2) @JvmField val msgType: Int /* enum */ = 1,
@ProtoId(3) @JvmField val msgSeq: Long = 0L, @ProtoNumber(3) @JvmField val msgSeq: Long = 0L,
@ProtoId(4) @JvmField val msgTime: Long = 0L, @ProtoNumber(4) @JvmField val msgTime: Long = 0L,
@ProtoId(5) @JvmField val reqUin: Long = 0L, @ProtoNumber(5) @JvmField val reqUin: Long = 0L,
@ProtoId(6) @JvmField val unreadFlag: Int = 0, @ProtoNumber(6) @JvmField val unreadFlag: Int = 0,
@ProtoId(50) @JvmField val msg: SystemMsg? = null @ProtoNumber(50) @JvmField val msg: SystemMsg? = null
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SystemMsg( internal class SystemMsg(
@ProtoId(1) @JvmField val subType: Int = 0, @ProtoNumber(1) @JvmField val subType: Int = 0,
@ProtoId(2) @JvmField val msgTitle: String = "", @ProtoNumber(2) @JvmField val msgTitle: String = "",
@ProtoId(3) @JvmField val msgDescribe: String = "", @ProtoNumber(3) @JvmField val msgDescribe: String = "",
@ProtoId(4) @JvmField val msgAdditional: String = "", @ProtoNumber(4) @JvmField val msgAdditional: String = "",
@ProtoId(5) @JvmField val msgSource: String = "", @ProtoNumber(5) @JvmField val msgSource: String = "",
@ProtoId(6) @JvmField val msgDecided: String = "", @ProtoNumber(6) @JvmField val msgDecided: String = "",
@ProtoId(7) @JvmField val srcId: Int = 0, @ProtoNumber(7) @JvmField val srcId: Int = 0,
@ProtoId(8) @JvmField val subSrcId: Int = 0, @ProtoNumber(8) @JvmField val subSrcId: Int = 0,
@ProtoId(9) @JvmField val actions: List<SystemMsgAction>? = null, @ProtoNumber(9) @JvmField val actions: List<SystemMsgAction>? = null,
@ProtoId(10) @JvmField val groupCode: Long = 0L, @ProtoNumber(10) @JvmField val groupCode: Long = 0L,
@ProtoId(11) @JvmField val actionUin: Long = 0L, @ProtoNumber(11) @JvmField val actionUin: Long = 0L,
@ProtoId(12) @JvmField val groupMsgType: Int = 0, @ProtoNumber(12) @JvmField val groupMsgType: Int = 0,
@ProtoId(13) @JvmField val groupInviterRole: Int = 0, @ProtoNumber(13) @JvmField val groupInviterRole: Int = 0,
@ProtoId(14) @JvmField val friendInfo: FriendInfo? = null, @ProtoNumber(14) @JvmField val friendInfo: FriendInfo? = null,
@ProtoId(15) @JvmField val groupInfo: GroupInfo? = null, @ProtoNumber(15) @JvmField val groupInfo: GroupInfo? = null,
@ProtoId(16) @JvmField val actorUin: Long = 0L, @ProtoNumber(16) @JvmField val actorUin: Long = 0L,
@ProtoId(17) @JvmField val msgActorDescribe: String = "", @ProtoNumber(17) @JvmField val msgActorDescribe: String = "",
@ProtoId(18) @JvmField val msgAdditionalList: String = "", @ProtoNumber(18) @JvmField val msgAdditionalList: String = "",
@ProtoId(19) @JvmField val relation: Int = 0, @ProtoNumber(19) @JvmField val relation: Int = 0,
@ProtoId(20) @JvmField val reqsubtype: Int = 0, @ProtoNumber(20) @JvmField val reqsubtype: Int = 0,
@ProtoId(21) @JvmField val cloneUin: Long = 0L, @ProtoNumber(21) @JvmField val cloneUin: Long = 0L,
@ProtoId(22) @JvmField val discussUin: Long = 0L, @ProtoNumber(22) @JvmField val discussUin: Long = 0L,
@ProtoId(23) @JvmField val eimGroupId: Long = 0L, @ProtoNumber(23) @JvmField val eimGroupId: Long = 0L,
@ProtoId(24) @JvmField val msgInviteExtinfo: MsgInviteExt? = null, @ProtoNumber(24) @JvmField val msgInviteExtinfo: MsgInviteExt? = null,
@ProtoId(25) @JvmField val msgPayGroupExtinfo: MsgPayGroupExt? = null, @ProtoNumber(25) @JvmField val msgPayGroupExtinfo: MsgPayGroupExt? = null,
@ProtoId(26) @JvmField val sourceFlag: Int = 0, @ProtoNumber(26) @JvmField val sourceFlag: Int = 0,
@ProtoId(27) @JvmField val gameNick: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(27) @JvmField val gameNick: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(28) @JvmField val gameMsg: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(28) @JvmField val gameMsg: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(29) @JvmField val groupFlagext3: Int = 0, @ProtoNumber(29) @JvmField val groupFlagext3: Int = 0,
@ProtoId(30) @JvmField val groupOwnerUin: Long = 0L, @ProtoNumber(30) @JvmField val groupOwnerUin: Long = 0L,
@ProtoId(31) @JvmField val doubtFlag: Int = 0, @ProtoNumber(31) @JvmField val doubtFlag: Int = 0,
@ProtoId(32) @JvmField val warningTips: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(32) @JvmField val warningTips: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(33) @JvmField val nameMore: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(33) @JvmField val nameMore: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(50) @JvmField val reqUinFaceid: Int = 0, @ProtoNumber(50) @JvmField val reqUinFaceid: Int = 0,
@ProtoId(51) @JvmField val reqUinNick: String = "", @ProtoNumber(51) @JvmField val reqUinNick: String = "",
@ProtoId(52) @JvmField val groupName: String = "", @ProtoNumber(52) @JvmField val groupName: String = "",
@ProtoId(53) @JvmField val actionUinNick: String = "", @ProtoNumber(53) @JvmField val actionUinNick: String = "",
@ProtoId(54) @JvmField val msgQna: String = "", @ProtoNumber(54) @JvmField val msgQna: String = "",
@ProtoId(55) @JvmField val msgDetail: String = "", @ProtoNumber(55) @JvmField val msgDetail: String = "",
@ProtoId(57) @JvmField val groupExtFlag: Int = 0, @ProtoNumber(57) @JvmField val groupExtFlag: Int = 0,
@ProtoId(58) @JvmField val actorUinNick: String = "", @ProtoNumber(58) @JvmField val actorUinNick: String = "",
@ProtoId(59) @JvmField val picUrl: String = "", @ProtoNumber(59) @JvmField val picUrl: String = "",
@ProtoId(60) @JvmField val cloneUinNick: String = "", @ProtoNumber(60) @JvmField val cloneUinNick: String = "",
@ProtoId(61) @JvmField val reqUinBusinessCard: String = "", @ProtoNumber(61) @JvmField val reqUinBusinessCard: String = "",
@ProtoId(63) @JvmField val eimGroupIdName: String = "", @ProtoNumber(63) @JvmField val eimGroupIdName: String = "",
@ProtoId(64) @JvmField val reqUinPreRemark: String = "", @ProtoNumber(64) @JvmField val reqUinPreRemark: String = "",
@ProtoId(65) @JvmField val actionUinQqNick: String = "", @ProtoNumber(65) @JvmField val actionUinQqNick: String = "",
@ProtoId(66) @JvmField val actionUinRemark: String = "", @ProtoNumber(66) @JvmField val actionUinRemark: String = "",
@ProtoId(67) @JvmField val reqUinGender: Int = 0, @ProtoNumber(67) @JvmField val reqUinGender: Int = 0,
@ProtoId(68) @JvmField val reqUinAge: Int = 0, @ProtoNumber(68) @JvmField val reqUinAge: Int = 0,
@ProtoId(69) @JvmField val c2cInviteJoinGroupFlag: Int = 0, @ProtoNumber(69) @JvmField val c2cInviteJoinGroupFlag: Int = 0,
@ProtoId(101) @JvmField val cardSwitch: Int = 0 @ProtoNumber(101) @JvmField val cardSwitch: Int = 0
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SystemMsgAction( internal class SystemMsgAction(
@ProtoId(1) @JvmField val name: String = "", @ProtoNumber(1) @JvmField val name: String = "",
@ProtoId(2) @JvmField val result: String = "", @ProtoNumber(2) @JvmField val result: String = "",
@ProtoId(3) @JvmField val action: Int = 0, @ProtoNumber(3) @JvmField val action: Int = 0,
@ProtoId(4) @JvmField val actionInfo: SystemMsgActionInfo? = null, @ProtoNumber(4) @JvmField val actionInfo: SystemMsgActionInfo? = null,
@ProtoId(5) @JvmField val detailName: String = "" @ProtoNumber(5) @JvmField val detailName: String = ""
) : ProtoBuf ) : ProtoBuf
@Serializable @Serializable
internal class SystemMsgActionInfo( internal class SystemMsgActionInfo(
@ProtoId(1) @JvmField val type: Int /* enum */ = 1, @ProtoNumber(1) @JvmField val type: Int /* enum */ = 1,
@ProtoId(2) @JvmField val groupCode: Long = 0L, @ProtoNumber(2) @JvmField val groupCode: Long = 0L,
@ProtoId(3) @JvmField val sig: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(3) @JvmField val sig: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(50) @JvmField val msg: String = "", @ProtoNumber(50) @JvmField val msg: String = "",
@ProtoId(51) @JvmField val groupId: Int = 0, @ProtoNumber(51) @JvmField val groupId: Int = 0,
@ProtoId(52) @JvmField val remark: String = "", @ProtoNumber(52) @JvmField val remark: String = "",
@ProtoId(53) @JvmField val blacklist: Boolean = false, @ProtoNumber(53) @JvmField val blacklist: Boolean = false,
@ProtoId(54) @JvmField val addFrdSNInfo: AddFrdSNInfo? = null @ProtoNumber(54) @JvmField val addFrdSNInfo: AddFrdSNInfo? = null
) : ProtoBuf ) : ProtoBuf
} }
@@ -299,15 +299,15 @@ internal class Structmsg : ProtoBuf {
internal class Youtu : ProtoBuf { internal class Youtu : ProtoBuf {
@Serializable @Serializable
internal class NameCardOcrRsp( internal class NameCardOcrRsp(
@ProtoId(1) @JvmField val errorcode: Int = 0, @ProtoNumber(1) @JvmField val errorcode: Int = 0,
@ProtoId(2) @JvmField val errormsg: String = "", @ProtoNumber(2) @JvmField val errormsg: String = "",
@ProtoId(3) @JvmField val uin: String = "", @ProtoNumber(3) @JvmField val uin: String = "",
@ProtoId(4) @JvmField val uinConfidence: Float = 0.0F, @ProtoNumber(4) @JvmField val uinConfidence: Float = 0.0F,
@ProtoId(5) @JvmField val phone: String = "", @ProtoNumber(5) @JvmField val phone: String = "",
@ProtoId(6) @JvmField val phoneConfidence: Float = 0.0F, @ProtoNumber(6) @JvmField val phoneConfidence: Float = 0.0F,
@ProtoId(7) @JvmField val name: String = "", @ProtoNumber(7) @JvmField val name: String = "",
@ProtoId(8) @JvmField val nameConfidence: Float = 0.0F, @ProtoNumber(8) @JvmField val nameConfidence: Float = 0.0F,
@ProtoId(9) @JvmField val image: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(9) @JvmField val image: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoId(10) @JvmField val sessionId: String = "" @ProtoNumber(10) @JvmField val sessionId: String = ""
) : ProtoBuf ) : ProtoBuf
} }

View File

@@ -1,27 +1,32 @@
package net.mamoe.mirai.qqandroid.network.protocol.data.proto package net.mamoe.mirai.qqandroid.network.protocol.data.proto
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import kotlin.jvm.JvmField import kotlin.jvm.JvmField
import kotlin.math.absoluteValue import kotlin.math.absoluteValue
import kotlin.random.Random import kotlin.random.Random
// COMMENTED ON 2020/7/25
@Serializable @Serializable
internal class SyncCookie( internal class SyncCookie(
@ProtoId(1) @JvmField val time1: Long? = null, // 1580277992 @ProtoNumber(1) @JvmField val time1: Long? = null, // 1580277992
@ProtoId(2) @JvmField val time: Long, // 1580277992 @ProtoNumber(2) @JvmField val time: Long, // 1580277992
@ProtoId(3) @JvmField val unknown1: Long = Random.nextLong().absoluteValue,// 678328038 @ProtoNumber(3) @JvmField val unknown1: Long = Random.nextLong().absoluteValue,// 678328038
@ProtoId(4) @JvmField val unknown2: Long = Random.nextLong().absoluteValue, // 1687142153 @ProtoNumber(4) @JvmField val unknown2: Long = Random.nextLong().absoluteValue, // 1687142153
@ProtoId(5) @JvmField val const1: Long = const1_, // 1458467940 @ProtoNumber(5) @JvmField val const1: Long = const1_, // 1458467940
@ProtoId(11) @JvmField val const2: Long = const2_, // 2683038258 @ProtoNumber(11) @JvmField val const2: Long = const2_, // 2683038258
@ProtoId(12) @JvmField val unknown3: Long = 0x1d, @ProtoNumber(12) @JvmField val unknown3: Long = 0x1d,
@ProtoId(13) @JvmField val lastSyncTime: Long? = null, @ProtoNumber(13) @JvmField val lastSyncTime: Long? = null,
@ProtoId(14) @JvmField val unknown4: Long = 0 @ProtoNumber(14) @JvmField val unknown4: Long = 0
) : ProtoBuf ) : ProtoBuf
private val const1_: Long = Random.nextLong().absoluteValue private val const1_: Long = Random.nextLong().absoluteValue
private val const2_: Long = Random.nextLong().absoluteValue private val const2_: Long = Random.nextLong().absoluteValue
/* /*
@Serializable @Serializable

View File

@@ -20,6 +20,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.TroopManagement
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.* import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.*
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.voice.PttStore
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.ProfileService import net.mamoe.mirai.qqandroid.network.protocol.packet.list.ProfileService
import net.mamoe.mirai.qqandroid.network.protocol.packet.login.ConfigPushSvc import net.mamoe.mirai.qqandroid.network.protocol.packet.login.ConfigPushSvc
@@ -36,6 +37,7 @@ import net.mamoe.mirai.qqandroid.utils.io.useBytes
import net.mamoe.mirai.qqandroid.utils.io.withUse import net.mamoe.mirai.qqandroid.utils.io.withUse
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
import kotlin.jvm.JvmOverloads
internal sealed class PacketFactory<TPacket : Packet?> { internal sealed class PacketFactory<TPacket : Packet?> {
/** /**
@@ -139,6 +141,8 @@ internal object KnownPacketFactories {
FriendList.GetTroopListSimplify, FriendList.GetTroopListSimplify,
FriendList.GetTroopMemberList, FriendList.GetTroopMemberList,
ImgStore.GroupPicUp, ImgStore.GroupPicUp,
PttStore.GroupPttUp,
PttStore.GroupPttDown,
LongConn.OffPicUp, LongConn.OffPicUp,
LongConn.OffPicDown, LongConn.OffPicDown,
TroopManagement.EditSpecialTitle, TroopManagement.EditSpecialTitle,
@@ -173,6 +177,11 @@ internal object KnownPacketFactories {
?: IncomingFactories.firstOrNull { it.receivingCommandName == commandName } ?: IncomingFactories.firstOrNull { it.receivingCommandName == commandName }
} }
class PacketFactoryIllegalState10008Exception @JvmOverloads constructor(
override val message: String? = null,
override val cause: Throwable? = null
) : RuntimeException()
// do not inline. Exceptions thrown will not be reported correctly // do not inline. Exceptions thrown will not be reported correctly
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun <T : Packet?> parseIncomingPacket( suspend fun <T : Packet?> parseIncomingPacket(
@@ -244,11 +253,13 @@ internal object KnownPacketFactories {
bot.network.logger.debug { "Received unknown commandName: ${it.commandName}" } bot.network.logger.debug { "Received unknown commandName: ${it.commandName}" }
PacketLogger.warning { "找不到 PacketFactory" } PacketLogger.warning { "找不到 PacketFactory" }
PacketLogger.verbose { PacketLogger.verbose {
"传递给 PacketFactory 的数据 = ${it.data.useBytes { data, length -> "传递给 PacketFactory 的数据 = ${
data.toUHexString( it.data.useBytes { data, length ->
length = length data.toUHexString(
) length = length
}}" )
}
}"
} }
return return
} }
@@ -301,8 +312,14 @@ internal object KnownPacketFactories {
input.readPacketExact(input.readInt() - 4).withUse { input.readPacketExact(input.readInt() - 4).withUse {
ssoSequenceId = readInt() ssoSequenceId = readInt()
PacketLogger.verbose { "sequenceId = $ssoSequenceId" } PacketLogger.verbose { "sequenceId = $ssoSequenceId" }
val returnCode = readInt() val returnCode = readInt()
check(returnCode == 0) { "returnCode = $returnCode" } check(returnCode == 0) {
if (returnCode == -10008) { // https://github.com/mamoe/mirai/issues/470
throw PacketFactoryIllegalState10008Exception("returnCode = $returnCode")
} else "returnCode = $returnCode"
}
if (PacketLogger.isEnabled) { if (PacketLogger.isEnabled) {
val extraData = readBytes(readInt() - 4) val extraData = readBytes(readInt() - 4)
PacketLogger.verbose { "(sso/inner)extraData = ${extraData.toUHexString()}" } PacketLogger.verbose { "(sso/inner)extraData = ${extraData.toUHexString()}" }

View File

@@ -48,33 +48,40 @@ internal fun Collection<ForwardMessage.INode>.calculateValidationDataForGroup(
random: Int, random: Int,
groupCode: Long groupCode: Long
): MessageValidationData { ): MessageValidationData {
val msgTransmit = MsgTransmit.PbMultiMsgTransmit( val msgList = map { chain ->
msg = this.map { chain -> MsgComm.Msg(
MsgComm.Msg( msgHead = MsgComm.MsgHead(
msgHead = MsgComm.MsgHead( fromUin = chain.senderId,
fromUin = chain.senderId, msgSeq = sequenceId,
msgSeq = sequenceId, msgTime = chain.time,
msgTime = chain.time, msgUid = 0x01000000000000000L or random.toLongUnsigned(),
msgUid = 0x01000000000000000L or random.toLongUnsigned(), mutiltransHead = MsgComm.MutilTransHead(
mutiltransHead = MsgComm.MutilTransHead( status = 0,
status = 0, msgId = 1
msgId = 1
),
msgType = 82, // troop
groupInfo = MsgComm.GroupInfo(
groupCode = groupCode,
groupCard = chain.senderName // Cinnamon
),
isSrcMsg = false
), ),
msgBody = ImMsgBody.MsgBody( msgType = 82, // troop
richText = ImMsgBody.RichText( groupInfo = MsgComm.GroupInfo(
elems = chain.message.asMessageChain() groupCode = groupCode,
.toRichTextElems(forGroup = true, withGeneralFlags = false).toMutableList() groupCard = chain.senderName // Cinnamon
) ),
isSrcMsg = false
),
msgBody = ImMsgBody.MsgBody(
richText = ImMsgBody.RichText(
elems = chain.message.asMessageChain()
.toRichTextElems(forGroup = true, withGeneralFlags = false).toMutableList()
) )
) )
} )
}
val msgTransmit = MsgTransmit.PbMultiMsgTransmit(
msg = msgList,
pbItemList = listOf(
MsgTransmit.PbMultiMsgItem(
fileName = "MultiMsg",
buffer = MsgTransmit.PbMultiMsgNew(msgList).toByteArray(MsgTransmit.PbMultiMsgNew.serializer())
)
)
) )
val bytes = msgTransmit.toByteArray(MsgTransmit.PbMultiMsgTransmit.serializer()) val bytes = msgTransmit.toByteArray(MsgTransmit.PbMultiMsgTransmit.serializer())

View File

@@ -173,10 +173,11 @@ internal class NewContact {
} }
2 -> { // 被邀请入群, 自动同意, 不需处理 2 -> { // 被邀请入群, 自动同意, 不需处理
val group = bot.getNewGroup(groupCode) ?: return null // val group = bot.getNewGroup(groupCode) ?: return null
val invitor = group[actionUin] // val invitor = group[actionUin]
//
BotJoinGroupEvent.Invite(invitor) // BotJoinGroupEvent.Invite(invitor)
null
} }
3 -> { // 已被请他管理员处理 3 -> { // 已被请他管理员处理
null null

View File

@@ -29,7 +29,7 @@ internal fun getRandomString(length: Int): String =
private val defaultRanges: Array<CharRange> = arrayOf('a'..'z', 'A'..'Z', '0'..'9') private val defaultRanges: Array<CharRange> = arrayOf('a'..'z', 'A'..'Z', '0'..'9')
internal fun getRandomString(length: Int, vararg charRanges: CharRange): String = internal fun getRandomString(length: Int, vararg charRanges: CharRange): String =
String(CharArray(length) { charRanges[Random.Default.nextInt(0..charRanges.lastIndex)].random() }) CharArray(length) { charRanges[Random.Default.nextInt(0..charRanges.lastIndex)].random() }.concatToString()
internal class ImgStore { internal class ImgStore {
object GroupPicUp : OutgoingPacketFactory<GroupPicUp.Response>("ImgStore.GroupPicUp") { object GroupPicUp : OutgoingPacketFactory<GroupPicUp.Response>("ImgStore.GroupPicUp") {

View File

@@ -37,7 +37,6 @@ import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.QQAndroidClient import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SyncCookie
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
@@ -45,11 +44,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.GroupInfoImpl
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.NewContact import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.NewContact
import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList import net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray
import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.qqandroid.utils.read import net.mamoe.mirai.qqandroid.utils.read
import net.mamoe.mirai.qqandroid.utils.toInt
import net.mamoe.mirai.qqandroid.utils.toUHexString import net.mamoe.mirai.qqandroid.utils.toUHexString
import net.mamoe.mirai.utils.currentTimeSeconds
import net.mamoe.mirai.utils.debug import net.mamoe.mirai.utils.debug
import net.mamoe.mirai.utils.warning import net.mamoe.mirai.utils.warning
@@ -62,7 +60,7 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
operator fun invoke( operator fun invoke(
client: QQAndroidClient, client: QQAndroidClient,
syncFlag: MsgSvc.SyncFlag = MsgSvc.SyncFlag.START, syncFlag: MsgSvc.SyncFlag = MsgSvc.SyncFlag.START,
msgTime: Long //PbPushMsg.msg.msgHead.msgTime syncCookie: ByteArray?, //PbPushMsg.msg.msgHead.msgTime
): OutgoingPacket = buildOutgoingUniPacket( ): OutgoingPacket = buildOutgoingUniPacket(
client client
) { ) {
@@ -79,8 +77,8 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
whisperSessionId = 0, whisperSessionId = 0,
syncFlag = syncFlag, syncFlag = syncFlag,
// serverBuf = from.serverBuf ?: EMPTY_BYTE_ARRAY, // serverBuf = from.serverBuf ?: EMPTY_BYTE_ARRAY,
syncCookie = client.c2cMessageSync.syncCookie syncCookie = syncCookie ?: client.c2cMessageSync.syncCookie
?: SyncCookie(time = msgTime).toByteArray(SyncCookie.serializer())//.also { client.c2cMessageSync.syncCookie = it }, ?: byteArrayOf()//.also { client.c2cMessageSync.syncCookie = it },
// syncFlag = client.c2cMessageSync.syncFlag, // syncFlag = client.c2cMessageSync.syncFlag,
//msgCtrlBuf = client.c2cMessageSync.msgCtrlBuf, //msgCtrlBuf = client.c2cMessageSync.msgCtrlBuf,
//pubaccountCookie = client.c2cMessageSync.pubAccountCookie //pubaccountCookie = client.c2cMessageSync.pubAccountCookie
@@ -88,7 +86,10 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
) )
} }
open class GetMsgSuccess(delegate: List<Packet>) : Response(MsgSvc.SyncFlag.STOP, delegate), Event, open class GetMsgSuccess(delegate: List<Packet>, syncCookie: ByteArray?) : Response(
MsgSvc.SyncFlag.STOP, delegate,
syncCookie
), Event,
Packet.NoLog { Packet.NoLog {
override fun toString(): String = "MessageSvcPbGetMsg.GetMsgSuccess(messages=<Iterable>))" override fun toString(): String = "MessageSvcPbGetMsg.GetMsgSuccess(messages=<Iterable>))"
} }
@@ -96,7 +97,11 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
/** /**
* 不要直接 expect 这个 class. 它可能还没同步完成 * 不要直接 expect 这个 class. 它可能还没同步完成
*/ */
open class Response(internal val syncFlagFromServer: MsgSvc.SyncFlag, delegate: List<Packet>) : open class Response(
internal val syncFlagFromServer: MsgSvc.SyncFlag,
delegate: List<Packet>,
val syncCookie: ByteArray?
) :
AbstractEvent(), AbstractEvent(),
MultiPacket<Packet>, MultiPacket<Packet>,
Iterable<Packet> by (delegate) { Iterable<Packet> by (delegate) {
@@ -105,11 +110,12 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
"MessageSvcPbGetMsg.Response(syncFlagFromServer=$syncFlagFromServer, messages=<Iterable>))" "MessageSvcPbGetMsg.Response(syncFlagFromServer=$syncFlagFromServer, messages=<Iterable>))"
} }
object EmptyResponse : GetMsgSuccess(emptyList()) object EmptyResponse : GetMsgSuccess(emptyList(), null)
private fun MsgComm.Msg.getNewMemberInfo(): MemberInfo { private fun MsgComm.Msg.getNewMemberInfo(): MemberInfo {
return object : MemberInfo { return object : MemberInfo {
override val nameCard: String get() = "" override val nameCard: String get() = msgHead.authNick.takeIf { it.isNotEmpty() }
?: msgHead.fromNick
override val permission: MemberPermission get() = MemberPermission.MEMBER override val permission: MemberPermission get() = MemberPermission.MEMBER
override val specialTitle: String get() = "" override val specialTitle: String get() = ""
override val muteTimestamp: Int get() = 0 override val muteTimestamp: Int get() = 0
@@ -140,27 +146,42 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
val messages = resp.uinPairMsgs.asFlow() val messages = resp.uinPairMsgs.asFlow()
.filterNot { it.msg == null } .filterNot { it.msg == null }
.flatMapConcat { it.msg!!.asFlow() } .flatMapConcat {
.also { it.msg!!.asFlow()
MessageSvcPbDeleteMsg.delete(bot, it) .filter { msg: MsgComm.Msg -> msg.msgHead.msgTime > it.lastReadTime.toLong() and 4294967295L }
} // 删除消息 }.also {
MessageSvcPbDeleteMsg.delete(bot, it) // 删除消息
// todo 实现一个锁来防止重复收到消息
}
.mapNotNull<MsgComm.Msg, Packet> { msg -> .mapNotNull<MsgComm.Msg, Packet> { msg ->
when (msg.msgHead.msgType) { suspend fun createGroupForBot(groupUin: Long): Group? {
33 -> bot.groupListModifyLock.withLock { // 邀请入群 val group = bot.getGroupByUinOrNull(groupUin)
val group = bot.getGroupByUinOrNull(msg.msgHead.fromUin) if (group != null) {
if (msg.msgHead.authUin == bot.id) { return null
if (group != null) { }
return@mapNotNull null
}
// 新群
val newGroup = bot.getNewGroup(Group.calculateGroupCodeByGroupUin(msg.msgHead.fromUin)) return bot.getNewGroup(Group.calculateGroupCodeByGroupUin(groupUin))?.apply {
?: return@mapNotNull null bot.groups.delegate.addLast(this)
bot.groups.delegate.addLast(newGroup) }
return@mapNotNull BotJoinGroupEvent.Active(newGroup) }
when (msg.msgHead.msgType) {
33 -> bot.groupListModifyLock.withLock {
if (msg.msgHead.authUin == bot.id) {
// 邀请入群
return@mapNotNull createGroupForBot(msg.msgHead.fromUin)?.let {
// package: 27 0B 60 E7 01 CA CC 69 8B 83 44 71 47 90 06 B9 DC C0 ED D4 B1 00 30 33 44 30 42 38 46 30 39 37 32 38 35 43 34 31 38 30 33 36 41 34 36 31 36 31 35 32 37 38 46 46 43 30 41 38 30 36 30 36 45 38 31 43 39 41 34 38 37
// package: groupUin + 01 CA CC 69 8B 83 + invitorUin + length(06) + string + magicKey
val invitorUin = msg.msgBody.msgContent.sliceArray(10..13).toInt().toLong()
BotJoinGroupEvent.Invite(it[invitorUin])
}
} else { } else {
group ?: return@mapNotNull null
// 成员申请入群
val group = bot.getGroupByUinOrNull(msg.msgHead.fromUin)
?: return@mapNotNull null
// 主动入群, 直接加入: msgContent=27 0B 60 E7 01 76 E4 B8 DD 82 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 42 39 41 30 33 45 38 34 30 39 34 42 46 30 45 32 45 38 42 31 43 43 41 34 32 42 38 42 44 42 35 34 44 42 31 44 32 32 30 46 30 38 39 46 46 35 41 38 // 主动入群, 直接加入: msgContent=27 0B 60 E7 01 76 E4 B8 DD 82 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 42 39 41 30 33 45 38 34 30 39 34 42 46 30 45 32 45 38 42 31 43 43 41 34 32 42 38 42 44 42 35 34 44 42 31 44 32 32 30 46 30 38 39 46 46 35 41 38
// 主动直接加入 27 0B 60 E7 01 76 E4 B8 DD 82 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 33 30 45 38 42 31 33 46 41 41 31 33 46 38 31 35 34 41 38 33 32 37 31 43 34 34 38 35 33 35 46 45 31 38 32 43 39 42 43 46 46 32 44 39 39 46 41 37 // 主动直接加入 27 0B 60 E7 01 76 E4 B8 DD 82 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 33 30 45 38 42 31 33 46 41 41 31 33 46 38 31 35 34 41 38 33 32 37 31 43 34 34 38 35 33 35 46 45 31 38 32 43 39 42 43 46 46 32 44 39 39 46 41 37
@@ -191,19 +212,23 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
return@mapNotNull null return@mapNotNull null
} }
85 -> bot.groupListModifyLock.withLock { // 其他客户端入 38 -> bot.groupListModifyLock.withLock { //
val group = bot.getGroupByUinOrNull(msg.msgHead.fromUin) return@mapNotNull createGroupForBot(msg.msgHead.fromUin)
if (msg.msgHead.toUin == bot.id && group == null) { ?.let { BotJoinGroupEvent.Active(it) }
}
val newGroup = bot.getNewGroup(Group.calculateGroupCodeByGroupUin(msg.msgHead.fromUin)) 85 -> bot.groupListModifyLock.withLock { // 其他客户端入群
?: return@mapNotNull null
bot.groups.delegate.addLast(newGroup) // msg.msgHead.authUin: 处理人
return@mapNotNull BotJoinGroupEvent.Active(newGroup)
return@mapNotNull if (msg.msgHead.toUin == bot.id) {
createGroupForBot(msg.msgHead.fromUin)
?.let { BotJoinGroupEvent.Active(it) }
} else { } else {
// unknown null
return@mapNotNull null
} }
} }
/* /*
34 -> { // 主动入群 34 -> { // 主动入群
@@ -251,7 +276,6 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
*/ */
166 -> { 166 -> {
if (msg.msgHead.fromUin == bot.id) { if (msg.msgHead.fromUin == bot.id) {
loop@ while (true) { loop@ while (true) {
val instance = bot.client.getFriendSeq() val instance = bot.client.getFriendSeq()
@@ -270,17 +294,18 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
return@mapNotNull null return@mapNotNull null
} }
friend.lastMessageSequence.loop { instant -> if (friend.lastMessageSequence.compareAndSet(
if (msg.msgHead.msgSeq > instant) { friend.lastMessageSequence.value,
if (friend.lastMessageSequence.compareAndSet(instant, msg.msgHead.msgSeq)) { msg.msgHead.msgSeq
return@mapNotNull FriendMessageEvent( )
friend, ) {
msg.toMessageChain(bot, groupIdOrZero = 0, onlineSource = true), return@mapNotNull FriendMessageEvent(
msg.msgHead.msgTime friend,
) msg.toMessageChain(bot, groupIdOrZero = 0, onlineSource = true),
} msg.msgHead.msgTime
} else return@mapNotNull null )
} }
return@mapNotNull null
} }
208 -> { 208 -> {
// friend ptt // friend ptt
@@ -344,27 +369,37 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
} }
} }
} }
val list: List<Packet> = messages.toList() val list: List<Packet> = messages.toList()
if (resp.syncFlag == MsgSvc.SyncFlag.STOP) { if (resp.syncFlag == MsgSvc.SyncFlag.STOP) {
return GetMsgSuccess(list) return GetMsgSuccess(list, resp.syncCookie)
} }
return Response(resp.syncFlag, list) return Response(resp.syncFlag, list, resp.syncCookie)
} }
override suspend fun QQAndroidBot.handle(packet: Response) { override suspend fun QQAndroidBot.handle(packet: Response) {
when (packet.syncFlagFromServer) { when (packet.syncFlagFromServer) {
MsgSvc.SyncFlag.STOP -> return MsgSvc.SyncFlag.STOP -> {
}
MsgSvc.SyncFlag.START -> { MsgSvc.SyncFlag.START -> {
network.run { network.run {
MessageSvcPbGetMsg(client, MsgSvc.SyncFlag.CONTINUE, currentTimeSeconds).sendAndExpect<Packet>() MessageSvcPbGetMsg(
client,
MsgSvc.SyncFlag.CONTINUE,
packet.syncCookie
).sendAndExpect<Packet>()
} }
return return
} }
MsgSvc.SyncFlag.CONTINUE -> { MsgSvc.SyncFlag.CONTINUE -> {
network.run { network.run {
MessageSvcPbGetMsg(client, MsgSvc.SyncFlag.CONTINUE, currentTimeSeconds).sendAndExpect<Packet>() MessageSvcPbGetMsg(
client,
MsgSvc.SyncFlag.CONTINUE,
packet.syncCookie
).sendAndExpect<Packet>()
} }
return return
} }

View File

@@ -25,13 +25,15 @@ import net.mamoe.mirai.qqandroid.message.MessageSourceToTempImpl
import net.mamoe.mirai.qqandroid.message.toRichTextElems import net.mamoe.mirai.qqandroid.message.toRichTextElems
import net.mamoe.mirai.qqandroid.network.Packet import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.QQAndroidClient import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.* import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgCtrl
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray
import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.utils.currentTimeSeconds import net.mamoe.mirai.utils.currentTimeSeconds
import kotlin.contracts.InvocationKind import kotlin.contracts.InvocationKind
@@ -78,7 +80,7 @@ internal object MessageSvcPbSendMsg : OutgoingPacketFactory<MessageSvcPbSendMsg.
), ),
msgSeq = source.sequenceId, msgSeq = source.sequenceId,
msgRand = source.internalId, msgRand = source.internalId,
syncCookie = SyncCookie(time = source.time.toLong()).toByteArray(SyncCookie.serializer()) syncCookie = client.c2cMessageSync.syncCookie ?: byteArrayOf()
// msgVia = 1 // msgVia = 1
) )
) )
@@ -108,7 +110,7 @@ internal object MessageSvcPbSendMsg : OutgoingPacketFactory<MessageSvcPbSendMsg.
), ),
msgSeq = source.sequenceId, msgSeq = source.sequenceId,
msgRand = source.internalId, msgRand = source.internalId,
syncCookie = SyncCookie(time = source.time.toLong()).toByteArray(SyncCookie.serializer()) syncCookie = client.c2cMessageSync.syncCookie ?: byteArrayOf()
) )
) )
} }
@@ -138,7 +140,14 @@ internal object MessageSvcPbSendMsg : OutgoingPacketFactory<MessageSvcPbSendMsg.
richText = ImMsgBody.RichText( richText = ImMsgBody.RichText(
elems = message.toRichTextElems(forGroup = true, withGeneralFlags = true), elems = message.toRichTextElems(forGroup = true, withGeneralFlags = true),
ptt = message.firstOrNull(PttMessage)?.run { ptt = message.firstOrNull(PttMessage)?.run {
ImMsgBody.Ptt(fileName = fileName.toByteArray(), fileMd5 = md5) ImMsgBody.Ptt(
fileName = fileName.toByteArray(),
fileMd5 = md5,
boolValid = true,
fileSize = fileSize.toInt(),
fileType = 4,
pbReserve = byteArrayOf(0)
)
} }
) )
), ),

View File

@@ -9,6 +9,7 @@
package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
import kotlinx.atomicfu.loop
import kotlinx.io.core.ByteReadPacket import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.discardExact import kotlinx.io.core.discardExact
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
@@ -17,7 +18,6 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.qqandroid.utils.io.serialization.readUniPacket import net.mamoe.mirai.qqandroid.utils.io.serialization.readUniPacket
import net.mamoe.mirai.utils.currentTimeSeconds
/** /**
@@ -31,12 +31,19 @@ internal object MessageSvcPushNotify : IncomingPacketFactory<RequestPushNotify>(
override suspend fun QQAndroidBot.handle(packet: RequestPushNotify, sequenceId: Int): OutgoingPacket? { override suspend fun QQAndroidBot.handle(packet: RequestPushNotify, sequenceId: Int): OutgoingPacket? {
network.run { client.c2cMessageSync.firstNotify.loop { firstNotify ->
return MessageSvcPbGetMsg( network.run {
client, return MessageSvcPbGetMsg(
MsgSvc.SyncFlag.START, client,
packet.stMsgInfo?.uMsgTime ?: currentTimeSeconds MsgSvc.SyncFlag.START,
) if (firstNotify) {
if (!client.c2cMessageSync.firstNotify.compareAndSet(firstNotify, false)) {
return@loop
}
null
} else packet.vNotifyCookie
)
}
} }
} }
} }

View File

@@ -53,6 +53,7 @@ internal object OnlinePushPbPushGroupMsg : IncomingPacketFactory<Packet?>("Onlin
// 00 00 02 E4 0A D5 05 0A 4F 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 52 20 00 28 BC 3D 30 8C 82 AB F1 05 38 D2 80 E0 8C 80 80 80 80 02 4A 21 08 E7 C1 AD B8 02 10 01 18 BA 05 22 09 48 69 6D 31 38 38 6D 6F 65 30 06 38 02 42 05 4D 69 72 61 69 50 01 58 01 60 00 88 01 08 12 06 08 01 10 00 18 00 1A F9 04 0A F6 04 0A 26 08 00 10 87 82 AB F1 05 18 B7 B4 BF 30 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 E6 03 42 E3 03 12 2A 7B 34 45 31 38 35 38 32 32 2D 30 45 37 42 2D 46 38 30 46 2D 43 35 42 31 2D 33 34 34 38 38 33 37 34 44 33 39 43 7D 2E 6A 70 67 22 00 2A 04 03 00 00 00 32 60 15 36 20 39 36 6B 45 31 41 38 35 32 32 39 64 63 36 39 38 34 37 39 37 37 62 20 20 20 20 20 20 35 30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7B 34 45 31 38 35 38 32 32 2D 30 45 37 42 2D 46 38 30 46 2D 43 35 42 31 2D 33 34 34 38 38 33 37 34 44 33 39 43 7D 2E 6A 70 67 31 32 31 32 41 38 C6 BB 8A A9 08 40 FB AE 9E C2 09 48 50 50 41 5A 00 60 01 6A 10 4E 18 58 22 0E 7B F8 0F C5 B1 34 48 83 74 D3 9C 72 59 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 31 39 38 3F 74 65 72 6D 3D 32 82 01 57 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 30 3F 74 65 72 6D 3D 32 B0 01 4D B8 01 2E C8 01 FF 05 D8 01 4D E0 01 2E FA 01 59 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 34 30 30 3F 74 65 72 6D 3D 32 80 02 4D 88 02 2E 12 45 AA 02 42 50 03 60 00 68 00 9A 01 39 08 09 20 BF 50 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 98 03 00 A0 03 20 B0 03 00 C0 03 00 D0 03 00 E8 03 00 8A 04 04 08 02 08 01 90 04 80 80 80 10 B8 04 00 C0 04 00 12 06 4A 04 08 00 40 01 12 14 82 01 11 0A 09 48 69 6D 31 38 38 6D 6F 65 18 06 20 08 28 03 10 8A CA 9D A1 07 1A 00 // 00 00 02 E4 0A D5 05 0A 4F 08 A2 FF 8C F0 03 10 DD F1 92 B7 07 18 52 20 00 28 BC 3D 30 8C 82 AB F1 05 38 D2 80 E0 8C 80 80 80 80 02 4A 21 08 E7 C1 AD B8 02 10 01 18 BA 05 22 09 48 69 6D 31 38 38 6D 6F 65 30 06 38 02 42 05 4D 69 72 61 69 50 01 58 01 60 00 88 01 08 12 06 08 01 10 00 18 00 1A F9 04 0A F6 04 0A 26 08 00 10 87 82 AB F1 05 18 B7 B4 BF 30 20 00 28 0C 30 00 38 86 01 40 22 4A 0C E5 BE AE E8 BD AF E9 9B 85 E9 BB 91 12 E6 03 42 E3 03 12 2A 7B 34 45 31 38 35 38 32 32 2D 30 45 37 42 2D 46 38 30 46 2D 43 35 42 31 2D 33 34 34 38 38 33 37 34 44 33 39 43 7D 2E 6A 70 67 22 00 2A 04 03 00 00 00 32 60 15 36 20 39 36 6B 45 31 41 38 35 32 32 39 64 63 36 39 38 34 37 39 37 37 62 20 20 20 20 20 20 35 30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7B 34 45 31 38 35 38 32 32 2D 30 45 37 42 2D 46 38 30 46 2D 43 35 42 31 2D 33 34 34 38 38 33 37 34 44 33 39 43 7D 2E 6A 70 67 31 32 31 32 41 38 C6 BB 8A A9 08 40 FB AE 9E C2 09 48 50 50 41 5A 00 60 01 6A 10 4E 18 58 22 0E 7B F8 0F C5 B1 34 48 83 74 D3 9C 72 59 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 31 39 38 3F 74 65 72 6D 3D 32 82 01 57 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 30 3F 74 65 72 6D 3D 32 B0 01 4D B8 01 2E C8 01 FF 05 D8 01 4D E0 01 2E FA 01 59 2F 67 63 68 61 74 70 69 63 5F 6E 65 77 2F 31 30 34 30 34 30 30 32 39 30 2F 36 35 35 30 35 37 31 32 37 2D 32 32 33 33 36 33 38 33 34 32 2D 34 45 31 38 35 38 32 32 30 45 37 42 46 38 30 46 43 35 42 31 33 34 34 38 38 33 37 34 44 33 39 43 2F 34 30 30 3F 74 65 72 6D 3D 32 80 02 4D 88 02 2E 12 45 AA 02 42 50 03 60 00 68 00 9A 01 39 08 09 20 BF 50 80 01 01 C8 01 00 F0 01 00 F8 01 00 90 02 00 98 03 00 A0 03 20 B0 03 00 C0 03 00 D0 03 00 E8 03 00 8A 04 04 08 02 08 01 90 04 80 80 80 10 B8 04 00 C0 04 00 12 06 4A 04 08 00 40 01 12 14 82 01 11 0A 09 48 69 6D 31 38 38 6D 6F 65 18 06 20 08 28 03 10 8A CA 9D A1 07 1A 00
if (!bot.firstLoginSucceed) return null if (!bot.firstLoginSucceed) return null
val pbPushMsg = readProtoBuf(MsgOnlinePush.PbPushMsg.serializer()) val pbPushMsg = readProtoBuf(MsgOnlinePush.PbPushMsg.serializer())
// bot.logger.debug(pbPushMsg._miraiContentToString())
if (pbPushMsg.msg.msgHead.fromUin == bot.id) { if (pbPushMsg.msg.msgHead.fromUin == bot.id) {
return SendGroupMessageReceipt( return SendGroupMessageReceipt(
@@ -106,7 +107,7 @@ internal object OnlinePushPbPushGroupMsg : IncomingPacketFactory<Packet?>("Onlin
permission = when { permission = when {
flags and 16 != 0 -> MemberPermission.ADMINISTRATOR flags and 16 != 0 -> MemberPermission.ADMINISTRATOR
flags and 8 != 0 -> MemberPermission.OWNER flags and 8 != 0 -> MemberPermission.OWNER
flags == 0 -> MemberPermission.MEMBER flags == 0 || flags == 1 -> MemberPermission.MEMBER
else -> { else -> {
bot.logger.warning { "判断群 ${sender.group.id} 的群员 ${sender.id} 的权限失败: ${flags._miraiContentToString()}. 请完整截图或复制此日志并确认其真实权限后发送给 mirai 维护者以帮助解决问题." } bot.logger.warning { "判断群 ${sender.group.id} 的群员 ${sender.id} 的权限失败: ${flags._miraiContentToString()}. 请完整截图或复制此日志并确认其真实权限后发送给 mirai 维护者以帮助解决问题." }
sender.permission sender.permission

View File

@@ -21,17 +21,19 @@ import kotlinx.io.core.discardExact
import kotlinx.io.core.readBytes import kotlinx.io.core.readBytes
import kotlinx.io.core.readUInt import kotlinx.io.core.readUInt
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.JavaFriendlyAPI import net.mamoe.mirai.JavaFriendlyAPI
import net.mamoe.mirai.data.FriendInfo import net.mamoe.mirai.data.FriendInfo
import net.mamoe.mirai.event.events.* import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.getFriendOrNull import net.mamoe.mirai.getFriendOrNull
import net.mamoe.mirai.getGroupOrNull import net.mamoe.mirai.getGroupOrNull
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.contact.*
import net.mamoe.mirai.qqandroid.contact.FriendImpl
import net.mamoe.mirai.qqandroid.contact.GroupImpl import net.mamoe.mirai.qqandroid.contact.GroupImpl
import net.mamoe.mirai.qqandroid.contact.checkIsGroupImpl import net.mamoe.mirai.qqandroid.contact.checkIsGroupImpl
import net.mamoe.mirai.qqandroid.contact.checkIsInstance import net.mamoe.mirai.qqandroid.contact.checkIsInstance
import net.mamoe.mirai.qqandroid.contact.checkIsMemberImpl import net.mamoe.mirai.qqandroid.contact.checkIsMemberImpl
import net.mamoe.mirai.qqandroid.message.contextualBugReportException
import net.mamoe.mirai.qqandroid.network.MultiPacketBySequence import net.mamoe.mirai.qqandroid.network.MultiPacketBySequence
import net.mamoe.mirai.qqandroid.network.Packet import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.QQAndroidClient import net.mamoe.mirai.qqandroid.network.QQAndroidClient
@@ -39,6 +41,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgInfo
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgType0x210 import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgType0x210
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.OnlinePushPack import net.mamoe.mirai.qqandroid.network.protocol.data.jce.OnlinePushPack
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x115
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x27.SubMsgType0x27.* import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x27.SubMsgType0x27.*
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x44 import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x44
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0xb3 import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0xb3
@@ -211,11 +214,11 @@ private object Transformers732 : Map<Int, Lambda732> by mapOf(
val member = group.getOrNull(target) ?: return@lambda732 emptySequence() val member = group.getOrNull(target) ?: return@lambda732 emptySequence()
member.checkIsMemberImpl() member.checkIsMemberImpl()
if (member._muteTimestamp == timeSeconds) { if (member.muteTimeRemaining == timeSeconds) {
return@lambda732 emptySequence() return@lambda732 emptySequence()
} }
member._muteTimestamp = timeSeconds member._muteTimestamp = currentTimeSeconds.toInt() + timeSeconds
return@lambda732 if (timeSeconds == 0) sequenceOf(MemberUnmuteEvent(member, operator)) return@lambda732 if (timeSeconds == 0) sequenceOf(MemberUnmuteEvent(member, operator))
else sequenceOf(MemberMuteEvent(member, timeSeconds, operator)) else sequenceOf(MemberMuteEvent(member, timeSeconds, operator))
}, },
@@ -353,6 +356,42 @@ internal inline fun lambda528(crossinline block: MsgType0x210.(QQAndroidBot) ->
*/ */
internal object Transformers528 : Map<Long, Lambda528> by mapOf( internal object Transformers528 : Map<Long, Lambda528> by mapOf(
0x8AL to lambda528 { bot ->
@Serializable
data class Sub8AMsgInfo(
@ProtoNumber(1) val fromUin: Long,
@ProtoNumber(2) val botUin: Long,
@ProtoNumber(3) val srcId: Int,
@ProtoNumber(4) val srcInternalId: Int,
@ProtoNumber(5) val time: Int,
@ProtoNumber(6) val random: Int, // 同srcInternalId
@ProtoNumber(7) val pkgNum: Int, // 1
@ProtoNumber(8) val pkgIndex: Int, // 0
@ProtoNumber(9) val devSeq: Int, // 0
@ProtoNumber(12) val flag: Int // 1
) : ProtoBuf
@Serializable
data class Sub8A(
@ProtoNumber(1) val msgInfo: List<Sub8AMsgInfo>,
@ProtoNumber(2) val appId: Int, // 1
@ProtoNumber(3) val instId: Int, // 1
@ProtoNumber(4) val longMessageFlag: Int, // 0
@ProtoNumber(5) val reserved: ByteArray? = null // struct{ boolean(1), boolean(2) }
) : ProtoBuf
return@lambda528 vProtobuf.loadAs(Sub8A.serializer()).msgInfo.asSequence()
.filter { it.botUin == bot.id }.map {
MessageRecallEvent.FriendRecall(
bot = bot,
messageId = it.srcId,
messageInternalId = it.srcInternalId,
messageTime = it.time,
operator = it.fromUin
)
}
},
// Network(1994701021) 16:03:54 : unknown group 528 type 0x0000000000000026, data: 08 01 12 40 0A 06 08 F4 EF BB 8F 04 10 E7 C1 AD B8 02 18 01 22 2C 10 01 1A 1A 18 B4 DC F8 9B 0C 20 E7 C1 AD B8 02 28 06 30 02 A2 01 04 08 93 D6 03 A8 01 08 20 00 28 00 32 08 18 01 20 FE AF AF F5 05 28 00 // Network(1994701021) 16:03:54 : unknown group 528 type 0x0000000000000026, data: 08 01 12 40 0A 06 08 F4 EF BB 8F 04 10 E7 C1 AD B8 02 18 01 22 2C 10 01 1A 1A 18 B4 DC F8 9B 0C 20 E7 C1 AD B8 02 28 06 30 02 A2 01 04 08 93 D6 03 A8 01 08 20 00 28 00 32 08 18 01 20 FE AF AF F5 05 28 00
// VIP 进群提示 // VIP 进群提示
0x26L to ignoredLambda528, 0x26L to ignoredLambda528,
@@ -407,6 +446,17 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
sequenceOf(BotLeaveEvent.Active(group)) sequenceOf(BotLeaveEvent.Active(group))
} else emptySequence() } else emptySequence()
}, },
//好友输入状态
0x115L to lambda528 { bot ->
val body = vProtobuf.loadAs(Submsgtype0x115.SubMsgType0x115.MsgBody.serializer())
val friend = bot.getFriendOrNull(body.fromUin)
val item = body.msgNotifyItem
return@lambda528 if (friend != null && item != null) {
sequenceOf(FriendInputStatusChangedEvent(friend, item.eventType == 1))
} else {
emptySequence()
}
},
// 群相关, ModFriendRemark, DelFriend, ModGroupProfile // 群相关, ModFriendRemark, DelFriend, ModGroupProfile
0x27L to lambda528 { bot -> 0x27L to lambda528 { bot ->
fun ModFriendRemark.transform(bot: QQAndroidBot): Sequence<Packet> { fun ModFriendRemark.transform(bot: QQAndroidBot): Sequence<Packet> {
@@ -456,23 +506,23 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
var85.troopface = var3; var85.troopface = var3;
var85.hasSetNewTroopHead = true; var85.hasSetNewTroopHead = true;
*/ */
bot.logger.debug( // bot.logger.debug(
contextualBugReportException( // contextualBugReportException(
"解析 Transformers528 0x27L ModGroupProfile 群头像修改", // "解析 Transformers528 0x27L ModGroupProfile 群头像修改",
forDebug = "this=${this._miraiContentToString()}" // forDebug = "this=${this._miraiContentToString()}"
) // )
) // )
null null
} }
3 -> { // troop.credit.data 3 -> { // troop.credit.data
// top_package/akkz.java:3475 // top_package/akkz.java:3475
// top_package/akkz.java:3498 // top_package/akkz.java:3498
bot.logger.debug( // bot.logger.debug(
contextualBugReportException( // contextualBugReportException(
"解析 Transformers528 0x27L ModGroupProfile 群 troop.credit.data", // "解析 Transformers528 0x27L ModGroupProfile 群 troop.credit.data",
forDebug = "this=${this._miraiContentToString()}" // forDebug = "this=${this._miraiContentToString()}"
) // )
) // )
null null
} }
@@ -524,6 +574,59 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
return sequenceOf(FriendAvatarChangedEvent(friend)) return sequenceOf(FriendAvatarChangedEvent(friend))
} }
fun ModProfile.transform(bot: QQAndroidBot): Sequence<Packet> {
return ArrayList<Packet>().apply {
var containsUnknown = false
msgProfileInfos?.forEach { modified ->
when (modified.field) {
20002 -> { // 昵称修改
val value = modified.value
val to = value.encodeToString()
if (uin == bot.id) {
val from = bot.nick
bot.cachedNick = to
add(
BotNickChangedEvent(
bot, from, to
)
)
} else {
val friend = (bot.getFriendOrNull(uin) ?: return@forEach) as FriendImpl
val info = friend.friendInfo
val from = info.nick
when (info) {
is FriendInfoImpl -> {
info.cachedNick = to
}
is MemberInfoImpl -> {
info._nick = to
}
else -> {
bot.network.logger.debug {
"Unknown how to update nick for $info"
}
}
}
add(
FriendNickChangedEvent(
friend, from, to
)
)
}
}
else -> {
containsUnknown = true
}
}
}
if (msgProfileInfos == null || msgProfileInfos.isEmpty() || containsUnknown) {
bot.network.logger.debug {
"Transformers528 0x27L: new data: ${_miraiContentToString()}"
}
}
}.asSequence()
}
return@lambda528 vProtobuf.loadAs(SubMsgType0x27MsgBody.serializer()).msgModInfos.asSequence() return@lambda528 vProtobuf.loadAs(SubMsgType0x27MsgBody.serializer()).msgModInfos.asSequence()
.flatMap { .flatMap {
@@ -533,6 +636,7 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
it.msgModGroupProfile != null -> it.msgModGroupProfile.transform(bot) it.msgModGroupProfile != null -> it.msgModGroupProfile.transform(bot)
it.msgModGroupMemberProfile != null -> it.msgModGroupMemberProfile.transform(bot) it.msgModGroupMemberProfile != null -> it.msgModGroupMemberProfile.transform(bot)
it.msgModCustomFace != null -> it.msgModCustomFace.transform(bot) it.msgModCustomFace != null -> it.msgModCustomFace.transform(bot)
it.msgModProfile != null -> it.msgModProfile.transform(bot)
else -> { else -> {
bot.network.logger.debug { bot.network.logger.debug {
"Transformers528 0x27L: new data: ${it._miraiContentToString()}" "Transformers528 0x27L: new data: ${it._miraiContentToString()}"

View File

@@ -0,0 +1,154 @@
package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.voice
import kotlinx.io.core.ByteReadPacket
import net.mamoe.mirai.qqandroid.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.network.Packet
import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Cmd0x388
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.qqandroid.utils.encodeToString
import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
internal class PttStore {
object GroupPttUp : OutgoingPacketFactory<GroupPttUp.Response>("PttStore.GroupPttUp") {
sealed class Response : Packet {
class RequireUpload(
val fileId: Long,
val uKey: ByteArray,
val uploadIpList: List<Int>,
val uploadPortList: List<Int>,
val fileKey: ByteArray
) : GroupPttUp.Response() {
override fun toString(): String {
return "RequireUpload(fileId=$fileId, uKey=${uKey.contentToString()})"
}
}
}
@OptIn(ExperimentalStdlibApi::class)
operator fun invoke(
client: QQAndroidClient,
uin: Long,
groupCode: Long,
md5: ByteArray,
size: Long,
codec: Int = 0
): OutgoingPacket {
val pack = Cmd0x388.ReqBody(
netType = 3, // wifi
subcmd = 3,
msgTryupPttReq = listOf(
Cmd0x388.TryUpPttReq(
srcUin = uin,
groupCode = groupCode,
fileId = 0,
fileSize = size,
fileMd5 = md5,
fileName = md5,
srcTerm = 5,
platformType = 9,
buType = 4,
innerIp = 0,
buildVer = "6.5.5.663".encodeToByteArray(),
voiceLength = 1,
codec = codec,
voiceType = 1,
boolNewUpChan = true
)
)
)
return buildOutgoingUniPacket(client) {
writeProtoBuf(Cmd0x388.ReqBody.serializer(), pack)
}
}
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {
val resp0 = readProtoBuf(Cmd0x388.RspBody.serializer())
resp0.msgTryupPttRsp ?: error("cannot find `msgTryupPttRsp` from `Cmd0x388.RspBody`")
val resp = resp0.msgTryupPttRsp.first()
if (resp.failMsg != null) {
throw IllegalStateException(resp.failMsg.encodeToString())
}
return Response.RequireUpload(
fileId = resp.fileid,
uKey = resp.upUkey,
uploadIpList = resp.uint32UpIp!!,
uploadPortList = resp.uint32UpPort!!,
fileKey = resp.fileKey
)
}
}
object GroupPttDown : OutgoingPacketFactory<GroupPttDown.Response>("PttStore.GroupPttDown") {
sealed class Response : Packet {
class DownLoadInfo(
val downDomain: ByteArray,
val downPara: ByteArray,
val strDomain: String,
val uint32DownIp: List<Int>,
val uint32DownPort: List<Int>
) : GroupPttDown.Response() {
override fun toString(): String {
return "GroupPttDown(downPara=${downPara.encodeToString()},strDomain=$strDomain})"
}
}
}
@OptIn(ExperimentalStdlibApi::class)
operator fun invoke(
client: QQAndroidClient,
groupCode: Long,
dstUin: Long,
md5: ByteArray
): OutgoingPacket = buildOutgoingUniPacket(client) {
writeProtoBuf(
Cmd0x388.ReqBody.serializer(), Cmd0x388.ReqBody(
netType = 3, // wifi
subcmd = 4,
msgGetpttUrlReq = listOf(
Cmd0x388.GetPttUrlReq(
groupCode = groupCode,
fileMd5 = md5,
dstUin = dstUin,
buType = 4,
innerIp = 0,
buildVer = "6.5.5.663".encodeToByteArray(),
codec = 0,
reqTerm = 5,
reqPlatformType = 9
)
)
)
)
}
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {
val resp0 = readProtoBuf(Cmd0x388.RspBody.serializer())
resp0.msgGetpttUrlRsp ?: error("cannot find `msgGetpttUrlRsp` from `Cmd0x388.RspBody`")
val resp = resp0.msgGetpttUrlRsp.first()
if (!resp.failMsg.contentEquals(EMPTY_BYTE_ARRAY)) {
throw IllegalStateException(resp.failMsg.encodeToString())
}
return Response.DownLoadInfo(
downDomain = resp.downDomain,
downPara = resp.downPara,
uint32DownIp = resp.uint32DownIp!!,
uint32DownPort = resp.uint32DownPort!!,
strDomain = resp.strDomain
)
}
}
}

View File

@@ -50,8 +50,7 @@ internal class ProfileService {
GroupMngReqJce( GroupMngReqJce(
reqtype = 2, reqtype = 2,
uin = client.uin, uin = client.uin,
vecBody = client.uin.shl(32).or(Group.calculateGroupUinByGroupCode(groupCode)) vecBody = client.uin.shl(32).or(groupCode).toByteArray()
.toByteArray() // 这里可能是 code
) )
) )
) )

View File

@@ -12,7 +12,7 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.login
import kotlinx.io.core.ByteReadPacket import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.use import kotlinx.io.core.use
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.protobuf.ProtoId import kotlinx.serialization.protobuf.ProtoNumber
import net.mamoe.mirai.event.AbstractEvent import net.mamoe.mirai.event.AbstractEvent
import net.mamoe.mirai.event.Event import net.mamoe.mirai.event.Event
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
@@ -51,15 +51,15 @@ internal class ConfigPushSvc {
@Serializable @Serializable
data class ChangeServer( data class ChangeServer(
@ProtoId(1) val unknown: Int, // =08 @ProtoNumber(1) val unknown: Int, // =08
@ProtoId(2) val serverList: List<ServerInfo> @ProtoNumber(2) val serverList: List<ServerInfo>
) : ProtoBuf, PushReqResponse() { ) : ProtoBuf, PushReqResponse() {
@Serializable @Serializable
data class ServerInfo( data class ServerInfo(
@ProtoId(1) val host: String, @ProtoNumber(1) val host: String,
@ProtoId(2) val port: Int, @ProtoNumber(2) val port: Int,
@ProtoId(3) val unknown: Int @ProtoNumber(3) val unknown: Int
) : ProtoBuf { ) : ProtoBuf {
override fun toString(): String { override fun toString(): String {
return "$host:$port" return "$host:$port"

View File

@@ -148,7 +148,7 @@ internal class StatSvc {
var44.strVendorName = ROMUtil.getRomName(); var44.strVendorName = ROMUtil.getRomName();
var44.strVendorOSName = ROMUtil.getRomVersion(20); var44.strVendorOSName = ROMUtil.getRomVersion(20);
*/ */
bytes_0x769_reqbody = ProtoBuf.dump( bytes_0x769_reqbody = ProtoBuf.encodeToByteArray(
Oidb0x769.RequestBody.serializer(), Oidb0x769.RequestBody( Oidb0x769.RequestBody.serializer(), Oidb0x769.RequestBody(
rpt_config_list = listOf( rpt_config_list = listOf(
Oidb0x769.ConfigSeq( Oidb0x769.ConfigSeq(

View File

@@ -12,14 +12,13 @@ package net.mamoe.mirai.qqandroid.utils
import kotlinx.io.core.ByteReadPacket import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.Closeable import kotlinx.io.core.Closeable
import kotlinx.io.errors.IOException import kotlinx.io.errors.IOException
import net.mamoe.mirai.utils.Throws
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
/** /**
* 多平台适配的 TCP Socket. * 多平台适配的 TCP Socket.
*/ */
internal expect class PlatformSocket() : Closeable { internal expect class PlatformSocket() : Closeable {
@Throws(SocketException::class) @kotlin.Throws(SocketException::class)
suspend fun connect(coroutineContext: CoroutineContext, serverHost: String, serverPort: Int) suspend fun connect(coroutineContext: CoroutineContext, serverHost: String, serverPort: Int)
/** /**
@@ -42,6 +41,6 @@ internal expect class PlatformSocket() : Closeable {
override fun close() override fun close()
} }
expect open class SocketException : IOException internal expect open class SocketException : IOException
expect class NoRouteToHostException : SocketException internal expect class NoRouteToHostException : SocketException
expect class UnknownHostException : IOException internal expect class UnknownHostException : IOException

View File

@@ -11,11 +11,11 @@ package net.mamoe.mirai.qqandroid.utils.cryptor
import net.mamoe.mirai.qqandroid.utils.chunkedHexToBytes import net.mamoe.mirai.qqandroid.utils.chunkedHexToBytes
expect interface ECDHPrivateKey { internal expect interface ECDHPrivateKey {
fun getEncoded(): ByteArray fun getEncoded(): ByteArray
} }
expect interface ECDHPublicKey { internal expect interface ECDHPublicKey {
fun getEncoded(): ByteArray fun getEncoded(): ByteArray
} }

View File

@@ -9,31 +9,35 @@
package net.mamoe.mirai.qqandroid.utils.io.serialization package net.mamoe.mirai.qqandroid.utils.io.serialization
import kotlinx.io.ByteArrayOutputStream
import kotlinx.io.ByteBuffer
import kotlinx.io.ByteOrder
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.builtins.ByteArraySerializer import kotlinx.serialization.builtins.ByteArraySerializer
import kotlinx.serialization.builtins.MapEntrySerializer import kotlinx.serialization.builtins.MapEntrySerializer
import kotlinx.serialization.builtins.SetSerializer import kotlinx.serialization.builtins.SetSerializer
import kotlinx.serialization.descriptors.PolymorphicKind
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.StructureKind
import kotlinx.serialization.encoding.CompositeEncoder
import kotlinx.serialization.internal.MapLikeSerializer import kotlinx.serialization.internal.MapLikeSerializer
import kotlinx.serialization.internal.TaggedEncoder import kotlinx.serialization.internal.TaggedEncoder
import kotlinx.serialization.modules.EmptyModule import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerialModule import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.protobuf.ProtoBuf import kotlinx.serialization.protobuf.ProtoBuf
import kotlinx.serialization.protobuf.ProtoNumberType import kotlinx.serialization.protobuf.ProtoIntegerType
import kotlinx.serialization.protobuf.ProtoType import kotlinx.serialization.protobuf.ProtoType
import moe.him188.jcekt.JceId
import net.mamoe.mirai.qqandroid.utils.io.serialization.ProtoBufWithNullableSupport.Varint.encodeVarint import net.mamoe.mirai.qqandroid.utils.io.serialization.ProtoBufWithNullableSupport.Varint.encodeVarint
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
import java.nio.ByteOrder
internal typealias ProtoDesc = Pair<Int, ProtoNumberType> internal typealias ProtoDesc = Pair<Int, ProtoIntegerType>
internal fun getSerialId(desc: SerialDescriptor, index: Int): Int? = desc.findAnnotation<JceId>(index)?.id internal fun getSerialId(desc: SerialDescriptor, index: Int): Int? = desc.findAnnotation<TarsId>(index)?.id
internal fun extractParameters(desc: SerialDescriptor, index: Int, zeroBasedDefault: Boolean = false): ProtoDesc { internal fun extractParameters(desc: SerialDescriptor, index: Int, zeroBasedDefault: Boolean = false): ProtoDesc {
val idx = getSerialId(desc, index) ?: (if (zeroBasedDefault) index else index + 1) val idx = getSerialId(desc, index) ?: (if (zeroBasedDefault) index else index + 1)
val format = desc.findAnnotation<ProtoType>(index)?.type val format = desc.findAnnotation<ProtoType>(index)?.type
?: ProtoNumberType.DEFAULT ?: ProtoIntegerType.DEFAULT
return idx to format return idx to format
} }
@@ -45,12 +49,14 @@ internal fun extractParameters(desc: SerialDescriptor, index: Int, zeroBasedDefa
* 代码复制自 kotlinx.serialization. 修改部分已进行标注 (详见 "MIRAI MODIFY START") * 代码复制自 kotlinx.serialization. 修改部分已进行标注 (详见 "MIRAI MODIFY START")
*/ */
@OptIn(InternalSerializationApi::class) @OptIn(InternalSerializationApi::class)
internal class ProtoBufWithNullableSupport(override val context: SerialModule = EmptyModule) : SerialFormat, BinaryFormat { internal class ProtoBufWithNullableSupport(override val serializersModule: SerializersModule = EmptySerializersModule) :
SerialFormat, BinaryFormat {
internal open inner class ProtobufWriter(private val encoder: ProtobufEncoder) : TaggedEncoder<ProtoDesc>() { internal open inner class ProtobufWriter(private val encoder: ProtobufEncoder) : TaggedEncoder<ProtoDesc>() {
override val context override val serializersModule
get() = this@ProtoBufWithNullableSupport.context get() = this@ProtoBufWithNullableSupport.serializersModule
@Suppress("OverridingDeprecatedMember")
override fun beginStructure( override fun beginStructure(
descriptor: SerialDescriptor, descriptor: SerialDescriptor,
vararg typeSerializers: KSerializer<*> vararg typeSerializers: KSerializer<*>
@@ -67,17 +73,17 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
override fun encodeTaggedLong(tag: ProtoDesc, value: Long) = encoder.writeLong(value, tag.first, tag.second) override fun encodeTaggedLong(tag: ProtoDesc, value: Long) = encoder.writeLong(value, tag.first, tag.second)
override fun encodeTaggedFloat(tag: ProtoDesc, value: Float) = encoder.writeFloat(value, tag.first) override fun encodeTaggedFloat(tag: ProtoDesc, value: Float) = encoder.writeFloat(value, tag.first)
override fun encodeTaggedDouble(tag: ProtoDesc, value: Double) = encoder.writeDouble(value, tag.first) override fun encodeTaggedDouble(tag: ProtoDesc, value: Double) = encoder.writeDouble(value, tag.first)
override fun encodeTaggedBoolean(tag: ProtoDesc, value: Boolean) = encoder.writeInt(if (value) 1 else 0, tag.first, ProtoNumberType.DEFAULT) override fun encodeTaggedBoolean(tag: ProtoDesc, value: Boolean) = encoder.writeInt(if (value) 1 else 0, tag.first, ProtoIntegerType.DEFAULT)
override fun encodeTaggedChar(tag: ProtoDesc, value: Char) = encoder.writeInt(value.toInt(), tag.first, tag.second) override fun encodeTaggedChar(tag: ProtoDesc, value: Char) = encoder.writeInt(value.toInt(), tag.first, tag.second)
override fun encodeTaggedString(tag: ProtoDesc, value: String) = encoder.writeString(value, tag.first) override fun encodeTaggedString(tag: ProtoDesc, value: String) = encoder.writeString(value, tag.first)
override fun encodeTaggedEnum( override fun encodeTaggedEnum(
tag: ProtoDesc, tag: ProtoDesc,
enumDescription: SerialDescriptor, enumDescriptor: SerialDescriptor,
ordinal: Int ordinal: Int
) = encoder.writeInt( ) = encoder.writeInt(
extractParameters(enumDescription, ordinal, zeroBasedDefault = true).first, extractParameters(enumDescriptor, ordinal, zeroBasedDefault = true).first,
tag.first, tag.first,
ProtoNumberType.DEFAULT ProtoIntegerType.DEFAULT
) )
override fun SerialDescriptor.getTag(index: Int) = this.getProtoDesc(index) override fun SerialDescriptor.getTag(index: Int) = this.getProtoDesc(index)
@@ -129,8 +135,8 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
internal inner class MapRepeatedWriter(parentTag: ProtoDesc?, parentEncoder: ProtobufEncoder) : ObjectWriter(parentTag, parentEncoder) { internal inner class MapRepeatedWriter(parentTag: ProtoDesc?, parentEncoder: ProtobufEncoder) : ObjectWriter(parentTag, parentEncoder) {
override fun SerialDescriptor.getTag(index: Int): ProtoDesc = override fun SerialDescriptor.getTag(index: Int): ProtoDesc =
if (index % 2 == 0) 1 to (parentTag?.second ?: ProtoNumberType.DEFAULT) if (index % 2 == 0) 1 to (parentTag?.second ?: ProtoIntegerType.DEFAULT)
else 2 to (parentTag?.second ?: ProtoNumberType.DEFAULT) else 2 to (parentTag?.second ?: ProtoIntegerType.DEFAULT)
} }
internal inner class RepeatedWriter(encoder: ProtobufEncoder, private val curTag: ProtoDesc) : internal inner class RepeatedWriter(encoder: ProtobufEncoder, private val curTag: ProtoDesc) :
@@ -148,16 +154,16 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
out.write(bytes) out.write(bytes)
} }
fun writeInt(value: Int, tag: Int, format: ProtoNumberType) { fun writeInt(value: Int, tag: Int, format: ProtoIntegerType) {
val wireType = if (format == ProtoNumberType.FIXED) i32 else VARINT val wireType = if (format == ProtoIntegerType.FIXED) i32 else VARINT
val header = encode32((tag shl 3) or wireType) val header = encode32((tag shl 3) or wireType)
val content = encode32(value, format) val content = encode32(value, format)
out.write(header) out.write(header)
out.write(content) out.write(content)
} }
fun writeLong(value: Long, tag: Int, format: ProtoNumberType) { fun writeLong(value: Long, tag: Int, format: ProtoIntegerType) {
val wireType = if (format == ProtoNumberType.FIXED) i64 else VARINT val wireType = if (format == ProtoIntegerType.FIXED) i64 else VARINT
val header = encode32((tag shl 3) or wireType) val header = encode32((tag shl 3) or wireType)
val content = encode64(value, format) val content = encode64(value, format)
out.write(header) out.write(header)
@@ -184,19 +190,19 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
out.write(content) out.write(content)
} }
private fun encode32(number: Int, format: ProtoNumberType = ProtoNumberType.DEFAULT): ByteArray = private fun encode32(number: Int, format: ProtoIntegerType = ProtoIntegerType.DEFAULT): ByteArray =
when (format) { when (format) {
ProtoNumberType.FIXED -> ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(number).array() ProtoIntegerType.FIXED -> ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(number).array()
ProtoNumberType.DEFAULT -> encodeVarint(number.toLong()) ProtoIntegerType.DEFAULT -> encodeVarint(number.toLong())
ProtoNumberType.SIGNED -> encodeVarint(((number shl 1) xor (number shr 31))) ProtoIntegerType.SIGNED -> encodeVarint(((number shl 1) xor (number shr 31)))
} }
private fun encode64(number: Long, format: ProtoNumberType = ProtoNumberType.DEFAULT): ByteArray = private fun encode64(number: Long, format: ProtoIntegerType = ProtoIntegerType.DEFAULT): ByteArray =
when (format) { when (format) {
ProtoNumberType.FIXED -> ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(number).array() ProtoIntegerType.FIXED -> ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(number).array()
ProtoNumberType.DEFAULT -> encodeVarint(number) ProtoIntegerType.DEFAULT -> encodeVarint(number)
ProtoNumberType.SIGNED -> encodeVarint((number shl 1) xor (number shr 63)) ProtoIntegerType.SIGNED -> encodeVarint((number shl 1) xor (number shr 63))
} }
} }
@@ -204,6 +210,7 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
* Source for all varint operations: * Source for all varint operations:
* https://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/util/Varint.java * https://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/util/Varint.java
*/ */
@Suppress("unused")
internal object Varint { internal object Varint {
internal fun encodeVarint(inp: Int): ByteArray { internal fun encodeVarint(inp: Int): ByteArray {
var value = inp var value = inp
@@ -241,7 +248,8 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
} }
companion object : BinaryFormat { companion object : BinaryFormat {
override val context: SerialModule get() = plain.context override val serializersModule: SerializersModule
get() = plain.serializersModule
private fun SerialDescriptor.getProtoDesc(index: Int): ProtoDesc { private fun SerialDescriptor.getProtoDesc(index: Int): ProtoDesc {
return extractParameters(this, index) return extractParameters(this, index)
@@ -254,20 +262,24 @@ internal class ProtoBufWithNullableSupport(override val context: SerialModule =
private val plain = ProtoBufWithNullableSupport() private val plain = ProtoBufWithNullableSupport()
override fun <T> dump(serializer: SerializationStrategy<T>, value: T): ByteArray = plain.dump(serializer, value) override fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray {
override fun <T> load(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T = return plain.encodeToByteArray(serializer, value)
plain.load(deserializer, bytes) }
override fun <T> decodeFromByteArray(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T {
return plain.decodeFromByteArray(deserializer, bytes)
}
} }
override fun <T> dump(serializer: SerializationStrategy<T>, value: T): ByteArray { override fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray {
val encoder = ByteArrayOutputStream() val encoder = ByteArrayOutputStream()
val dumper = ProtobufWriter(ProtobufEncoder(encoder)) val dumper = ProtobufWriter(ProtobufEncoder(encoder))
dumper.encode(serializer, value) dumper.encodeSerializableValue(serializer, value)
return encoder.toByteArray() return encoder.toByteArray()
} }
override fun <T> load(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T { override fun <T> decodeFromByteArray(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T {
return ProtoBuf.load(deserializer, bytes) return ProtoBuf.decodeFromByteArray(deserializer, bytes)
} }
} }

View File

@@ -0,0 +1,70 @@
/*
* Copyright 2020 Him188.
*
* Use of this source code is governed by the Apache 2.0 license that can be found through the following link.
*
* https://github.com/him188/Tarskt/blob/master/LICENSE
*/
@file:Suppress("MemberVisibilityCanBePrivate", "unused")
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars
import kotlinx.io.charsets.Charset
import kotlinx.io.charsets.Charsets
import kotlinx.io.core.*
import kotlinx.serialization.*
import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal.TarsDecoder
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal.TarsInput
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal.TarsOld
import kotlin.jvm.JvmStatic
/**
* The main entry point to work with Tars serialization.
*/
@OptIn(ExperimentalSerializationApi::class)
internal class Tars(
override val serializersModule: SerializersModule = EmptySerializersModule,
val charset: Charset = Charsets.UTF_8
) : SerialFormat, BinaryFormat {
private val old = TarsOld(charset)
fun <T> dumpTo(serializer: SerializationStrategy<T>, ojb: T, output: Output) {
output.writePacket(old.dumpAsPacket(serializer, ojb))
}
fun <T> load(deserializer: DeserializationStrategy<T>, input: Input): T {
return TarsDecoder(TarsInput(input, charset), serializersModule).decodeSerializableValue(deserializer)
}
override fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray {
return buildPacket { dumpTo(serializer, value, this) }.readBytes()
}
override fun <T> decodeFromByteArray(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T {
return load(deserializer, ByteReadPacket(bytes))
}
companion object {
@JvmStatic
val UTF_8: Tars = Tars()
internal const val BYTE: Byte = 0
internal const val DOUBLE: Byte = 5
internal const val FLOAT: Byte = 4
internal const val INT: Byte = 2
internal const val Tars_MAX_STRING_LENGTH = 104857600
internal const val LIST: Byte = 9
internal const val LONG: Byte = 3
internal const val MAP: Byte = 8
internal const val SHORT: Byte = 1
internal const val SIMPLE_LIST: Byte = 13
internal const val STRING1: Byte = 6
internal const val STRING4: Byte = 7
internal const val STRUCT_BEGIN: Byte = 10
internal const val STRUCT_END: Byte = 11
internal const val ZERO_TYPE: Byte = 12
}
}

View File

@@ -0,0 +1,13 @@
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.SerialInfo
/**
* The serial id used in Tars serialization
*/
@OptIn(ExperimentalSerializationApi::class)
@SerialInfo
@Target(AnnotationTarget.PROPERTY)
internal annotation class TarsId(val id: Int)

View File

@@ -0,0 +1,333 @@
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("PrivatePropertyName")
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.InternalSerializationApi
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.AbstractDecoder
import kotlinx.serialization.encoding.CompositeDecoder
import kotlinx.serialization.internal.TaggedDecoder
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)
internal class TarsDecoder(
val input: TarsInput, override val serializersModule: SerializersModule
) : TaggedDecoder<TarsTag>() {
override fun SerialDescriptor.getTag(index: Int): TarsTag {
val annotations = this.getElementAnnotations(index)
val id = annotations.filterIsInstance<TarsId>().single().id
// ?: error("cannot find @TarsId or @ProtoNumber for ${this.getElementName(index)} in ${this.serialName}")
//println("getTag: ${this.getElementName(index)}=$id")
return TarsTagCommon(id)
}
private fun SerialDescriptor.getTarsTagId(index: Int): Int {
// higher performance, don't use filterIsInstance
val annotation = getElementAnnotations(index).firstOrNull { it is TarsId }
?: error("missing @TarsId for ${getElementName(index)} in ${this.serialName}")
return (annotation as TarsId).id
}
private val SimpleByteArrayReader: SimpleByteArrayReaderImpl = SimpleByteArrayReaderImpl()
private inner class SimpleByteArrayReaderImpl : AbstractDecoder() {
override fun decodeSequentially(): Boolean = true
override fun endStructure(descriptor: SerialDescriptor) {
this@TarsDecoder.endStructure(descriptor)
}
override fun beginStructure(descriptor: SerialDescriptor): CompositeDecoder {
this@TarsDecoder.pushTag(TarsTagListElement)
return this@TarsDecoder.beginStructure(descriptor)
}
override fun decodeByte(): Byte = input.input.readByte()
override fun decodeShort(): Short = error("illegal access")
override fun decodeInt(): Int = error("illegal access")
override fun decodeLong(): Long = error("illegal access")
override fun decodeFloat(): Float = error("illegal access")
override fun decodeDouble(): Double = error("illegal access")
override fun decodeBoolean(): Boolean = error("illegal access")
override fun decodeChar(): Char = error("illegal access")
override fun decodeEnum(enumDescriptor: SerialDescriptor): Int = error("illegal access")
override fun decodeString(): String = error("illegal access")
override fun decodeElementIndex(descriptor: SerialDescriptor): Int {
error("should not be reached")
}
override fun decodeCollectionSize(descriptor: SerialDescriptor): Int {
// 不要读下一个 head
return input.currentHead.let { input.readTarsIntValue(it) }
}
}
private val ListReader: ListReaderImpl = ListReaderImpl()
private inner class ListReaderImpl : AbstractDecoder() {
override fun decodeSequentially(): Boolean = true
override fun decodeElementIndex(descriptor: SerialDescriptor): Int = error("should not be reached")
override fun endStructure(descriptor: SerialDescriptor) {
this@TarsDecoder.endStructure(descriptor)
}
override fun beginStructure(descriptor: SerialDescriptor): CompositeDecoder {
this@TarsDecoder.pushTag(TarsTagListElement)
return this@TarsDecoder.beginStructure(descriptor)
}
override fun decodeByte(): Byte = input.useHead { input.readTarsByteValue(it) }
override fun decodeShort(): Short = input.useHead { input.readTarsShortValue(it) }
override fun decodeInt(): Int = input.useHead { input.readTarsIntValue(it) }
override fun decodeLong(): Long = input.useHead { input.readTarsLongValue(it) }
override fun decodeFloat(): Float = input.useHead { input.readTarsFloatValue(it) }
override fun decodeDouble(): Double = input.useHead { input.readTarsDoubleValue(it) }
override fun decodeBoolean(): Boolean = input.useHead { input.readTarsBooleanValue(it) }
override fun decodeChar(): Char = decodeByte().toChar()
override fun decodeEnum(enumDescriptor: SerialDescriptor): Int = decodeInt()
override fun decodeString(): String = input.useHead { input.readTarsStringValue(it) }
override fun decodeCollectionSize(descriptor: SerialDescriptor): Int {
//println("decodeCollectionSize: ${descriptor.serialName}")
// 不读下一个 head
return input.useHead { input.readTarsIntValue(it) }
}
}
private val MapReader: MapReaderImpl = MapReaderImpl()
private inner class MapReaderImpl : AbstractDecoder() {
override fun decodeSequentially(): Boolean = true
override fun decodeElementIndex(descriptor: SerialDescriptor): Int = error("stub")
override fun endStructure(descriptor: SerialDescriptor) {
this@TarsDecoder.endStructure(descriptor)
}
override fun beginStructure(descriptor: SerialDescriptor): CompositeDecoder {
println { "MapReader.beginStructure: ${input.currentHead}" }
this@TarsDecoder.pushTag(
when (input.currentHead.tag) {
0 -> TarsTagMapEntryKey
1 -> TarsTagMapEntryValue
else -> error("illegal map entry head: ${input.currentHead.tag}")
}
)
return this@TarsDecoder.beginStructure(descriptor)
}
override fun decodeByte(): Byte = input.useHead { input.readTarsByteValue(it) }
override fun decodeShort(): Short = input.useHead { input.readTarsShortValue(it) }
override fun decodeInt(): Int = input.useHead { input.readTarsIntValue(it) }
override fun decodeLong(): Long = input.useHead { input.readTarsLongValue(it) }
override fun decodeFloat(): Float = input.useHead { input.readTarsFloatValue(it) }
override fun decodeDouble(): Double = input.useHead { input.readTarsDoubleValue(it) }
override fun decodeBoolean(): Boolean = input.useHead { input.readTarsBooleanValue(it) }
override fun decodeChar(): Char = decodeByte().toChar()
override fun decodeEnum(enumDescriptor: SerialDescriptor): Int = decodeInt()
override fun decodeString(): String = input.useHead { input.readTarsStringValue(it) }
override fun decodeCollectionSize(descriptor: SerialDescriptor): Int {
println { "decodeCollectionSize in MapReader: ${descriptor.serialName}" }
// 不读下一个 head
return input.useHead { input.readTarsIntValue(it) }
}
}
override fun endStructure(descriptor: SerialDescriptor) {
structureHierarchy--
println { "endStructure: ${descriptor.serialName}" }
if (currentTagOrNull?.isSimpleByteArray == true) {
input.prepareNextHead() // read to next head
}
if (descriptor.kind == StructureKind.CLASS) {
if (currentTagOrNull == null) {
return
}
while (true) {
val currentHead = input.currentHeadOrNull ?: return
if (currentHead.type == Tars.STRUCT_END) {
input.prepareNextHead()
//println("current end")
break
}
//println("current $currentHead")
input.skipField(currentHead.type)
input.prepareNextHead()
}
// pushTag(TarsTag(0, true))
// skip STRUCT_END
// popTag()
}
}
companion object {
@Suppress("MemberVisibilityCanBePrivate")
var debuggingMode: Boolean = false
var structureHierarchy: Int = 0
inline fun println(value: () -> String) {
if (debuggingMode) {
kotlin.io.println(" ".repeat(structureHierarchy) + value())
}
}
@Suppress("NOTHING_TO_INLINE")
inline fun println(value: Any? = "") {
if (debuggingMode) {
kotlin.io.println(" ".repeat(structureHierarchy) + value)
}
}
}
override fun beginStructure(descriptor: SerialDescriptor): CompositeDecoder {
println()
println { "beginStructure: ${descriptor.serialName}" }
structureHierarchy++
return when (descriptor.kind) {
is PrimitiveKind -> this@TarsDecoder
StructureKind.MAP -> {
//println("!! MAP")
val tag = popTag()
return input.skipToHeadAndUseIfPossibleOrFail(tag.id) {
it.checkType(Tars.MAP, "beginStructure", tag, descriptor)
MapReader
}
}
StructureKind.LIST -> {
//println("!! ByteArray")
//println("decoderTag: $currentTagOrNull")
//println("TarsHead: " + Tars.currentHeadOrNull)
return input.skipToHeadAndUseIfPossibleOrFail(currentTag.id) {
// don't check type. it's polymorphic
//println("listHead: $it")
when (it.type) {
Tars.SIMPLE_LIST -> {
currentTag.isSimpleByteArray = true
input.nextHead() // 无用的元素类型
SimpleByteArrayReader
}
Tars.LIST -> ListReader
else -> error("type mismatch. Expected SIMPLE_LIST or LIST, got $it instead")
}
}
}
StructureKind.CLASS -> {
currentTagOrNull ?: return this@TarsDecoder // outermost
//println("!! CLASS")
//println("decoderTag: $currentTag")
//println("TarsHead: " + Tars.currentHeadOrNull)
val tag = popTag()
return input.skipToHeadAndUseIfPossibleOrFail(tag.id) { TarsHead ->
TarsHead.checkType(Tars.STRUCT_BEGIN, "beginStructure", tag, descriptor)
repeat(descriptor.elementsCount) {
pushTag(descriptor.getTag(descriptor.elementsCount - it - 1)) // better performance
}
this // independent tag stack
}
}
StructureKind.OBJECT -> error("unsupported StructureKind.OBJECT: ${descriptor.serialName}")
is SerialKind.ENUM -> error("unsupported UnionKind: ${descriptor.serialName}")
is PolymorphicKind -> error("unsupported PolymorphicKind: ${descriptor.serialName}")
is SerialKind.CONTEXTUAL -> error("unsupported PolymorphicKind: ${descriptor.serialName}")
}
}
override fun decodeSequentially(): Boolean = false
override fun decodeElementIndex(descriptor: SerialDescriptor): Int {
var tarsHead = input.currentHeadOrNull ?: kotlin.run {
println("decodeElementIndex: currentHead == null")
return CompositeDecoder.DECODE_DONE
}
println { "decodeElementIndex: ${input.currentHead}" }
while (!input.input.endOfInput) {
if (tarsHead.type == Tars.STRUCT_END) {
println { "decodeElementIndex: ${input.currentHead}" }
return CompositeDecoder.DECODE_DONE
}
repeat(descriptor.elementsCount) {
val tag = descriptor.getTarsTagId(it)
if (tag == tarsHead.tag) {
println {
"name=" + descriptor.getElementName(
it
)
}
return it
}
}
input.skipField(tarsHead.type)
if (!input.prepareNextHead()) {
println { "decodeElementIndex EOF" }
break
}
tarsHead = input.currentHead
println { "next! $tarsHead" }
}
return CompositeDecoder.DECODE_DONE // optional support
}
override fun decodeTaggedInt(tag: TarsTag): Int =
kotlin.runCatching { input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsIntValue(it) } }.getOrElse {
throw IllegalStateException("$tag", it)
}
override fun decodeTaggedByte(tag: TarsTag): Byte =
kotlin.runCatching { input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsByteValue(it) } }.getOrElse {
throw IllegalStateException("$tag", it)
}
override fun decodeTaggedBoolean(tag: TarsTag): Boolean =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsBooleanValue(it) }
override fun decodeTaggedFloat(tag: TarsTag): Float =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsFloatValue(it) }
override fun decodeTaggedDouble(tag: TarsTag): Double =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsDoubleValue(it) }
override fun decodeTaggedShort(tag: TarsTag): Short =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsShortValue(it) }
override fun decodeTaggedLong(tag: TarsTag): Long =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsLongValue(it) }
override fun decodeTaggedString(tag: TarsTag): String =
input.skipToHeadAndUseIfPossibleOrFail(tag.id) { input.readTarsStringValue(it) }
override fun decodeTaggedNotNullMark(tag: TarsTag): Boolean {
return input.skipToHeadOrNull(tag.id) != null
}
}

View File

@@ -0,0 +1,260 @@
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal
import kotlinx.io.charsets.Charset
import kotlinx.io.core.*
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars
/**
* Tars Input. 需要手动管理 head.
*/
internal class TarsInput(
val input: Input, private val charset: Charset
) {
private var _head: TarsHead? = null
val currentHead: TarsHead get() = _head ?: throw EOFException("No current TarsHead available")
val currentHeadOrNull: TarsHead? get() = _head
init {
prepareNextHead()
}
/**
* 读取下一个 [TarsHead] 并保存. 可通过 [currentHead] 获取这个 [TarsHead].
*
* @return 是否成功读取. 返回 `false` 时代表 [Input.endOfInput]
*/
fun prepareNextHead(): Boolean {
return readNextHeadButDoNotAssignTo_Head().also { _head = it; } != null
}
fun nextHead(): TarsHead {
if (!prepareNextHead()) {
throw EOFException("No more TarsHead available")
}
return currentHead
}
/**
* 直接读取下一个 [TarsHead] 并返回.
* 返回 `null` 则代表 [Input.endOfInput]
*/
@Suppress("FunctionName")
@OptIn(ExperimentalUnsignedTypes::class)
private fun readNextHeadButDoNotAssignTo_Head(): TarsHead? {
if (input.endOfInput) {
return null
}
val var2 = input.readUByte()
val type = var2 and 15u
var tag = var2.toUInt() shr 4
if (tag == 15u) {
tag = input.readUByte().toUInt()
}
return TarsHead(
tag = tag.toInt(),
type = type.toByte()
)
}
/**
* 使用这个 [TarsHead].
* [block] 结束后将会 [准备下一个 [TarsHead]][prepareNextHead]
*/
inline fun <R> useHead(crossinline block: (TarsHead) -> R): R {
return currentHead.let(block).also { prepareNextHead() }
}
/**
* 跳过 [TarsHead] 和对应的数据值, 直到找到 [tag], 否则返回 `null`
*/
inline fun <R> skipToHeadAndUseIfPossibleOrNull(tag: Int, crossinline block: (TarsHead) -> R): R? {
return skipToHeadOrNull(tag)?.let(block).also { prepareNextHead() }
}
/**
* 跳过 [TarsHead] 和对应的数据值, 直到找到 [tag], 否则抛出异常
*/
inline fun <R : Any> skipToHeadAndUseIfPossibleOrFail(
tag: Int,
crossinline message: () -> String = { "tag not found: $tag" },
crossinline block: (TarsHead) -> R
): R {
return checkNotNull<R>(skipToHeadAndUseIfPossibleOrNull(tag, block), message)
}
tailrec fun skipToHeadOrNull(tag: Int): TarsHead? {
val current: TarsHead = currentHeadOrNull ?: return null // no backing field
return when {
current.tag > tag -> null // tag 大了,即找不到
current.tag == tag -> current // 满足需要.
else -> { // tag 小了
skipField(current.type)
check(prepareNextHead()) { "cannot skip to tag $tag, early EOF" }
skipToHeadOrNull(tag)
}
}
}
@OptIn(ExperimentalUnsignedTypes::class)
@PublishedApi
internal fun skipField(type: Byte) {
TarsDecoder.println {
"skipping ${
TarsHead.findTarsTypeName(
type
)
}"
}
when (type) {
Tars.BYTE -> this.input.discardExact(1)
Tars.SHORT -> this.input.discardExact(2)
Tars.INT -> this.input.discardExact(4)
Tars.LONG -> this.input.discardExact(8)
Tars.FLOAT -> this.input.discardExact(4)
Tars.DOUBLE -> this.input.discardExact(8)
Tars.STRING1 -> this.input.discardExact(this.input.readUByte().toInt())
Tars.STRING4 -> this.input.discardExact(this.input.readInt())
Tars.MAP -> { // map
TarsDecoder.structureHierarchy++
var count = 0
nextHead() // avoid shadowing, don't remove
repeat(skipToHeadAndUseIfPossibleOrFail(0, message = { "tag 0 not found when skipping map" }) { head ->
readTarsIntValue(head).also { count = it * 2 }
} * 2) {
skipField(currentHead.type)
if (it != count - 1) { // don't read last head
nextHead()
}
}
TarsDecoder.structureHierarchy--
}
Tars.LIST -> { // list
TarsDecoder.structureHierarchy++
var count = 0
nextHead() // avoid shadowing, don't remove
repeat(skipToHeadAndUseIfPossibleOrFail(0, message = { "tag 0 not found when skipping list" }) { head ->
readTarsIntValue(head).also { count = it }
}) {
skipField(currentHead.type)
if (it != count - 1) { // don't read last head
nextHead()
}
}
if (count == 0) {
}
TarsDecoder.structureHierarchy--
}
Tars.STRUCT_BEGIN -> {
TarsDecoder.structureHierarchy++
var head: TarsHead
do {
head = nextHead()
skipField(head.type)
} while (head.type != Tars.STRUCT_END)
TarsDecoder.structureHierarchy--
}
Tars.STRUCT_END, Tars.ZERO_TYPE -> {
}
Tars.SIMPLE_LIST -> {
TarsDecoder.structureHierarchy++
var head = nextHead()
check(head.type == Tars.BYTE) { "bad simple list element type: " + head.type }
check(head.tag == 0) { "simple list element tag must be 0, but was ${head.tag}" }
head = nextHead()
check(head.tag == 0) { "tag for size for simple list must be 0, but was ${head.tag}" }
this.input.discardExact(readTarsIntValue(head))
TarsDecoder.structureHierarchy--
}
else -> error("invalid type: $type")
}
}
// region readers
fun readTarsIntValue(head: TarsHead): Int {
//println("readTarsIntValue: $head")
return when (head.type) {
Tars.ZERO_TYPE -> 0
Tars.BYTE -> input.readByte().toInt()
Tars.SHORT -> input.readShort().toInt()
Tars.INT -> input.readInt()
else -> error("type mismatch: $head")
}
}
fun readTarsShortValue(head: TarsHead): Short {
return when (head.type) {
Tars.ZERO_TYPE -> 0
Tars.BYTE -> input.readByte().toShort()
Tars.SHORT -> input.readShort()
else -> error("type mismatch: $head")
}
}
fun readTarsLongValue(head: TarsHead): Long {
return when (head.type) {
Tars.ZERO_TYPE -> 0
Tars.BYTE -> input.readByte().toLong()
Tars.SHORT -> input.readShort().toLong()
Tars.INT -> input.readInt().toLong()
Tars.LONG -> input.readLong()
else -> error("type mismatch ${head.type}")
}
}
fun readTarsByteValue(head: TarsHead): Byte {
//println("readTarsByteValue: $head")
return when (head.type) {
Tars.ZERO_TYPE -> 0
Tars.BYTE -> input.readByte()
else -> error("type mismatch: $head")
}
}
fun readTarsFloatValue(head: TarsHead): Float {
return when (head.type) {
Tars.ZERO_TYPE -> 0f
Tars.FLOAT -> input.readFloat()
else -> error("type mismatch: $head")
}
}
@OptIn(ExperimentalUnsignedTypes::class)
fun readTarsStringValue(head: TarsHead): String {
//println("readTarsStringValue: $head")
return when (head.type) {
Tars.STRING1 -> input.readString(input.readUByte().toInt(), charset = charset)
Tars.STRING4 -> input.readString(
input.readUInt().toInt().also { require(it in 1 until 104857600) { "bad string length: $it" } },
charset = charset
)
else -> error("type mismatch: $head, expecting 6 or 7 (for string)")
}
}
fun readTarsDoubleValue(head: TarsHead): Double {
return when (head.type.toInt()) {
12 -> 0.0
4 -> input.readFloat().toDouble()
5 -> input.readDouble()
else -> error("type mismatch: $head")
}
}
fun readTarsBooleanValue(head: TarsHead): Boolean {
return readTarsByteValue(head) == 1.toByte()
}
}

View File

@@ -0,0 +1,324 @@
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal
import kotlinx.io.charsets.Charset
import kotlinx.io.charsets.Charsets
import kotlinx.io.core.*
import kotlinx.serialization.*
import kotlinx.serialization.builtins.MapEntrySerializer
import kotlinx.serialization.builtins.SetSerializer
import kotlinx.serialization.descriptors.PolymorphicKind
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.descriptors.StructureKind
import kotlinx.serialization.encoding.CompositeEncoder
import kotlinx.serialization.internal.MapLikeSerializer
import kotlinx.serialization.internal.TaggedEncoder
import kotlinx.serialization.modules.EmptySerializersModule
import kotlinx.serialization.modules.SerializersModule
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.BYTE
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.DOUBLE
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.FLOAT
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.INT
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.LIST
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.LONG
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.MAP
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.SHORT
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.SIMPLE_LIST
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.STRING1
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.STRING4
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.STRUCT_BEGIN
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.STRUCT_END
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.Tars_MAX_STRING_LENGTH
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars.Companion.ZERO_TYPE
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.TarsId
@OptIn(ExperimentalSerializationApi::class)
internal inline fun <reified A : Annotation> SerialDescriptor.findAnnotation(elementIndex: Int): A? {
val candidates = getElementAnnotations(elementIndex).filterIsInstance<A>()
return when (candidates.size) {
0 -> null
1 -> candidates[0]
else -> throw IllegalStateException("There are duplicate annotations of type ${A::class} in the descriptor $this")
}
}
internal fun getSerialId(desc: SerialDescriptor, index: Int): Int? = desc.findAnnotation<TarsId>(index)?.id
//@Suppress("DEPRECATION_ERROR")
@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)
internal class TarsOld internal constructor(private val charset: Charset, override val serializersModule: SerializersModule = EmptySerializersModule) :
SerialFormat, BinaryFormat {
private inner class ListWriter(
private val count: Int,
private val tag: Int,
private val parentEncoder: TarsEncoder
) : TarsEncoder(BytePacketBuilder()) {
override fun SerialDescriptor.getTag(index: Int): Int {
return 0
}
override fun endEncode(descriptor: SerialDescriptor) {
parentEncoder.writeHead(LIST, this.tag)
parentEncoder.encodeTaggedInt(0, count)
parentEncoder.output.writePacket(this.output.build())
}
}
private inner class TarsMapWriter(
output: BytePacketBuilder
) : TarsEncoder(output) {
override fun SerialDescriptor.getTag(index: Int): Int {
return if (index % 2 == 0) 0 else 1
}
/*
override fun endEncode(desc: SerialDescriptor) {
parentEncoder.writeHead(MAP, this.tag)
parentEncoder.encodeTaggedInt(Int.STUB_FOR_PRIMITIVE_NUMBERS_GBK, count)
// println(this.output.toByteArray().toUHexString())
parentEncoder.output.write(this.output.toByteArray())
}*/
}
/**
* From: com.qq.taf.Tars.TarsOutputStream
*/
@Suppress("unused", "MemberVisibilityCanBePrivate")
@OptIn(ExperimentalIoApi::class)
private open inner class TarsEncoder(
val output: BytePacketBuilder
) : TaggedEncoder<Int>() {
override val serializersModule get() = this@TarsOld.serializersModule
override fun SerialDescriptor.getTag(index: Int): Int {
return getSerialId(this, index) ?: error("cannot find @SerialId")
}
/**
* 序列化最开始的时候的
*/
override fun beginStructure(
descriptor: SerialDescriptor
): CompositeEncoder =
when (descriptor.kind) {
StructureKind.LIST -> this
StructureKind.MAP -> this
StructureKind.CLASS, StructureKind.OBJECT -> this
is PolymorphicKind -> this
else -> throw SerializationException("Primitives are not supported at top-level")
}
@Suppress("UNCHECKED_CAST", "NAME_SHADOWING")
override fun <T> encodeSerializableValue(serializer: SerializationStrategy<T>, value: T) = when {
serializer.descriptor.kind == StructureKind.MAP -> {
try {
val entries = (value as Map<*, *>).entries
val serializer = (serializer as MapLikeSerializer<Any?, Any?, T, *>)
val mapEntrySerial = MapEntrySerializer(serializer.keySerializer, serializer.valueSerializer)
this.writeHead(MAP, currentTag)
this.encodeTaggedInt(0, entries.count())
SetSerializer(mapEntrySerial).serialize(TarsMapWriter(this.output), entries)
} catch (e: Exception) {
super.encodeSerializableValue(serializer, value)
}
}
serializer.descriptor.kind == StructureKind.LIST
&& value is ByteArray -> encodeTaggedByteArray(popTag(), value as ByteArray)
serializer.descriptor.kind == StructureKind.LIST
&& serializer.descriptor.getElementDescriptor(0) is PrimitiveKind -> {
serializer.serialize(
ListWriter(
when (value) {
is ShortArray -> value.size
is IntArray -> value.size
is LongArray -> value.size
is FloatArray -> value.size
is DoubleArray -> value.size
is CharArray -> value.size
is ByteArray -> value.size
is BooleanArray -> value.size
else -> error("unknown array type: ${value.getClassName()}")
}, popTag(), this
),
value
)
}
serializer.descriptor.kind == StructureKind.LIST && value is Array<*> -> {
if (serializer.descriptor.getElementDescriptor(0).kind is PrimitiveKind.BYTE) {
encodeTaggedByteArray(popTag(), (value as Array<Byte>).toByteArray())
} else
serializer.serialize(
ListWriter((value as Array<*>).size, popTag(), this),
value
)
}
serializer.descriptor.kind == StructureKind.LIST -> {
serializer.serialize(
ListWriter((value as Collection<*>).size, popTag(), this),
value
)
}
serializer.descriptor.kind == StructureKind.CLASS -> {
if (currentTagOrNull == null) {
serializer.serialize(this, value)
} else {
this.writeHead(STRUCT_BEGIN, popTag())
serializer.serialize(TarsEncoder(this.output), value)
this.writeHead(STRUCT_END, 0)
}
}
else -> {
serializer.serialize(this, value)
}
}
public override fun encodeTaggedByte(tag: Int, value: Byte) {
if (value.toInt() == 0) {
writeHead(ZERO_TYPE, tag)
} else {
writeHead(BYTE, tag)
output.writeByte(value)
}
}
public override fun encodeTaggedShort(tag: Int, value: Short) {
if (value in Byte.MIN_VALUE..Byte.MAX_VALUE) {
encodeTaggedByte(tag, value.toByte())
} else {
writeHead(SHORT, tag)
output.writeShort(value)
}
}
public override fun encodeTaggedInt(tag: Int, value: Int) {
if (value in Short.MIN_VALUE..Short.MAX_VALUE) {
encodeTaggedShort(tag, value.toShort())
} else {
writeHead(INT, tag)
output.writeInt(value)
}
}
public override fun encodeTaggedFloat(tag: Int, value: Float) {
writeHead(FLOAT, tag)
output.writeFloat(value)
}
public override fun encodeTaggedDouble(tag: Int, value: Double) {
writeHead(DOUBLE, tag)
output.writeDouble(value)
}
public override fun encodeTaggedLong(tag: Int, value: Long) {
if (value in Int.MIN_VALUE..Int.MAX_VALUE) {
encodeTaggedInt(tag, value.toInt())
} else {
writeHead(LONG, tag)
output.writeLong(value)
}
}
public override fun encodeTaggedBoolean(tag: Int, value: Boolean) {
encodeTaggedByte(tag, if (value) 1 else 0)
}
public override fun encodeTaggedChar(tag: Int, value: Char) {
encodeTaggedByte(tag, value.toByte())
}
public override fun encodeTaggedEnum(tag: Int, enumDescriptor: SerialDescriptor, ordinal: Int) {
encodeTaggedInt(tag, ordinal)
}
public override fun encodeTaggedNull(tag: Int) {
}
fun encodeTaggedByteArray(tag: Int, bytes: ByteArray) {
writeHead(SIMPLE_LIST, tag)
writeHead(BYTE, 0)
encodeTaggedInt(0, bytes.size)
output.writeFully(bytes)
}
public override fun encodeTaggedString(tag: Int, value: String) {
require(value.length <= Tars_MAX_STRING_LENGTH) { "string is too long for tag $tag" }
val array = value.toByteArray(charset)
if (array.size > 255) {
writeHead(STRING4, tag)
output.writeInt(array.size)
output.writeFully(array)
} else {
writeHead(STRING1, tag)
output.writeByte(array.size.toByte()) // one byte
output.writeFully(array)
}
}
override fun encodeTaggedValue(tag: Int, value: Any) {
when (value) {
is Byte -> encodeTaggedByte(tag, value)
is Short -> encodeTaggedShort(tag, value)
is Int -> encodeTaggedInt(tag, value)
is Long -> encodeTaggedLong(tag, value)
is Float -> encodeTaggedFloat(tag, value)
is Double -> encodeTaggedDouble(tag, value)
is Boolean -> encodeTaggedBoolean(tag, value)
is String -> encodeTaggedString(tag, value)
is Unit -> {
}
else -> error("unsupported type: ${value.getClassName()}")
}
}
fun writeHead(type: Byte, tag: Int) {
if (tag < 15) {
this.output.writeByte(((tag shl 4) or type.toInt()).toByte())
return
}
if (tag < 256) {
this.output.writeByte((type.toInt() or 0xF0).toByte())
this.output.writeByte(tag.toByte())
return
}
error("tag is too large: $tag")
}
}
@Suppress("MemberVisibilityCanBePrivate")
companion object : BinaryFormat by TarsOld(Charsets.UTF_8) {
private fun Any?.getClassName(): String =
(if (this == null) Unit::class else this::class).simpleName?.split(".")?.takeLast(2)?.joinToString(".")
?: "<unnamed class>"
}
fun <T> dumpAsPacket(serializer: SerializationStrategy<T>, obj: T): ByteReadPacket {
val encoder = BytePacketBuilder()
val dumper = TarsEncoder(encoder)
dumper.encodeSerializableValue(serializer, obj)
return encoder.build()
}
override fun <T> encodeToByteArray(serializer: SerializationStrategy<T>, value: T): ByteArray {
return dumpAsPacket(serializer, value).readBytes()
}
override fun <T> decodeFromByteArray(deserializer: DeserializationStrategy<T>, bytes: ByteArray): T {
error("Use TarsNew.")
}
}
internal fun Input.readString(length: Int, charset: Charset = Charsets.UTF_8): String =
String(this.readBytes(length), charset = charset)

View File

@@ -0,0 +1,107 @@
/*
* Copyright 2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
package net.mamoe.mirai.qqandroid.utils.io.serialization.tars.internal
import kotlinx.io.core.Output
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.descriptors.SerialDescriptor
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars
internal abstract class TarsTag {
abstract val id: Int
internal var isSimpleByteArray: Boolean = false
}
internal object TarsTagListElement : TarsTag() {
override val id: Int get() = 0
override fun toString(): String {
return "TarsTagListElement"
}
}
internal object TarsTagMapEntryKey : TarsTag() {
override val id: Int get() = 0
override fun toString(): String {
return "TarsTagMapEntryKey"
}
}
internal object TarsTagMapEntryValue : TarsTag() {
override val id: Int get() = 1
override fun toString(): String {
return "TarsTagMapEntryValue"
}
}
internal data class TarsTagCommon(
override val id: Int
) : TarsTag()
@OptIn(ExperimentalSerializationApi::class)
internal fun TarsHead.checkType(type: Byte, message: String, tag: TarsTag, descriptor: SerialDescriptor) {
check(this.type == type) {
"type mismatch. " +
"Expected ${TarsHead.findTarsTypeName(type)}, " +
"actual ${TarsHead.findTarsTypeName(this.type)} for $message. " +
"Tag info: " +
"id=${tag.id}, " +
"name=${descriptor.getElementName(tag.id)} " +
"in ${descriptor.serialName}"
}
}
@PublishedApi
internal fun Output.writeTarsHead(type: Byte, tag: Int) {
if (tag < 15) {
writeByte(((tag shl 4) or type.toInt()).toByte())
return
}
if (tag < 256) {
writeByte((type.toInt() or 0xF0).toByte())
writeByte(tag.toByte())
return
}
error("tag is too large: $tag")
}
@OptIn(ExperimentalUnsignedTypes::class)
internal class TarsHead(private val value: Long) {
constructor(tag: Int, type: Byte) : this(tag.toLong().shl(32) or type.toLong())
val tag: Int get() = (value ushr 32).toInt()
val type: Byte get() = value.toUInt().toByte()
override fun toString(): String {
return "TarsHead(tag=$tag, type=$type(${findTarsTypeName(type)}))"
}
companion object {
fun findTarsTypeName(type: Byte): String {
return when (type) {
Tars.BYTE -> "Byte"
Tars.DOUBLE -> "Double"
Tars.FLOAT -> "Float"
Tars.INT -> "Int"
Tars.LIST -> "List"
Tars.LONG -> "Long"
Tars.MAP -> "Map"
Tars.SHORT -> "Short"
Tars.SIMPLE_LIST -> "SimpleList"
Tars.STRING1 -> "String1"
Tars.STRING4 -> "String4"
Tars.STRUCT_BEGIN -> "StructBegin"
Tars.STRUCT_END -> "StructEnd"
Tars.ZERO_TYPE -> "Zero"
else -> error("illegal Tars type: $type")
}
}
}
}

View File

@@ -14,15 +14,15 @@ package net.mamoe.mirai.qqandroid.utils.io.serialization
import kotlinx.io.core.* import kotlinx.io.core.*
import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerialDescriptor
import kotlinx.serialization.SerializationStrategy import kotlinx.serialization.SerializationStrategy
import moe.him188.jcekt.Jce import kotlinx.serialization.descriptors.SerialDescriptor
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion2 import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion2
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3 import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestDataVersion3
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket
import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.JceStruct
import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.readPacketExact import net.mamoe.mirai.qqandroid.utils.io.readPacketExact
import net.mamoe.mirai.qqandroid.utils.io.serialization.tars.Tars
import net.mamoe.mirai.qqandroid.utils.read import net.mamoe.mirai.qqandroid.utils.read
import kotlin.jvm.JvmMultifileClass import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
@@ -34,20 +34,20 @@ internal fun <T : JceStruct> ByteArray.loadWithUniPacket(
internal fun <T : JceStruct> ByteArray.loadAs( internal fun <T : JceStruct> ByteArray.loadAs(
deserializer: DeserializationStrategy<T> deserializer: DeserializationStrategy<T>
): T = this.read { Jce.UTF_8.load(deserializer, this) } ): T = this.read { Tars.UTF_8.load(deserializer, this) }
internal fun <T : JceStruct> BytePacketBuilder.writeJceStruct( internal fun <T : JceStruct> BytePacketBuilder.writeJceStruct(
serializer: SerializationStrategy<T>, serializer: SerializationStrategy<T>,
struct: T struct: T
) { ) {
Jce.UTF_8.dumpTo(serializer, struct, this) Tars.UTF_8.dumpTo(serializer, struct, this)
} }
internal fun <T : JceStruct> ByteReadPacket.readJceStruct( internal fun <T : JceStruct> ByteReadPacket.readJceStruct(
serializer: DeserializationStrategy<T>, serializer: DeserializationStrategy<T>,
length: Int = this.remaining.toInt() length: Int = this.remaining.toInt()
): T { ): T {
return Jce.UTF_8.load(serializer, this.readPacketExact(length)) return Tars.UTF_8.load(serializer, this.readPacketExact(length))
} }
/** /**
@@ -99,7 +99,7 @@ private fun <R> ByteReadPacket.decodeUniRequestPacketAndDeserialize(name: String
internal fun <T : JceStruct> T.toByteArray( internal fun <T : JceStruct> T.toByteArray(
serializer: SerializationStrategy<T> serializer: SerializationStrategy<T>
): ByteArray = Jce.UTF_8.dump(serializer, this) ): ByteArray = Tars.UTF_8.encodeToByteArray(serializer, this)
internal fun <T : ProtoBuf> BytePacketBuilder.writeProtoBuf(serializer: SerializationStrategy<T>, v: T) { internal fun <T : ProtoBuf> BytePacketBuilder.writeProtoBuf(serializer: SerializationStrategy<T>, v: T) {
this.writeFully(v.toByteArray(serializer)) this.writeFully(v.toByteArray(serializer))
@@ -109,14 +109,14 @@ internal fun <T : ProtoBuf> BytePacketBuilder.writeProtoBuf(serializer: Serializ
* dump * dump
*/ */
internal fun <T : ProtoBuf> T.toByteArray(serializer: SerializationStrategy<T>): ByteArray { internal fun <T : ProtoBuf> T.toByteArray(serializer: SerializationStrategy<T>): ByteArray {
return ProtoBufWithNullableSupport.dump(serializer, this) return ProtoBufWithNullableSupport.encodeToByteArray(serializer, this)
} }
/** /**
* load * load
*/ */
internal fun <T : ProtoBuf> ByteArray.loadAs(deserializer: DeserializationStrategy<T>): T { internal fun <T : ProtoBuf> ByteArray.loadAs(deserializer: DeserializationStrategy<T>): T {
return ProtoBufWithNullableSupport.load(deserializer, this) return ProtoBufWithNullableSupport.decodeFromByteArray(deserializer, this)
} }
/** /**
@@ -125,7 +125,7 @@ internal fun <T : ProtoBuf> ByteArray.loadAs(deserializer: DeserializationStrate
internal fun <T : ProtoBuf> ByteReadPacket.readProtoBuf( internal fun <T : ProtoBuf> ByteReadPacket.readProtoBuf(
serializer: DeserializationStrategy<T>, serializer: DeserializationStrategy<T>,
length: Int = this.remaining.toInt() length: Int = this.remaining.toInt()
): T = ProtoBufWithNullableSupport.load(serializer, this.readBytes(length)) ): T = ProtoBufWithNullableSupport.decodeFromByteArray(serializer, this.readBytes(length))
/** /**
* 构造 [RequestPacket] 的 [RequestPacket.sBuffer] * 构造 [RequestPacket] 的 [RequestPacket.sBuffer]

View File

@@ -21,13 +21,13 @@ import net.mamoe.mirai.utils.Context
* QQ for Android * QQ for Android
*/ */
@Suppress("INAPPLICABLE_JVM_NAME") @Suppress("INAPPLICABLE_JVM_NAME")
actual object QQAndroid : BotFactory { public actual object QQAndroid : BotFactory {
/** /**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
actual override fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration): Bot { public actual override fun Bot(context: Context, qq: Long, password: String, configuration: BotConfiguration): Bot {
return QQAndroidBot(context, BotAccount(qq, password), configuration) return QQAndroidBot(context, BotAccount(qq, password), configuration)
} }
@@ -35,14 +35,14 @@ actual object QQAndroid : BotFactory {
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
fun Bot(qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot = public fun Bot(qq: Long, password: String, configuration: BotConfiguration = BotConfiguration.Default): Bot =
QQAndroidBot(BotAccount(qq, password), configuration) QQAndroidBot(BotAccount(qq, password), configuration)
/** /**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
actual override fun Bot( public actual override fun Bot(
context: Context, context: Context,
qq: Long, qq: Long,
passwordMd5: ByteArray, passwordMd5: ByteArray,
@@ -53,7 +53,7 @@ actual object QQAndroid : BotFactory {
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
fun Bot( public fun Bot(
qq: Long, qq: Long,
passwordMd5: ByteArray, passwordMd5: ByteArray,
configuration: BotConfiguration configuration: BotConfiguration
@@ -63,5 +63,5 @@ actual object QQAndroid : BotFactory {
/** /**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
inline fun QQAndroid.Bot(qq: Long, password: String, configuration: (BotConfiguration.() -> Unit)): Bot = public inline fun QQAndroid.Bot(qq: Long, password: String, configuration: (BotConfiguration.() -> Unit)): Bot =
this.Bot(qq, password, BotConfiguration().apply(configuration)) this.Bot(qq, password, BotConfiguration().apply(configuration))

View File

@@ -90,9 +90,11 @@ internal actual class PlatformSocket : Closeable {
} }
} }
actual typealias NoRouteToHostException = java.net.NoRouteToHostException @Suppress("ACTUAL_WITHOUT_EXPECT")
internal actual typealias NoRouteToHostException = java.net.NoRouteToHostException
actual typealias SocketException = SocketException @Suppress("ACTUAL_WITHOUT_EXPECT")
internal actual typealias SocketException = SocketException
// ktor aSocket // ktor aSocket
@@ -202,4 +204,5 @@ actual typealias NoRouteToHostException = java.net.NoRouteToHostException
actual typealias SocketException = SocketException actual typealias SocketException = SocketException
*/ */
actual typealias UnknownHostException = java.net.UnknownHostException @Suppress("ACTUAL_WITHOUT_EXPECT")
internal actual typealias UnknownHostException = java.net.UnknownHostException

View File

@@ -17,8 +17,10 @@ import java.security.spec.X509EncodedKeySpec
import javax.crypto.KeyAgreement import javax.crypto.KeyAgreement
actual typealias ECDHPrivateKey = PrivateKey @Suppress("ACTUAL_WITHOUT_EXPECT")
actual typealias ECDHPublicKey = PublicKey internal actual typealias ECDHPrivateKey = PrivateKey
@Suppress("ACTUAL_WITHOUT_EXPECT")
internal actual typealias ECDHPublicKey = PublicKey
internal actual class ECDHKeyPairImpl( internal actual class ECDHKeyPairImpl(
private val delegate: KeyPair private val delegate: KeyPair

View File

@@ -5,6 +5,7 @@ plugins {
id("kotlinx-atomicfu") id("kotlinx-atomicfu")
kotlin("plugin.serialization") kotlin("plugin.serialization")
id("signing") id("signing")
id("net.mamoe.kotlin-jvm-blocking-bridge")
`maven-publish` `maven-publish`
id("com.jfrog.bintray") version Versions.Publishing.bintray id("com.jfrog.bintray") version Versions.Publishing.bintray
} }
@@ -14,6 +15,8 @@ description = "Mirai API module"
val isAndroidSDKAvailable: Boolean by project val isAndroidSDKAvailable: Boolean by project
kotlin { kotlin {
explicitApi()
if (isAndroidSDKAvailable) { if (isAndroidSDKAvailable) {
apply(from = rootProject.file("gradle/android.gradle")) apply(from = rootProject.file("gradle/android.gradle"))
android("android") { android("android") {
@@ -34,11 +37,11 @@ kotlin {
) )
} }
jvm() { jvm {
// withJava() // https://youtrack.jetbrains.com/issue/KT-39991 // withJava() // https://youtrack.jetbrains.com/issue/KT-39991
} }
sourceSets { sourceSets.apply {
all { all {
languageSettings.enableLanguageFeature("InlineClasses") languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.Experimental") languageSettings.useExperimentalAnnotation("kotlin.Experimental")
@@ -49,28 +52,31 @@ kotlin {
languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference") languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference")
languageSettings.useExperimentalAnnotation("kotlin.time.ExperimentalTime") languageSettings.useExperimentalAnnotation("kotlin.time.ExperimentalTime")
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts") languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
languageSettings.useExperimentalAnnotation("kotlinx.serialization.ExperimentalSerializationApi")
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.UnstableExternalImage")
languageSettings.progressiveMode = true languageSettings.progressiveMode = true
} }
commonMain { val commonMain by getting {
dependencies { dependencies {
api(kotlin("stdlib"))
api(kotlin("serialization")) api(kotlin("serialization"))
api(kotlin("reflect")) api(kotlin("reflect"))
api(kotlinx("serialization-runtime-common", Versions.Kotlin.serialization)) api(kotlinx("serialization-core", Versions.Kotlin.serialization))
api(kotlinx("serialization-protobuf-common", Versions.Kotlin.serialization)) implementation(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
api(kotlinx("io", Versions.Kotlin.io)) implementation(kotlinx("io", Versions.Kotlin.io))
api(kotlinx("coroutines-io", Versions.Kotlin.coroutinesIo)) implementation(kotlinx("coroutines-io", Versions.Kotlin.coroutinesIo))
api(kotlinx("coroutines-core-common", Versions.Kotlin.coroutines)) api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
api("org.jetbrains.kotlinx:atomicfu-common:${Versions.Kotlin.atomicFU}") implementation("org.jetbrains.kotlinx:atomicfu:${Versions.Kotlin.atomicFU}")
api(ktor("client-cio", Versions.Kotlin.ktor)) api(ktor("client-cio"))
api(ktor("client-core", Versions.Kotlin.ktor)) api(ktor("client-core"))
api(ktor("network", Versions.Kotlin.ktor)) api(ktor("network"))
} }
} }
commonTest { commonTest {
dependencies { dependencies {
implementation(kotlin("test-annotations-common")) implementation(kotlin("test-annotations-common"))
@@ -83,11 +89,8 @@ kotlin {
dependencies { dependencies {
api(kotlin("reflect")) api(kotlin("reflect"))
api(kotlinx("io-jvm", Versions.Kotlin.io)) implementation(kotlinx("io-jvm", Versions.Kotlin.io))
api(kotlinx("serialization-runtime", Versions.Kotlin.serialization)) implementation(kotlinx("coroutines-io-jvm", Versions.Kotlin.coroutinesIo))
api(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
api(kotlinx("coroutines-io-jvm", Versions.Kotlin.coroutinesIo))
api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
api(ktor("client-android", Versions.Kotlin.ktor)) api(ktor("client-android", Versions.Kotlin.ktor))
} }
@@ -108,15 +111,13 @@ kotlin {
//api(kotlin("stdlib-jdk8")) //api(kotlin("stdlib-jdk8"))
//api(kotlin("stdlib-jdk7")) //api(kotlin("stdlib-jdk7"))
api(kotlin("reflect")) api(kotlin("reflect"))
compileOnly("org.apache.logging.log4j:log4j-api:" + Versions.Logging.log4j)
compileOnly("org.slf4j:slf4j-api:" + Versions.Logging.slf4j)
api(ktor("client-core-jvm", Versions.Kotlin.ktor)) api(ktor("client-core-jvm", Versions.Kotlin.ktor))
api(kotlinx("io-jvm", Versions.Kotlin.io)) implementation(kotlinx("io-jvm", Versions.Kotlin.io))
api(kotlinx("serialization-runtime", Versions.Kotlin.serialization)) implementation(kotlinx("coroutines-io-jvm", Versions.Kotlin.coroutinesIo))
api(kotlinx("serialization-protobuf", Versions.Kotlin.serialization))
api(kotlinx("coroutines-io-jvm", Versions.Kotlin.coroutinesIo))
api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
api("org.bouncycastle:bcprov-jdk15on:1.64")
runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE runtimeOnly(files("build/classes/kotlin/jvm/main")) // classpath is not properly set by IDE
} }
} }
@@ -134,3 +135,18 @@ kotlin {
} }
apply(from = rootProject.file("gradle/publish.gradle")) apply(from = rootProject.file("gradle/publish.gradle"))
tasks.withType<com.jfrog.bintray.gradle.tasks.BintrayUploadTask> {
doFirst {
publishing.publications
.filterIsInstance<MavenPublication>()
.forEach { publication ->
val moduleFile = buildDir.resolve("publications/${publication.name}/module.json")
if (moduleFile.exists()) {
publication.artifact(object : org.gradle.api.publish.maven.internal.artifact.FileBasedMavenArtifact(moduleFile) {
override fun getDefaultExtension() = "module"
})
}
}
}
}

View File

@@ -9,7 +9,7 @@
@file:Suppress( @file:Suppress(
"EXPERIMENTAL_API_USAGE", "unused", "FunctionName", "NOTHING_TO_INLINE", "UnusedImport", "EXPERIMENTAL_API_USAGE", "unused", "FunctionName", "NOTHING_TO_INLINE", "UnusedImport",
"EXPERIMENTAL_OVERRIDE" "EXPERIMENTAL_OVERRIDE", "CanBeParameter", "MemberVisibilityCanBePrivate"
) )
package net.mamoe.mirai package net.mamoe.mirai
@@ -33,7 +33,7 @@ import kotlin.jvm.JvmSynthetic
* 登录, 返回 [this] * 登录, 返回 [this]
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() } public suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() }
/** /**
* 机器人对象. 一个机器人实例登录一个 QQ 账号. * 机器人对象. 一个机器人实例登录一个 QQ 账号.
@@ -47,10 +47,10 @@ suspend inline fun <B : Bot> B.alsoLogin(): B = also { login() }
* @see BotFactory 构造 [Bot] 的工厂, [Bot] 唯一的构造方式. * @see BotFactory 构造 [Bot] 的工厂, [Bot] 唯一的构造方式.
*/ */
@Suppress("INAPPLICABLE_JVM_NAME", "EXPOSED_SUPER_CLASS") @Suppress("INAPPLICABLE_JVM_NAME", "EXPOSED_SUPER_CLASS")
abstract class Bot internal constructor( public abstract class Bot internal constructor(
val configuration: BotConfiguration public val configuration: BotConfiguration
) : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI, ContactOrBot { ) : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI, ContactOrBot {
final override val coroutineContext: CoroutineContext = // for id public final override val coroutineContext: CoroutineContext = // for id
configuration.parentCoroutineContext configuration.parentCoroutineContext
.plus(SupervisorJob(configuration.parentCoroutineContext[Job])) .plus(SupervisorJob(configuration.parentCoroutineContext[Job]))
.plus(configuration.parentCoroutineContext[CoroutineExceptionHandler] .plus(configuration.parentCoroutineContext[CoroutineExceptionHandler]
@@ -61,22 +61,22 @@ abstract class Bot internal constructor(
.plus(CoroutineName("Mirai Bot")) .plus(CoroutineName("Mirai Bot"))
companion object { public companion object {
@JvmField @JvmField
@Suppress("ObjectPropertyName") @Suppress("ObjectPropertyName")
internal val _instances: LockFreeLinkedList<WeakRef<Bot>> = LockFreeLinkedList() internal val _instances: LockFreeLinkedList<WeakRef<Bot>> = LockFreeLinkedList()
@PlannedRemoval("1.2.0") @PlannedRemoval("2.0.0")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN) @Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmStatic @JvmStatic
val instances: List<WeakRef<Bot>> public val instances: List<WeakRef<Bot>>
get() = _instances.toList() get() = _instances.toList()
/** /**
* 复制一份此时的 [Bot] 实例列表. * 复制一份此时的 [Bot] 实例列表.
*/ */
@JvmStatic @JvmStatic
val botInstances: List<Bot> public val botInstances: List<Bot>
get() = _instances.asSequence().mapNotNull { it.get() }.toList() get() = _instances.asSequence().mapNotNull { it.get() }.toList()
/** /**
@@ -84,28 +84,28 @@ abstract class Bot internal constructor(
*/ */
@SinceMirai("1.1.0") @SinceMirai("1.1.0")
@JvmStatic @JvmStatic
val botInstancesSequence: Sequence<Bot> public val botInstancesSequence: Sequence<Bot>
get() = _instances.asSequence().mapNotNull { it.get() } get() = _instances.asSequence().mapNotNull { it.get() }
/** /**
* 遍历每一个 [Bot] 实例 * 遍历每一个 [Bot] 实例
*/ */
@JvmSynthetic @JvmSynthetic
fun forEachInstance(block: (Bot) -> Unit) = _instances.forEach { it.get()?.let(block) } public fun forEachInstance(block: (Bot) -> Unit): Unit = _instances.forEach { it.get()?.let(block) }
/** /**
* 获取一个 [Bot] 实例, 无对应实例时抛出 [NoSuchElementException] * 获取一个 [Bot] 实例, 无对应实例时抛出 [NoSuchElementException]
*/ */
@JvmStatic @JvmStatic
@Throws(NoSuchElementException::class) @Throws(NoSuchElementException::class)
fun getInstance(qq: Long): Bot = public fun getInstance(qq: Long): Bot =
getInstanceOrNull(qq) ?: throw NoSuchElementException(qq.toString()) getInstanceOrNull(qq) ?: throw NoSuchElementException(qq.toString())
/** /**
* 获取一个 [Bot] 实例, 无对应实例时返回 `null` * 获取一个 [Bot] 实例, 无对应实例时返回 `null`
*/ */
@JvmStatic @JvmStatic
fun getInstanceOrNull(qq: Long): Bot? = public fun getInstanceOrNull(qq: Long): Bot? =
_instances.asSequence().mapNotNull { it.get() }.firstOrNull { it.id == qq } _instances.asSequence().mapNotNull { it.get() }.firstOrNull { it.id == qq }
} }
@@ -123,28 +123,28 @@ abstract class Bot internal constructor(
* 在 Android 实现为 `android.content.Context` * 在 Android 实现为 `android.content.Context`
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
abstract val context: Context public abstract val context: Context
/** /**
* QQ 号码. 实际类型为 uint * QQ 号码. 实际类型为 uint
*/ */
abstract override val id: Long public abstract override val id: Long
/** /**
* 昵称 * 昵称
*/ */
abstract val nick: String public abstract val nick: String
/** /**
* 日志记录器 * 日志记录器
*/ */
abstract val logger: MiraiLogger public abstract val logger: MiraiLogger
/** /**
* 判断 Bot 是否在线 (可正常收发消息) * 判断 Bot 是否在线 (可正常收发消息)
*/ */
@SinceMirai("1.0.1") @SinceMirai("1.0.1")
abstract val isOnline: Boolean public abstract val isOnline: Boolean
// region contacts // region contacts
@@ -152,30 +152,32 @@ abstract class Bot internal constructor(
* [User.id] 与 [Bot.id] 相同的 [_lowLevelNewFriend] 实例 * [User.id] 与 [Bot.id] 相同的 [_lowLevelNewFriend] 实例
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
abstract val selfQQ: Friend public abstract val selfQQ: Friend
/** /**
* 机器人的好友列表. 与服务器同步更新 * 机器人的好友列表. 与服务器同步更新
*/ */
abstract val friends: ContactList<Friend> public abstract val friends: ContactList<Friend>
/** /**
* 获取一个好友对象. * 获取一个好友对象.
* @throws [NoSuchElementException] 当不存在这个好友时抛出 * @throws [NoSuchElementException] 当不存在这个好友时抛出
*/ */
fun getFriend(id: Long): Friend = friends.firstOrNull { it.id == id } ?: throw NoSuchElementException("friend $id") public fun getFriend(id: Long): Friend =
friends.firstOrNull { it.id == id } ?: throw NoSuchElementException("friend $id")
/** /**
* 机器人加入的群列表. 与服务器同步更新 * 机器人加入的群列表. 与服务器同步更新
*/ */
abstract val groups: ContactList<Group> public abstract val groups: ContactList<Group>
/** /**
* 获取一个机器人加入的群. * 获取一个机器人加入的群.
* @throws NoSuchElementException 当不存在这个群时抛出 * @throws NoSuchElementException 当不存在这个群时抛出
*/ */
fun getGroup(id: Long): Group = groups.firstOrNull { it.id == id } ?: throw NoSuchElementException("group $id") public fun getGroup(id: Long): Group =
groups.firstOrNull { it.id == id } ?: throw NoSuchElementException("group $id")
// endregion // endregion
@@ -191,7 +193,7 @@ abstract class Bot internal constructor(
* @see alsoLogin `.apply { login() }` 捷径 * @see alsoLogin `.apply { login() }` 捷径
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun login() public abstract suspend fun login()
// endregion // endregion
@@ -212,7 +214,7 @@ abstract class Bot internal constructor(
* @see MessageSource.recall 撤回消息扩展 * @see MessageSource.recall 撤回消息扩展
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun recall(source: MessageSource) public abstract suspend fun recall(source: MessageSource)
/** /**
* 获取图片下载链接 * 获取图片下载链接
@@ -226,7 +228,7 @@ abstract class Bot internal constructor(
level = DeprecationLevel.ERROR level = DeprecationLevel.ERROR
) )
@JvmSynthetic @JvmSynthetic
abstract suspend fun queryImageUrl(image: Image): String public abstract suspend fun queryImageUrl(image: Image): String
/** /**
* 构造一个 [OfflineMessageSource] * 构造一个 [OfflineMessageSource]
@@ -238,7 +240,7 @@ abstract class Bot internal constructor(
* @param targetUin 为用户时为 [Friend.id], 为群时需使用 [Group.calculateGroupUinByGroupCode] 计算 * @param targetUin 为用户时为 [Friend.id], 为群时需使用 [Group.calculateGroupUinByGroupCode] 计算
*/ */
@MiraiExperimentalAPI("This is very experimental and is subject to change.") @MiraiExperimentalAPI("This is very experimental and is subject to change.")
abstract fun constructMessageSource( public abstract fun constructMessageSource(
kind: OfflineMessageSource.Kind, kind: OfflineMessageSource.Kind,
fromUin: Long, targetUin: Long, fromUin: Long, targetUin: Long,
id: Int, time: Int, internalId: Int, id: Int, time: Int, internalId: Int,
@@ -254,7 +256,7 @@ abstract class Bot internal constructor(
@PlannedRemoval("1.2.0") @PlannedRemoval("1.2.0")
@Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR) @Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR)
@JvmSynthetic @JvmSynthetic
abstract suspend fun acceptNewFriendRequest(event: NewFriendRequestEvent) public abstract suspend fun acceptNewFriendRequest(event: NewFriendRequestEvent)
/** /**
* 拒绝好友验证 * 拒绝好友验证
@@ -269,7 +271,7 @@ abstract class Bot internal constructor(
level = DeprecationLevel.ERROR level = DeprecationLevel.ERROR
) )
@JvmSynthetic @JvmSynthetic
abstract suspend fun rejectNewFriendRequest(event: NewFriendRequestEvent, blackList: Boolean = false) public abstract suspend fun rejectNewFriendRequest(event: NewFriendRequestEvent, blackList: Boolean = false)
/** /**
* 通过加群验证(需管理员权限) * 通过加群验证(需管理员权限)
@@ -279,7 +281,7 @@ abstract class Bot internal constructor(
@PlannedRemoval("1.2.0") @PlannedRemoval("1.2.0")
@Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR) @Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR)
@JvmSynthetic @JvmSynthetic
abstract suspend fun acceptMemberJoinRequest(event: MemberJoinRequestEvent) public abstract suspend fun acceptMemberJoinRequest(event: MemberJoinRequestEvent)
/** /**
* 拒绝加群验证(需管理员权限) * 拒绝加群验证(需管理员权限)
@@ -293,10 +295,14 @@ abstract class Bot internal constructor(
replaceWith = ReplaceWith("event.reject(blackList)"), replaceWith = ReplaceWith("event.reject(blackList)"),
level = DeprecationLevel.HIDDEN level = DeprecationLevel.HIDDEN
) )
abstract suspend fun rejectMemberJoinRequest(event: MemberJoinRequestEvent, blackList: Boolean = false) public abstract suspend fun rejectMemberJoinRequest(event: MemberJoinRequestEvent, blackList: Boolean = false)
@JvmSynthetic @JvmSynthetic
abstract suspend fun rejectMemberJoinRequest(event: MemberJoinRequestEvent, blackList: Boolean = false, message: String = "") public abstract suspend fun rejectMemberJoinRequest(
event: MemberJoinRequestEvent,
blackList: Boolean = false,
message: String = ""
)
/** /**
* 忽略加群验证(需管理员权限) * 忽略加群验证(需管理员权限)
@@ -311,7 +317,7 @@ abstract class Bot internal constructor(
level = DeprecationLevel.ERROR level = DeprecationLevel.ERROR
) )
@JvmSynthetic @JvmSynthetic
abstract suspend fun ignoreMemberJoinRequest(event: MemberJoinRequestEvent, blackList: Boolean = false) public abstract suspend fun ignoreMemberJoinRequest(event: MemberJoinRequestEvent, blackList: Boolean = false)
/** /**
* 接收邀请入群(需管理员权限) * 接收邀请入群(需管理员权限)
@@ -321,7 +327,7 @@ abstract class Bot internal constructor(
@PlannedRemoval("1.2.0") @PlannedRemoval("1.2.0")
@Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR) @Deprecated("use member function.", replaceWith = ReplaceWith("event.accept()"), level = DeprecationLevel.ERROR)
@JvmSynthetic @JvmSynthetic
abstract suspend fun acceptInvitedJoinGroupRequest(event: BotInvitedJoinGroupRequestEvent) public abstract suspend fun acceptInvitedJoinGroupRequest(event: BotInvitedJoinGroupRequestEvent)
/** /**
* 忽略邀请入群(需管理员权限) * 忽略邀请入群(需管理员权限)
@@ -331,7 +337,7 @@ abstract class Bot internal constructor(
@PlannedRemoval("1.2.0") @PlannedRemoval("1.2.0")
@Deprecated("use member function.", replaceWith = ReplaceWith("event.ignore()"), level = DeprecationLevel.ERROR) @Deprecated("use member function.", replaceWith = ReplaceWith("event.ignore()"), level = DeprecationLevel.ERROR)
@JvmSynthetic @JvmSynthetic
abstract suspend fun ignoreInvitedJoinGroupRequest(event: BotInvitedJoinGroupRequestEvent) public abstract suspend fun ignoreInvitedJoinGroupRequest(event: BotInvitedJoinGroupRequestEvent)
// endregion // endregion
@@ -345,16 +351,16 @@ abstract class Bot internal constructor(
* *
* @see closeAndJoin 取消并 [Bot.join], 以确保 [Bot] 相关的活动被完全关闭 * @see closeAndJoin 取消并 [Bot.join], 以确保 [Bot] 相关的活动被完全关闭
*/ */
abstract fun close(cause: Throwable? = null) public abstract fun close(cause: Throwable? = null)
final override fun toString(): String = "Bot($id)" public final override fun toString(): String = "Bot($id)"
} }
/** /**
* 获取 [Job] 的协程 [Job]. 此 [Job] 为一个 [SupervisorJob] * 获取 [Job] 的协程 [Job]. 此 [Job] 为一个 [SupervisorJob]
*/ */
@get:JvmSynthetic @get:JvmSynthetic
val Bot.supervisorJob: CompletableJob public val Bot.supervisorJob: CompletableJob
get() = this.coroutineContext[Job] as CompletableJob get() = this.coroutineContext[Job] as CompletableJob
/** /**
@@ -362,7 +368,7 @@ val Bot.supervisorJob: CompletableJob
* 即使 [Bot] 离线, 也会等待直到协程关闭. * 即使 [Bot] 离线, 也会等待直到协程关闭.
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun Bot.join() = this.coroutineContext[Job]!!.join() public suspend inline fun Bot.join(): Unit = this.coroutineContext[Job]!!.join()
/** /**
* 撤回这条消息. * 撤回这条消息.
@@ -374,7 +380,7 @@ suspend inline fun Bot.join() = this.coroutineContext[Job]!!.join()
* @see Bot.recall * @see Bot.recall
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun Bot.recall(message: MessageChain) = public suspend inline fun Bot.recall(message: MessageChain): Unit =
this.recall(message.source) this.recall(message.source)
/** /**
@@ -385,7 +391,7 @@ suspend inline fun Bot.recall(message: MessageChain) =
* @see recall * @see recall
*/ */
@JvmSynthetic @JvmSynthetic
inline fun CoroutineScope.recallIn( public inline fun CoroutineScope.recallIn(
source: MessageSource, source: MessageSource,
millis: Long, millis: Long,
coroutineContext: CoroutineContext = EmptyCoroutineContext coroutineContext: CoroutineContext = EmptyCoroutineContext
@@ -402,7 +408,7 @@ inline fun CoroutineScope.recallIn(
* @see recall * @see recall
*/ */
@JvmSynthetic @JvmSynthetic
inline fun CoroutineScope.recallIn( public inline fun CoroutineScope.recallIn(
message: MessageChain, message: MessageChain,
millis: Long, millis: Long,
coroutineContext: CoroutineContext = EmptyCoroutineContext coroutineContext: CoroutineContext = EmptyCoroutineContext
@@ -419,19 +425,19 @@ inline fun CoroutineScope.recallIn(
* @param cause 原因. 为 null 时视为正常关闭, 非 null 时视为异常关闭 * @param cause 原因. 为 null 时视为正常关闭, 非 null 时视为异常关闭
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun Bot.closeAndJoin(cause: Throwable? = null) { public suspend inline fun Bot.closeAndJoin(cause: Throwable? = null) {
close(cause) close(cause)
coroutineContext[Job]?.join() coroutineContext[Job]?.join()
} }
@JvmSynthetic @JvmSynthetic
inline fun Bot.containsFriend(id: Long): Boolean = this.friends.contains(id) public inline fun Bot.containsFriend(id: Long): Boolean = this.friends.contains(id)
@JvmSynthetic @JvmSynthetic
inline fun Bot.containsGroup(id: Long): Boolean = this.groups.contains(id) public inline fun Bot.containsGroup(id: Long): Boolean = this.groups.contains(id)
@JvmSynthetic @JvmSynthetic
inline fun Bot.getFriendOrNull(id: Long): Friend? = this.friends.getOrNull(id) public inline fun Bot.getFriendOrNull(id: Long): Friend? = this.friends.getOrNull(id)
@JvmSynthetic @JvmSynthetic
inline fun Bot.getGroupOrNull(id: Long): Group? = this.groups.getOrNull(id) public inline fun Bot.getGroupOrNull(id: Long): Group? = this.groups.getOrNull(id)

View File

@@ -23,12 +23,12 @@ import kotlin.jvm.JvmSynthetic
* *
* 在 JVM, 请查看 `BotFactoryJvm` * 在 JVM, 请查看 `BotFactoryJvm`
*/ */
expect interface BotFactory { public expect interface BotFactory {
/** /**
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
fun Bot( public fun Bot(
context: Context, context: Context,
qq: Long, qq: Long,
password: String, password: String,
@@ -39,7 +39,7 @@ expect interface BotFactory {
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmName("newBot") @JvmName("newBot")
fun Bot( public fun Bot(
context: Context, context: Context,
qq: Long, qq: Long,
passwordMd5: ByteArray, passwordMd5: ByteArray,
@@ -51,7 +51,7 @@ expect interface BotFactory {
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmSynthetic @JvmSynthetic
inline fun BotFactory.Bot( public inline fun BotFactory.Bot(
context: Context, context: Context,
qq: Long, qq: Long,
password: String, password: String,
@@ -62,7 +62,7 @@ inline fun BotFactory.Bot(
* 使用指定的 [配置][configuration] 构造 [Bot] 实例 * 使用指定的 [配置][configuration] 构造 [Bot] 实例
*/ */
@JvmSynthetic @JvmSynthetic
inline fun BotFactory.Bot( public inline fun BotFactory.Bot(
context: Context, context: Context,
qq: Long, qq: Long,
password: ByteArray, password: ByteArray,

View File

@@ -35,12 +35,12 @@ import kotlin.jvm.JvmSynthetic
* 联系对象, 即可以与 [Bot] 互动的对象. 包含 [用户][User], 和 [群][Group]. * 联系对象, 即可以与 [Bot] 互动的对象. 包含 [用户][User], 和 [群][Group].
*/ */
@Suppress("EXPOSED_SUPER_CLASS") @Suppress("EXPOSED_SUPER_CLASS")
abstract class Contact : ContactOrBot, CoroutineScope, ContactJavaFriendlyAPI { public abstract class Contact : ContactOrBot, CoroutineScope, ContactJavaFriendlyAPI {
/** /**
* 这个联系对象所属 [Bot]. * 这个联系对象所属 [Bot].
*/ */
@WeakRefProperty @WeakRefProperty
abstract val bot: Bot public abstract val bot: Bot
/** /**
* 可以是 QQ 号码或者群号码. * 可以是 QQ 号码或者群号码.
@@ -48,7 +48,7 @@ abstract class Contact : ContactOrBot, CoroutineScope, ContactJavaFriendlyAPI {
* @see User.id * @see User.id
* @see Group.id * @see Group.id
*/ */
abstract override val id: Long public abstract override val id: Long
/** /**
* 向这个对象发送消息. * 向这个对象发送消息.
@@ -66,13 +66,13 @@ abstract class Contact : ContactOrBot, CoroutineScope, ContactJavaFriendlyAPI {
* @return 消息回执. 可 [引用回复][MessageReceipt.quote](仅群聊)或 [撤回][MessageReceipt.recall] 这条消息. * @return 消息回执. 可 [引用回复][MessageReceipt.quote](仅群聊)或 [撤回][MessageReceipt.recall] 这条消息.
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun sendMessage(message: Message): MessageReceipt<Contact> public abstract suspend fun sendMessage(message: Message): MessageReceipt<Contact>
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE") @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@JvmSynthetic @JvmSynthetic
suspend inline fun sendMessage(message: String): MessageReceipt<Contact> { public suspend inline fun sendMessage(message: String): MessageReceipt<Contact> {
return sendMessage(message.toMessage()) return sendMessage(PlainText(message))
} }
/** /**
@@ -87,34 +87,34 @@ abstract class Contact : ContactOrBot, CoroutineScope, ContactJavaFriendlyAPI {
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时抛出. (最大大小约为 20 MB, 但 mirai 限制的大小为 30 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时抛出. (最大大小约为 20 MB, 但 mirai 限制的大小为 30 MB)
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun uploadImage(image: ExternalImage): Image public abstract suspend fun uploadImage(image: ExternalImage): Image
final override fun equals(other: Any?): Boolean = super.equals(other) public final override fun equals(other: Any?): Boolean = super.equals(other)
final override fun hashCode(): Int = super.hashCode() public final override fun hashCode(): Int = super.hashCode()
/** /**
* @return "Friend($id)" or "Group($id)" or "Member($id)" * @return "Friend($id)" or "Group($id)" or "Member($id)"
*/ */
abstract override fun toString(): String public abstract override fun toString(): String
} }
/** /**
* @see Bot.recall * @see Bot.recall
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun Contact.recall(source: MessageChain) = this.bot.recall(source) public suspend inline fun Contact.recall(source: MessageChain): Unit = this.bot.recall(source)
/** /**
* @see Bot.recall * @see Bot.recall
*/ */
@JvmSynthetic @JvmSynthetic
suspend inline fun Contact.recall(source: MessageSource) = this.bot.recall(source) public suspend inline fun Contact.recall(source: MessageSource): Unit = this.bot.recall(source)
/** /**
* @see Bot.recallIn * @see Bot.recallIn
*/ */
@JvmSynthetic @JvmSynthetic
inline fun Contact.recallIn( public inline fun Contact.recallIn(
message: MessageChain, message: MessageChain,
millis: Long, millis: Long,
coroutineContext: CoroutineContext = EmptyCoroutineContext coroutineContext: CoroutineContext = EmptyCoroutineContext
@@ -124,7 +124,7 @@ inline fun Contact.recallIn(
* @see Bot.recallIn * @see Bot.recallIn
*/ */
@JvmSynthetic @JvmSynthetic
inline fun Contact.recallIn( public inline fun Contact.recallIn(
source: MessageSource, source: MessageSource,
millis: Long, millis: Long,
coroutineContext: CoroutineContext = EmptyCoroutineContext coroutineContext: CoroutineContext = EmptyCoroutineContext

View File

@@ -22,24 +22,24 @@ import kotlin.jvm.JvmField
* @see ContactList.asSequence * @see ContactList.asSequence
*/ */
@Suppress("unused") @Suppress("unused")
class ContactList<C : Contact> public class ContactList<C : Contact>
internal constructor(@JvmField internal val delegate: LockFreeLinkedList<C>) : Collection<C> { internal constructor(@JvmField internal val delegate: LockFreeLinkedList<C>) : Collection<C> {
operator fun get(id: Long): C = public operator fun get(id: Long): C =
delegate.asSequence().firstOrNull { it.id == id } ?: throw NoSuchElementException("Contact id $id") delegate.asSequence().firstOrNull { it.id == id } ?: throw NoSuchElementException("Contact id $id")
fun getOrNull(id: Long): C? = delegate.getOrNull(id) public fun getOrNull(id: Long): C? = delegate.getOrNull(id)
override val size: Int get() = delegate.size public override val size: Int get() = delegate.size
override operator fun contains(element: C): Boolean = delegate.contains(element) public override operator fun contains(element: C): Boolean = delegate.contains(element)
operator fun contains(id: Long): Boolean = delegate.getOrNull(id) != null public operator fun contains(id: Long): Boolean = delegate.getOrNull(id) != null
override fun containsAll(elements: Collection<C>): Boolean = elements.all { contains(it) } public override fun containsAll(elements: Collection<C>): Boolean = elements.all { contains(it) }
override fun isEmpty(): Boolean = delegate.isEmpty() public override fun isEmpty(): Boolean = delegate.isEmpty()
override fun toString(): String = public override fun toString(): String =
delegate.asSequence().joinToString(separator = ", ", prefix = "ContactList(", postfix = ")") delegate.asSequence().joinToString(separator = ", ", prefix = "ContactList(", postfix = ")")
override fun iterator(): Iterator<C> { public override fun iterator(): Iterator<C> {
return this.delegate.asSequence().iterator() return this.delegate.asSequence().iterator()
} }
} }
@@ -51,7 +51,7 @@ internal constructor(@JvmField internal val delegate: LockFreeLinkedList<C>) : C
* [123456, 321654, 123654] * [123456, 321654, 123654]
* ``` * ```
*/ */
val ContactList<*>.idContentString: String public val ContactList<*>.idContentString: String
get() = "[" + buildString { delegate.forEach { append(it.id).append(", ") } }.dropLast( get() = "[" + buildString { delegate.forEach { append(it.id).append(", ") } }.dropLast(
2 2
) + "]" ) + "]"

View File

@@ -19,9 +19,9 @@ import net.mamoe.mirai.Bot
* @see Contact * @see Contact
* @see Bot * @see Bot
*/ */
interface ContactOrBot : CoroutineScope { public interface ContactOrBot : CoroutineScope {
/** /**
* QQ 号或群号. * QQ 号或群号.
*/ */
val id: Long public val id: Long
} }

View File

@@ -20,16 +20,16 @@ import kotlin.time.seconds
* *
* @see Contact.sendMessage * @see Contact.sendMessage
*/ */
class MessageTooLargeException( public class MessageTooLargeException(
val target: Contact, public val target: Contact,
/** /**
* 原发送消息 * 原发送消息
*/ */
val originalMessage: Message, public val originalMessage: Message,
/** /**
* 经过事件拦截处理后的消息 * 经过事件拦截处理后的消息
*/ */
val messageAfterEvent: Message, public val messageAfterEvent: Message,
exceptionMessage: String exceptionMessage: String
) : RuntimeException(exceptionMessage) ) : RuntimeException(exceptionMessage)
@@ -38,8 +38,8 @@ class MessageTooLargeException(
* *
* @see Group.sendMessage * @see Group.sendMessage
*/ */
class BotIsBeingMutedException( public class BotIsBeingMutedException(
val target: Group public val target: Group
) : RuntimeException("bot is being muted, remaining ${target.botMuteRemaining.seconds.asHumanReadable} seconds") ) : RuntimeException("bot is being muted, remaining ${target.botMuteRemaining.seconds.asHumanReadable} seconds")
inline val BotIsBeingMutedException.botMuteRemaining: Int get() = target.botMuteRemaining public inline val BotIsBeingMutedException.botMuteRemaining: Int get() = target.botMuteRemaining

View File

@@ -19,8 +19,8 @@ import net.mamoe.mirai.event.events.FriendMessagePreSendEvent
import net.mamoe.mirai.message.FriendMessageEvent import net.mamoe.mirai.message.FriendMessageEvent
import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.isContentEmpty import net.mamoe.mirai.message.data.isContentEmpty
import net.mamoe.mirai.message.data.toMessage
import net.mamoe.mirai.message.recall import net.mamoe.mirai.message.recall
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@@ -34,22 +34,22 @@ import kotlin.jvm.JvmSynthetic
* @see FriendMessageEvent * @see FriendMessageEvent
*/ */
@Suppress("DEPRECATION_ERROR") @Suppress("DEPRECATION_ERROR")
abstract class Friend : User(), CoroutineScope { public abstract class Friend : User(), CoroutineScope {
/** /**
* QQ 号码 * QQ 号码
*/ */
abstract override val id: Long public abstract override val id: Long
/** /**
* 昵称 * 昵称
*/ */
abstract override val nick: String public abstract override val nick: String
/** /**
* 头像下载链接 * 头像下载链接
*/ */
override val avatarUrl: String public override val avatarUrl: String
get() = "http://q1.qlogo.cn/g?b=qq&nk=$id&s=640" get() = "http://q1.qlogo.cn/g?b=qq&nk=$id&s=640"
/** /**
@@ -74,7 +74,7 @@ abstract class Friend : User(), CoroutineScope {
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@JvmSynthetic @JvmSynthetic
suspend inline fun sendMessage(message: String): MessageReceipt<Friend> { suspend inline fun sendMessage(message: String): MessageReceipt<Friend> {
return sendMessage(message.toMessage()) return sendMessage(PlainText(message))
} }
final override fun toString(): String = "Friend($id)" final override fun toString(): String = "Friend($id)"

View File

@@ -18,13 +18,11 @@ import net.mamoe.mirai.LowLevelAPI
import net.mamoe.mirai.data.MemberInfo import net.mamoe.mirai.data.MemberInfo
import net.mamoe.mirai.event.events.* import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.isContentEmpty
import net.mamoe.mirai.message.data.toMessage
import net.mamoe.mirai.message.recall import net.mamoe.mirai.message.recall
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.internal.runBlocking import net.mamoe.mirai.utils.internal.runBlocking
import java.io.InputStream
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
import kotlin.jvm.JvmStatic import kotlin.jvm.JvmStatic
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@@ -32,7 +30,7 @@ import kotlin.jvm.JvmSynthetic
/** /**
* 群. * 群.
*/ */
abstract class Group : Contact(), CoroutineScope { public abstract class Group : Contact(), CoroutineScope {
/** /**
* 群名称. * 群名称.
* *
@@ -42,30 +40,30 @@ abstract class Group : Contact(), CoroutineScope {
* @see GroupNameChangeEvent 群名片修改事件 * @see GroupNameChangeEvent 群名片修改事件
* @throws PermissionDeniedException 无权限修改时将会抛出异常 * @throws PermissionDeniedException 无权限修改时将会抛出异常
*/ */
abstract var name: String public abstract var name: String
/** /**
* 群设置 * 群设置
*/ */
abstract val settings: GroupSettings public abstract val settings: GroupSettings
/** /**
* 同为 groupCode, 用户看到的群号码. * 同为 groupCode, 用户看到的群号码.
*/ */
abstract override val id: Long public abstract override val id: Long
/** /**
* 群主. * 群主.
* *
* @return 若机器人是群主, 返回 [botAsMember]. 否则返回相应的成员 * @return 若机器人是群主, 返回 [botAsMember]. 否则返回相应的成员
*/ */
abstract val owner: Member public abstract val owner: Member
/** /**
* [Bot] 在群内的 [Member] 实例 * [Bot] 在群内的 [Member] 实例
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
abstract val botAsMember: Member public abstract val botAsMember: Member
/** /**
* 机器人被禁言还剩余多少秒 * 机器人被禁言还剩余多少秒
@@ -73,7 +71,7 @@ abstract class Group : Contact(), CoroutineScope {
* @see BotMuteEvent 机器人被禁言事件 * @see BotMuteEvent 机器人被禁言事件
* @see isBotMuted 判断机器人是否正在被禁言 * @see isBotMuted 判断机器人是否正在被禁言
*/ */
abstract val botMuteRemaining: Int public abstract val botMuteRemaining: Int
/** /**
* 机器人在这个群里的权限 * 机器人在这个群里的权限
@@ -82,38 +80,38 @@ abstract class Group : Contact(), CoroutineScope {
* *
* @see BotGroupPermissionChangeEvent 机器人群员修改 * @see BotGroupPermissionChangeEvent 机器人群员修改
*/ */
abstract val botPermission: MemberPermission public abstract val botPermission: MemberPermission
/** /**
* 群头像下载链接. * 群头像下载链接.
*/ */
val avatarUrl: String public val avatarUrl: String
get() = "https://p.qlogo.cn/gh/$id/${id}/640" get() = "https://p.qlogo.cn/gh/$id/${id}/640"
/** /**
* 群成员列表, 不含机器人自己, 含群主. * 群成员列表, 不含机器人自己, 含群主.
* 在 [Group] 实例创建的时候查询一次. 并与事件同步事件更新 * 在 [Group] 实例创建的时候查询一次. 并与事件同步事件更新
*/ */
abstract val members: ContactList<Member> public abstract val members: ContactList<Member>
/** /**
* 获取群成员实例. 不存在时抛出 [kotlin.NoSuchElementException] * 获取群成员实例. 不存在时抛出 [kotlin.NoSuchElementException]
* 当 [id] 为 [Bot.id] 时返回 [botAsMember] * 当 [id] 为 [Bot.id] 时返回 [botAsMember]
*/ */
@Throws(NoSuchElementException::class) @Throws(NoSuchElementException::class)
abstract operator fun get(id: Long): Member public abstract operator fun get(id: Long): Member
/** /**
* 获取群成员实例, 不存在则 null * 获取群成员实例, 不存在则 null
* 当 [id] 为 [Bot.id] 时返回 [botAsMember] * 当 [id] 为 [Bot.id] 时返回 [botAsMember]
*/ */
abstract fun getOrNull(id: Long): Member? public abstract fun getOrNull(id: Long): Member?
/** /**
* 检查此 id 的群成员是否存在 * 检查此 id 的群成员是否存在
* 当 [id] 为 [Bot.id] 时返回 `true` * 当 [id] 为 [Bot.id] 时返回 `true`
*/ */
abstract operator fun contains(id: Long): Boolean public abstract operator fun contains(id: Long): Boolean
/** /**
@@ -122,7 +120,7 @@ abstract class Group : Contact(), CoroutineScope {
* @return 退出成功时 true; 已经退出时 false * @return 退出成功时 true; 已经退出时 false
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun quit(): Boolean public abstract suspend fun quit(): Boolean
/** /**
* 构造一个 [Member]. * 构造一个 [Member].
@@ -130,7 +128,7 @@ abstract class Group : Contact(), CoroutineScope {
*/ */
@LowLevelAPI @LowLevelAPI
@MiraiExperimentalAPI("dangerous") @MiraiExperimentalAPI("dangerous")
abstract fun newMember(memberInfo: MemberInfo): Member public abstract fun newMember(memberInfo: MemberInfo): Member
/** /**
* 向这个对象发送消息. * 向这个对象发送消息.
@@ -148,7 +146,7 @@ abstract class Group : Contact(), CoroutineScope {
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmSynthetic @JvmSynthetic
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group> public abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
/** /**
* @see sendMessage * @see sendMessage
@@ -156,8 +154,8 @@ abstract class Group : Contact(), CoroutineScope {
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE") @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@JvmSynthetic @JvmSynthetic
suspend inline fun sendMessage(message: String): MessageReceipt<Group> { public suspend inline fun sendMessage(message: String): MessageReceipt<Group> {
return sendMessage(message.toMessage()) return sendMessage(PlainText(message))
} }
/** /**
@@ -172,16 +170,30 @@ abstract class Group : Contact(), CoroutineScope {
* @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB) * @throws OverFileSizeMaxException 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)
*/ */
@JvmSynthetic @JvmSynthetic
abstract override suspend fun uploadImage(image: ExternalImage): Image public abstract override suspend fun uploadImage(image: ExternalImage): Image
companion object { /**
* 上传一个语音消息以备发送.
* 请手动关闭输入流
* 请使用amr或silk格式
* 请注意这是一个实验性api且随时会被删除
* @throws EventCancelledException 当发送消息事件被取消
* @throws OverFileSizeMaxException 当语音文件过大而被服务器拒绝上传时. (最大大小约为 1 MB)
*/
@JvmSynthetic
@MiraiExperimentalAPI
@SinceMirai("1.2.0")
public abstract suspend fun uploadVoice(input: InputStream): Voice
public companion object {
/** /**
* 使用 groupCode 计算 groupUin. 这两个值仅在 mirai 内部协议区分, 一般人使用时无需在意. * 使用 groupCode 计算 groupUin. 这两个值仅在 mirai 内部协议区分, 一般人使用时无需在意.
* @suppress internal api * @suppress internal api
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
@JvmStatic @JvmStatic
fun calculateGroupUinByGroupCode(groupCode: Long): Long = public fun calculateGroupUinByGroupCode(groupCode: Long): Long =
CommonGroupCalculations.calculateGroupUinByGroupCode(groupCode) CommonGroupCalculations.calculateGroupUinByGroupCode(groupCode)
/** /**
@@ -190,7 +202,7 @@ abstract class Group : Contact(), CoroutineScope {
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
@JvmStatic @JvmStatic
fun calculateGroupCodeByGroupUin(groupUin: Long): Long = public fun calculateGroupCodeByGroupUin(groupUin: Long): Long =
CommonGroupCalculations.calculateGroupCodeByGroupUin(groupUin) CommonGroupCalculations.calculateGroupCodeByGroupUin(groupUin)
} }
@@ -200,7 +212,7 @@ abstract class Group : Contact(), CoroutineScope {
@Suppress("FunctionName") @Suppress("FunctionName")
@JvmName("quit") @JvmName("quit")
@JavaFriendlyAPI @JavaFriendlyAPI
fun __quitBlockingForJava__(): Boolean = runBlocking { quit() } public fun __quitBlockingForJava__(): Boolean = runBlocking { quit() }
} }
/** /**
@@ -208,7 +220,7 @@ abstract class Group : Contact(), CoroutineScope {
* *
* @see Group.settings 获取群设置 * @see Group.settings 获取群设置
*/ */
interface GroupSettings { public interface GroupSettings {
/** /**
* 入群公告, 没有时为空字符串. * 入群公告, 没有时为空字符串.
* *
@@ -217,7 +229,7 @@ interface GroupSettings {
* @see GroupEntranceAnnouncementChangeEvent * @see GroupEntranceAnnouncementChangeEvent
* @throws PermissionDeniedException 无权限修改时将会抛出异常 * @throws PermissionDeniedException 无权限修改时将会抛出异常
*/ */
var entranceAnnouncement: String public var entranceAnnouncement: String
/** /**
* 全体禁言状态. `true` 为开启. * 全体禁言状态. `true` 为开启.
@@ -227,7 +239,7 @@ interface GroupSettings {
* @see GroupMuteAllEvent * @see GroupMuteAllEvent
* @throws PermissionDeniedException 无权限修改时将会抛出异常 * @throws PermissionDeniedException 无权限修改时将会抛出异常
*/ */
var isMuteAll: Boolean public var isMuteAll: Boolean
/** /**
* 坦白说状态. `true` 为允许. * 坦白说状态. `true` 为允许.
@@ -239,7 +251,7 @@ interface GroupSettings {
*/ */
@PlannedRemoval("1.3.0") @PlannedRemoval("1.3.0")
@Deprecated("mirai 将不再支持此用例较少的设置", level = DeprecationLevel.WARNING) @Deprecated("mirai 将不再支持此用例较少的设置", level = DeprecationLevel.WARNING)
var isConfessTalkEnabled: Boolean public var isConfessTalkEnabled: Boolean
/** /**
* 允许群员邀请好友入群的状态. `true` 为允许 * 允许群员邀请好友入群的状态. `true` 为允许
@@ -249,18 +261,18 @@ interface GroupSettings {
* @see GroupAllowMemberInviteEvent * @see GroupAllowMemberInviteEvent
* @throws PermissionDeniedException 无权限修改时将会抛出异常 * @throws PermissionDeniedException 无权限修改时将会抛出异常
*/ */
var isAllowMemberInvite: Boolean public var isAllowMemberInvite: Boolean
/** /**
* 自动加群审批 * 自动加群审批
*/ */
@MiraiExperimentalAPI @MiraiExperimentalAPI
val isAutoApproveEnabled: Boolean public val isAutoApproveEnabled: Boolean
/** /**
* 匿名聊天 * 匿名聊天
*/ */
val isAnonymousChatEnabled: Boolean public val isAnonymousChatEnabled: Boolean
} }
@@ -269,7 +281,7 @@ interface GroupSettings {
* *
* @see Group.botMuteRemaining 剩余禁言时间 * @see Group.botMuteRemaining 剩余禁言时间
*/ */
inline val Group.isBotMuted: Boolean get() = this.botMuteRemaining != 0 public inline val Group.isBotMuted: Boolean get() = this.botMuteRemaining != 0
internal object CommonGroupCalculations { internal object CommonGroupCalculations {

View File

@@ -17,8 +17,8 @@ import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.getFriendOrNull import net.mamoe.mirai.getFriendOrNull
import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.isContentEmpty import net.mamoe.mirai.message.data.isContentEmpty
import net.mamoe.mirai.message.data.toMessage
import net.mamoe.mirai.message.recall import net.mamoe.mirai.message.recall
import net.mamoe.mirai.utils.WeakRefProperty import net.mamoe.mirai.utils.WeakRefProperty
import kotlin.jvm.JvmSynthetic import kotlin.jvm.JvmSynthetic
@@ -36,19 +36,19 @@ import kotlin.time.ExperimentalTime
*/ */
@Suppress("INAPPLICABLE_JVM_NAME", "EXPOSED_SUPER_CLASS") @Suppress("INAPPLICABLE_JVM_NAME", "EXPOSED_SUPER_CLASS")
@OptIn(JavaFriendlyAPI::class) @OptIn(JavaFriendlyAPI::class)
abstract class Member : MemberJavaFriendlyAPI, User() { public abstract class Member : MemberJavaFriendlyAPI, User() {
/** /**
* 所在的群. * 所在的群.
*/ */
@WeakRefProperty @WeakRefProperty
abstract val group: Group public abstract val group: Group
/** /**
* 成员的权限, 动态更新. * 成员的权限, 动态更新.
* *
* @see MemberPermissionChangeEvent 权限变更事件. 由群主或机器人的操作触发. * @see MemberPermissionChangeEvent 权限变更事件. 由群主或机器人的操作触发.
*/ */
abstract val permission: MemberPermission public abstract val permission: MemberPermission
/** /**
* 群名片. 可能为空. * 群名片. 可能为空.
@@ -62,7 +62,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @see MemberCardChangeEvent 群名片被管理员, 自己或 [Bot] 改动事件. 修改时也会触发此事件. * @see MemberCardChangeEvent 群名片被管理员, 自己或 [Bot] 改动事件. 修改时也会触发此事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
abstract var nameCard: String public abstract var nameCard: String
/** /**
* 群头衔. * 群头衔.
@@ -74,7 +74,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @see MemberSpecialTitleChangeEvent 群名片被管理员, 自己或 [Bot] 改动事件. 修改时也会触发此事件. * @see MemberSpecialTitleChangeEvent 群名片被管理员, 自己或 [Bot] 改动事件. 修改时也会触发此事件.
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
abstract var specialTitle: String public abstract var specialTitle: String
/** /**
* 被禁言剩余时长. 单位为秒. * 被禁言剩余时长. 单位为秒.
@@ -83,7 +83,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @see mute 设置禁言 * @see mute 设置禁言
* @see unmute 取消禁言 * @see unmute 取消禁言
*/ */
abstract val muteTimeRemaining: Int public abstract val muteTimeRemaining: Int
/** /**
* 禁言. * 禁言.
@@ -108,7 +108,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @throws PermissionDeniedException 无权限修改时抛出 * @throws PermissionDeniedException 无权限修改时抛出
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun mute(durationSeconds: Int) public abstract suspend fun mute(durationSeconds: Int)
/** /**
* 解除禁言. * 解除禁言.
@@ -122,7 +122,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @throws PermissionDeniedException 无权限修改时抛出 * @throws PermissionDeniedException 无权限修改时抛出
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun unmute() public abstract suspend fun unmute()
/** /**
* 踢出该成员. * 踢出该成员.
@@ -133,7 +133,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @throws PermissionDeniedException 无权限修改时 * @throws PermissionDeniedException 无权限修改时
*/ */
@JvmSynthetic @JvmSynthetic
abstract suspend fun kick(message: String = "") public abstract suspend fun kick(message: String = "")
/** /**
* 向群成员发送消息. * 向群成员发送消息.
@@ -155,7 +155,7 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* @return 消息回执. 可进行撤回 ([MessageReceipt.recall]) * @return 消息回执. 可进行撤回 ([MessageReceipt.recall])
*/ */
@JvmSynthetic @JvmSynthetic
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member> public abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
/** /**
* @see sendMessage * @see sendMessage
@@ -163,11 +163,11 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE") @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "VIRTUAL_MEMBER_HIDDEN", "OVERRIDE_BY_INLINE")
@kotlin.internal.InlineOnly @kotlin.internal.InlineOnly
@JvmSynthetic @JvmSynthetic
suspend inline fun sendMessage(message: String): MessageReceipt<Member> { public suspend inline fun sendMessage(message: String): MessageReceipt<Member> {
return sendMessage(message.toMessage()) return sendMessage(PlainText(message))
} }
final override fun toString(): String = "Member($id)" public final override fun toString(): String = "Member($id)"
} }
/** /**
@@ -175,23 +175,23 @@ abstract class Member : MemberJavaFriendlyAPI, User() {
* *
* @throws IllegalStateException 当此成员不是好友时抛出 * @throws IllegalStateException 当此成员不是好友时抛出
*/ */
fun Member.asFriend(): Friend = this.bot.getFriendOrNull(this.id) ?: error("$this is not a friend") public fun Member.asFriend(): Friend = this.bot.getFriendOrNull(this.id) ?: error("$this is not a friend")
/** /**
* 得到此成员作为好友的对象, 当此成员不是好友时返回 `null` * 得到此成员作为好友的对象, 当此成员不是好友时返回 `null`
*/ */
fun Member.asFriendOrNull(): Friend? = this.bot.getFriendOrNull(this.id) public fun Member.asFriendOrNull(): Friend? = this.bot.getFriendOrNull(this.id)
/** /**
* 判断此成员是否为好友 * 判断此成员是否为好友
*/ */
inline val Member.isFriend: Boolean public inline val Member.isFriend: Boolean
get() = this.bot.friends.contains(this.id) get() = this.bot.friends.contains(this.id)
/** /**
* 如果此成员是好友, 则执行 [block] 并返回其返回值. 否则返回 `null` * 如果此成员是好友, 则执行 [block] 并返回其返回值. 否则返回 `null`
*/ */
inline fun <R> Member.takeIfIsFriend(block: (Friend) -> R): R? { public inline fun <R> Member.takeIfIsFriend(block: (Friend) -> R): R? {
return this.asFriendOrNull()?.let(block) return this.asFriendOrNull()?.let(block)
} }
@@ -200,7 +200,7 @@ inline fun <R> Member.takeIfIsFriend(block: (Friend) -> R): R? {
* *
* 若 [群名片][Member.nameCard] 不为空则返回群名片, 为空则返回 [User.nick] * 若 [群名片][Member.nameCard] 不为空则返回群名片, 为空则返回 [User.nick]
*/ */
val Member.nameCardOrNick: String get() = this.nameCard.takeIf { it.isNotEmpty() } ?: this.nick public val Member.nameCardOrNick: String get() = this.nameCard.takeIf { it.isNotEmpty() } ?: this.nick
/** /**
* 获取非空群名片或昵称. * 获取非空群名片或昵称.
@@ -209,7 +209,7 @@ val Member.nameCardOrNick: String get() = this.nameCard.takeIf { it.isNotEmpty()
* *
* 否则返回 [Member.nick] * 否则返回 [Member.nick]
*/ */
val User.nameCardOrNick: String public val User.nameCardOrNick: String
get() = when (this) { get() = when (this) {
is Member -> this.nameCardOrNick is Member -> this.nameCardOrNick
else -> this.nick else -> this.nick
@@ -218,14 +218,14 @@ val User.nameCardOrNick: String
/** /**
* 判断群成员是否处于禁言状态. * 判断群成员是否处于禁言状态.
*/ */
val Member.isMuted: Boolean public val Member.isMuted: Boolean
get() = muteTimeRemaining != 0 && muteTimeRemaining != 0xFFFFFFFF.toInt() get() = muteTimeRemaining != 0 && muteTimeRemaining != 0xFFFFFFFF.toInt()
/** /**
* @see Member.mute * @see Member.mute
*/ */
@ExperimentalTime @ExperimentalTime
suspend inline fun Member.mute(duration: Duration) { public suspend inline fun Member.mute(duration: Duration) {
require(duration.inDays <= 30) { "duration must be at most 1 month" } require(duration.inDays <= 30) { "duration must be at most 1 month" }
require(duration.inSeconds > 0) { "duration must be greater than 0 second" } require(duration.inSeconds > 0) { "duration must be greater than 0 second" }
this.mute(duration.inSeconds.toInt()) this.mute(duration.inSeconds.toInt())
@@ -234,4 +234,4 @@ suspend inline fun Member.mute(duration: Duration) {
/** /**
* @see Member.mute * @see Member.mute
*/ */
suspend inline fun Member.mute(durationSeconds: Long) = this.mute(durationSeconds.toInt()) public suspend inline fun Member.mute(durationSeconds: Long): Unit = this.mute(durationSeconds.toInt())

View File

@@ -26,7 +26,7 @@ import kotlin.internal.InlineOnly
* @see Member.isOperator 对 [Member] 的扩展函数, 判断此成员是否为管理员或群主 * @see Member.isOperator 对 [Member] 的扩展函数, 判断此成员是否为管理员或群主
* @see Member.isAdministrator 对 [Member] 的扩展函数, 判断此成员是否为管理员 * @see Member.isAdministrator 对 [Member] 的扩展函数, 判断此成员是否为管理员
*/ */
enum class MemberPermission : Comparable<MemberPermission> { public enum class MemberPermission : Comparable<MemberPermission> {
/** /**
* 一般群成员 * 一般群成员
*/ */
@@ -45,7 +45,7 @@ enum class MemberPermission : Comparable<MemberPermission> {
/** /**
* 权限等级. [OWNER] 为 2, [ADMINISTRATOR] 为 1, [MEMBER] 为 0 * 权限等级. [OWNER] 为 2, [ADMINISTRATOR] 为 1, [MEMBER] 为 0
*/ */
val level: Int public val level: Int
get() = ordinal get() = ordinal
} }
@@ -53,44 +53,44 @@ enum class MemberPermission : Comparable<MemberPermission> {
* 判断权限是否为群主 * 判断权限是否为群主
*/ */
@InlineOnly @InlineOnly
inline fun MemberPermission.isOwner(): Boolean = this == MemberPermission.OWNER public inline fun MemberPermission.isOwner(): Boolean = this == MemberPermission.OWNER
/** /**
* 判断权限是否为管理员 * 判断权限是否为管理员
*/ */
@InlineOnly @InlineOnly
inline fun MemberPermission.isAdministrator(): Boolean = this == MemberPermission.ADMINISTRATOR public inline fun MemberPermission.isAdministrator(): Boolean = this == MemberPermission.ADMINISTRATOR
/** /**
* 判断权限是否为管理员或群主 * 判断权限是否为管理员或群主
*/ */
@InlineOnly @InlineOnly
inline fun MemberPermission.isOperator(): Boolean = isAdministrator() || isOwner() public inline fun MemberPermission.isOperator(): Boolean = isAdministrator() || isOwner()
/** /**
* 判断权限是否为群主 * 判断权限是否为群主
*/ */
inline fun Member.isOwner(): Boolean = this.permission.isOwner() public inline fun Member.isOwner(): Boolean = this.permission.isOwner()
/** /**
* 判断权限是否为管理员 * 判断权限是否为管理员
*/ */
inline fun Member.isAdministrator(): Boolean = this.permission.isAdministrator() public inline fun Member.isAdministrator(): Boolean = this.permission.isAdministrator()
/** /**
* 判断权限是否为管理员或群主 * 判断权限是否为管理员或群主
*/ */
inline fun Member.isOperator(): Boolean = this.permission.isOperator() public inline fun Member.isOperator(): Boolean = this.permission.isOperator()
/** /**
* 权限不足 * 权限不足
*/ */
@Suppress("unused") @Suppress("unused")
class PermissionDeniedException : IllegalStateException { public class PermissionDeniedException : IllegalStateException {
constructor() : super("Permission denied") public constructor() : super("Permission denied")
constructor(message: String?) : super(message) public constructor(message: String?) : super(message)
} }
/** /**
@@ -98,7 +98,7 @@ class PermissionDeniedException : IllegalStateException {
* *
* @throws PermissionDeniedException * @throws PermissionDeniedException
*/ */
inline fun Group.checkBotPermission( public inline fun Group.checkBotPermission(
required: MemberPermission, required: MemberPermission,
crossinline lazyMessage: () -> String = { crossinline lazyMessage: () -> String = {
"Permission denied: required $required, got actual $botPermission for $bot in group $id" "Permission denied: required $required, got actual $botPermission for $bot in group $id"
@@ -115,8 +115,8 @@ inline fun Group.checkBotPermission(
* @throws PermissionDeniedException * @throws PermissionDeniedException
*/ */
@Deprecated("use checkBotPermission", ReplaceWith("checkBotPermission(MemberPermission.ADMINISTRATOR)")) @Deprecated("use checkBotPermission", ReplaceWith("checkBotPermission(MemberPermission.ADMINISTRATOR)"))
inline fun Group.checkBotPermissionOperator( public inline fun Group.checkBotPermissionOperator(
crossinline lazyMessage: () -> String = { crossinline lazyMessage: () -> String = {
"Permission denied: required ${MemberPermission.ADMINISTRATOR} or ${MemberPermission.OWNER}, got actual $botPermission for $bot in group $id" "Permission denied: required ${MemberPermission.ADMINISTRATOR} or ${MemberPermission.OWNER}, got actual $botPermission for $bot in group $id"
} }
) = checkBotPermission(MemberPermission.ADMINISTRATOR, lazyMessage) ): Unit = checkBotPermission(MemberPermission.ADMINISTRATOR, lazyMessage)

Some files were not shown because too many files have changed in this diff Show More