check selfdm

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-09 23:00:50 +08:00
parent 9fbe824d6d
commit 5f77a8aa19
8 changed files with 71 additions and 9 deletions

View File

@@ -55,11 +55,12 @@ class PlDanmakuController {
if (mergeDanmaku) {
final count = counts[element.content];
if (count != 1) {
element.attr = count!;
} else {
element.clearAttr();
element.count = count!;
}
}
if (plPlayerController.isLogin) {
element.isSelf = element.midHash == plPlayerController.midHash;
}
int pos = element.progress ~/ 100; //每0.1秒存储一次
(dmSegMap[pos] ??= []).add(element);
}

View File

@@ -130,9 +130,8 @@ class _PlDanmakuState extends State<PlDanmaku> {
e.colorful == DmColorfulType.VipGradualColor
? true
: null,
count: widget.playerController.mergeDanmaku && e.hasAttr()
? e.attr
: null,
count: e.hasCount() ? e.count : null,
selfSend: e.isSelf,
),
);
}

View File

@@ -49,13 +49,14 @@ class LiveRoomController extends GetxController {
String? savedDanmaku;
late final isLogin = Accounts.main.isLogin;
late final mid = Accounts.main.mid;
@override
void onInit() {
super.onInit();
roomId = int.parse(Get.parameters['roomid']!);
queryLiveInfoH5();
if (Accounts.main.isLogin && !MineController.anonymity.value) {
if (isLogin && !MineController.anonymity.value) {
VideoHttp.roomEntryAction(roomId: roomId);
}
}
@@ -221,9 +222,10 @@ class LiveRoomController extends GetxController {
final content = first[15];
final extra = jsonDecode(content['extra']);
final user = content['user'];
final uid = user['uid'];
messages.add({
'name': user['base']['name'],
'uid': user['uid'],
'uid': uid,
'text': info[1],
'emots': extra['emots'],
'uemote': first[13],
@@ -234,6 +236,7 @@ class LiveRoomController extends GetxController {
extra['content'],
color: DmUtils.decimalToColor(extra['color']),
type: DmUtils.getPosition(extra['mode']),
selfSend: uid == mid,
),
);
WidgetsBinding.instance