优化逻辑

master
yin5th 2021-11-24 20:31:03 +08:00
parent 3172d35877
commit d71a5461ea
1 changed files with 1 additions and 9 deletions

View File

@ -161,18 +161,10 @@ function receiveMessage(event)
let leaderInfo = sessionStorage.getItem('leader')
let isLeader = data.uname == leaderInfo ? 1 : 0
// 给弹幕加上随机事件
let mathIndex = Math.floor(Math.random()*15)
// console.log(mathIndex, '随机因子')
let randomEvent = eventTextList[mathIndex] ? eventTextList[mathIndex] : ''
// TODO 测试后 删除弹幕随机附加事件
let dm = {text: data.danmaku, uid: data.uid, uname: data.uname,
event: getEvent(getFirstEventKeyword(data.danmaku)),
event: getEvent(data.danmaku),
is_new: isNew, is_admin: 0, is_exit: random2, is_leader: isLeader}
// TODO 测试后 删除领舞随机
// let leaderRandomEvent = getEvent(getFirstEventKeyword(data.danmaku+randomEvent))
let leader = {
// uid: 0, uname: leaderInfo, text: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)), event: leaderRandomEvent
uid: 0, uname: leaderInfo, text: '', event: ''
}
if (isLeader) {