添加游戏中途挂起,返回同步数据

This commit is contained in:
kron
2025-07-22 15:47:07 +08:00
parent e5a28fd4ac
commit eb1c2f7f41
6 changed files with 330 additions and 232 deletions

View File

@@ -28,8 +28,18 @@ function createWebSocket(token, onMessage) {
const msg = data.data.updates[0];
if (!msg) return;
if (msg.constructor === MESSAGETYPES.BackToGame) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (
currentPage.route === "pages/battle-room" ||
currentPage.route === "pages/team-match" ||
currentPage.route === "pages/melee-match"
) {
return;
}
const { battleInfo } = msg;
uni.setStorageSync("current-battle", battleInfo);
console.log("----battleInfo", battleInfo);
// 约战
if (battleInfo.config.battleMode === 1) {
uni.navigateTo({