update:语音加载优化,修复大乱斗未重连比赛服问题
This commit is contained in:
@@ -65,6 +65,12 @@ function clearHalfRestCountdown() {
|
||||
}
|
||||
}
|
||||
|
||||
function leaveHalfRest() {
|
||||
clearHalfRestCountdown();
|
||||
halfTimeTip.value = false;
|
||||
halfRest.value = false;
|
||||
}
|
||||
|
||||
function getHalfRestSeconds(battleInfo) {
|
||||
const remainCandidates = [
|
||||
battleInfo?.halfRestRemain,
|
||||
@@ -204,7 +210,7 @@ function takeReadySnapshot(matchId) {
|
||||
|
||||
function reconnectMatchServer(battleInfo) {
|
||||
const status = Number(battleInfo?.status);
|
||||
if ([2, 3, 4].includes(status)) return;
|
||||
if ([2, 4].includes(status)) return;
|
||||
if (!battleInfo?.serverAddr) return;
|
||||
|
||||
connectMatchWebSocket({
|
||||
@@ -311,6 +317,7 @@ function recoverData(battleInfo, { force = false } = {}) {
|
||||
}, 200);
|
||||
return;
|
||||
}
|
||||
leaveHalfRest();
|
||||
if (force) {
|
||||
const remain = (Date.now() - (battleInfo.current?.startTime || Date.now())) / 1000;
|
||||
console.log(`当前轮已进行${remain}秒`);
|
||||
@@ -422,9 +429,7 @@ async function onReceiveMessage(msg) {
|
||||
if (msg.type === MESSAGETYPESV2.AboutToStart) {
|
||||
recoverData(msg);
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleStart) {
|
||||
clearHalfRestCountdown();
|
||||
halfTimeTip.value = false;
|
||||
halfRest.value = false;
|
||||
leaveHalfRest();
|
||||
recoverData(msg);
|
||||
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
// 更新前快照各玩家本轮已射箭数,用于事后识别本次射手
|
||||
|
||||
Reference in New Issue
Block a user