优化逻辑
parent
3172d35877
commit
d71a5461ea
10
js/handle.js
10
js/handle.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue