From cdd9e92fff491e8bb287af08304dfcf577ea05c4 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 8 Feb 2026 16:17:14 +0800 Subject: [PATCH] =?UTF-8?q?SDK=E6=94=AF=E6=8C=81=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E8=B7=A8=E6=88=BF=E5=BC=B9=E5=B9=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blcsdk/__init__.py | 2 +- blcsdk/models.py | 4 ++++ frontend/src/api/chat/ChatClientRelay.js | 2 +- frontend/src/blcsdk.js | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/blcsdk/__init__.py b/blcsdk/__init__.py index 2606287..445475e 100644 --- a/blcsdk/__init__.py +++ b/blcsdk/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = '1.0.0' +__version__ = '1.0.1' from .handlers import * from .client import * diff --git a/blcsdk/models.py b/blcsdk/models.py index b71af77..efc5acf 100644 --- a/blcsdk/models.py +++ b/blcsdk/models.py @@ -221,6 +221,8 @@ class AddTextMsg: """用户Open ID或ID""" medal_name: str = '' """勋章名""" + is_mirror: bool = False + """是否跨房弹幕,v1.10.2添加""" @classmethod def from_command(cls, data: list): @@ -229,6 +231,7 @@ class AddTextMsg: if content_type == ContentType.EMOTICON: content_type_params = {'url': content_type_params[0]} + data_len = len(data) return cls( avatar_url=data[0], timestamp=data[1], @@ -247,6 +250,7 @@ class AddTextMsg: content_type_params=content_type_params, uid=data[16], medal_name=data[17], + is_mirror=bool(data[18]) if data_len > 18 else False, ) diff --git a/frontend/src/api/chat/ChatClientRelay.js b/frontend/src/api/chat/ChatClientRelay.js index 73808a7..cb16862 100644 --- a/frontend/src/api/chat/ChatClientRelay.js +++ b/frontend/src/api/chat/ChatClientRelay.js @@ -182,7 +182,7 @@ export default class ChatClientRelay { id: data[11], translation: data[12], emoticon: emoticon, - isMirror: data[18], + isMirror: Boolean(data[18]), uid: data[16], medalName: data[17], }) diff --git a/frontend/src/blcsdk.js b/frontend/src/blcsdk.js index 3306c70..c318168 100644 --- a/frontend/src/blcsdk.js +++ b/frontend/src/blcsdk.js @@ -9,7 +9,7 @@ }(typeof self !== 'undefined' ? self : this, function() { const exports = {} - const VERSION = '1.0.1' + const VERSION = '1.0.2' /** * 取SDK版本 * @returns {string} "1.0.0" @@ -424,6 +424,7 @@ * @property {string} uid 用户Open ID或ID,使用房间ID连接时不保证是唯一的 * @property {number} medalLevel 勋章等级,如果没戴当前房间勋章则为0 * @property {string} medalName 勋章名,如果没戴当前房间勋章则为空字符串 + * @property {?boolean} isMirror 是否跨房弹幕,v1.10.2添加 */ exports.TextMsg = /** @type {TextMsg} */ (undefined)