fix: onBeforeUnmount 补充 uni.$off("socket-inbox", onReceiveMessage)&ToSomeoneShoot 消息去重防护(lastToSomeoneShootKey)
This commit is contained in:
@@ -52,7 +52,8 @@ async function onReceiveMessage(message) {
|
||||
const { type, mode, current, shootData } = message;
|
||||
if (type === MESSAGETYPESV2.BattleStart) {
|
||||
melee.value = Boolean(mode > 3);
|
||||
totalShot.value = mode === 1 ? 3 : 2;
|
||||
// 优先使用后端返回的 shootNumber,降级则根据 mode 推算
|
||||
totalShot.value = message.shootNumber ?? (mode === 1 ? 3 : 2);
|
||||
currentRoundEnded.value = true;
|
||||
audioManager.play("比赛开始");
|
||||
} else if (type === MESSAGETYPESV2.BattleEnd) {
|
||||
|
||||
Reference in New Issue
Block a user