fix: onBeforeUnmount 补充 uni.$off("socket-inbox", onReceiveMessage)&ToSomeoneShoot 消息去重防护(lastToSomeoneShootKey)

This commit is contained in:
2026-05-12 16:01:29 +08:00
parent cf8d6135ff
commit 956e82e10c
2 changed files with 15 additions and 1 deletions

View File

@@ -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) {