From c5806d47d3e077987e185727975cb280340d3e37 Mon Sep 17 00:00:00 2001 From: Megghy Date: Tue, 14 Nov 2023 21:27:34 +0800 Subject: [PATCH] update check logic --- src/views/open_live/OpenLottery.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/open_live/OpenLottery.vue b/src/views/open_live/OpenLottery.vue index 5f0fa6b..7637ca7 100644 --- a/src/views/open_live/OpenLottery.vue +++ b/src/views/open_live/OpenLottery.vue @@ -186,7 +186,7 @@ async function initChatClient() { console.log('[OPEN-LIVE] 已连接房间: ' + authResult.value?.anchor_info.room_id) } function addUser(user: OpenLiveLotteryUserInfo, danmu: any) { - if (originUsers.value.find((u) => u.uId == user.uId)) { + if (originUsers.value.find((u) => u.uId == user.uId) || !isStartLottery.value) { return } if (isUserValid(user, danmu)) { @@ -201,6 +201,12 @@ function addUser(user: OpenLiveLotteryUserInfo, danmu: any) { function isUserValid(u: OpenLiveLotteryUserInfo, danmu: any) { const cmd = danmu.cmd const data = danmu.data + if (cmd === 'LIVE_OPEN_PLATFORM_DM' && lotteryOption.value.type != 'danmaku') { + return false + } + if (cmd === 'IVE_OPEN_PLATFORM_SEND_GIFT' && lotteryOption.value.type != 'gift') { + return false + } if (lotteryOption.value.needWearFanMedal) { if (!u.fans_medal_wearing_status) return false }