完成打乱斗数据调试
This commit is contained in:
@@ -56,31 +56,7 @@ function createWebSocket(token, onMessage) {
|
||||
const msg = data.updates[0];
|
||||
if (msg) {
|
||||
console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
|
||||
if (msg.constructor === MESSAGETYPES.BackToGame) {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
if (
|
||||
currentPage.route === "pages/battle-room" ||
|
||||
currentPage.route === "pages/team-battle" ||
|
||||
currentPage.route === "pages/melee-match"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const { battleInfo } = msg;
|
||||
uni.setStorageSync("current-battle", battleInfo);
|
||||
// console.log("----battleInfo", battleInfo);
|
||||
if (battleInfo.config.mode === 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/team-battle?battleId=${battleInfo.id}&gameMode=${battleInfo.config.battleMode}`,
|
||||
});
|
||||
} else if (battleInfo.config.mode === 2) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/melee-match?battleId=${battleInfo.id}&gameMode=${battleInfo.config.battleMode}`,
|
||||
});
|
||||
}
|
||||
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||
uni.$emit("game-over");
|
||||
} else if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||
if (msg.constructor === MESSAGETYPES.RankUpdate) {
|
||||
uni.setStorageSync("latestRank", msg.lvl);
|
||||
} else if (msg.constructor === MESSAGETYPES.LvlUpdate) {
|
||||
uni.setStorageSync("latestLvl", msg.lvl);
|
||||
|
||||
Reference in New Issue
Block a user