Introduce event dispatcher and fix heartbeat, auth reply events
This commit is contained in:
34 files changed
+686
-345
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform")
|
||||
kotlin("plugin.serialization")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
explicitApi()
|
||||
|
||||
linuxX64()
|
||||
linuxArm64()
|
||||
macosArm64()
|
||||
mingwX64()
|
||||
jvm { compilerOptions.jvmTarget = JvmTarget.JVM_11 }
|
||||
|
||||
sourceSets {
|
||||
commonMain.dependencies {
|
||||
api(project(":bl-codec"))
|
||||
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0")
|
||||
}
|
||||
|
||||
commonTest.dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.11.0")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright © 2026 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2026/8/31
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.bldm.dto
|
||||
|
||||
public object BldmConstant {
|
||||
public const val REAL_ROOM_ID_URL: String = "https://api.live.bilibili.com/room/v1/Room/room_init"
|
||||
public const val USER_NAV_URL: String = "https://api.bilibili.com/x/web-interface/nav"
|
||||
public const val DM_SERVER_CONF_URL: String =
|
||||
"https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo"
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright © 2026 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2026/8/29
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.bldm.dto
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.Transient
|
||||
|
||||
@Serializable
|
||||
public data class DMServerConf(
|
||||
val data: ServerConf,
|
||||
) {
|
||||
@Serializable
|
||||
public data class ServerConf(
|
||||
val token: String,
|
||||
@SerialName("host_list")
|
||||
val hostList: List<ServerHost>,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
public data class ServerHost(
|
||||
val host: String,
|
||||
val port: Int,
|
||||
@SerialName("wss_port")
|
||||
val wssPort: Int,
|
||||
@SerialName("ws_port")
|
||||
val wsPort: Int,
|
||||
) {
|
||||
@Transient
|
||||
public val tlsWsAddress: String = "wss://$host:$wssPort/sub"
|
||||
|
||||
@Transient
|
||||
public val wsAddress: String = "ws://$host:$wsPort/sub"
|
||||
}
|
||||
|
||||
@Transient
|
||||
public val defaultServerHost: ServerHost = ServerHost("broadcastlv.chat.bilibili.com", 2243, 2245, 2244)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright © 2026 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2026/8/29
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.bldm.dto
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
public data class RealRoomId(
|
||||
val data: RoomId
|
||||
) {
|
||||
@Serializable
|
||||
public data class RoomId(
|
||||
@SerialName("room_id")
|
||||
val roomId: Long
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright © 2026 RTAkland
|
||||
* Author: RTAkland
|
||||
* Date: 2026/8/30
|
||||
*/
|
||||
|
||||
|
||||
package cn.rtast.bldm.dto
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
public data class UserNavData(
|
||||
val data: NavData,
|
||||
) {
|
||||
|
||||
@Serializable
|
||||
public data class NavData(
|
||||
@SerialName("wbi_img")
|
||||
val wbiImg: WbiImg,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
public data class WbiImg(
|
||||
@SerialName("img_url")
|
||||
val imgUrl: String,
|
||||
@SerialName("sub_url")
|
||||
val subUrl: String,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user