添加游戏异常结束处理
This commit is contained in:
@@ -421,11 +421,18 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
uni.setStorageSync("last-battle", msg.endStatus);
|
uni.setStorageSync("last-battle", msg.endStatus);
|
||||||
|
if (msg.endStatus.nosaved) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "游戏结束",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -148,10 +148,17 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
uni.setStorageSync("last-battle", msg.endStatus);
|
uni.setStorageSync("last-battle", msg.endStatus);
|
||||||
|
if (msg.endStatus.nosaved) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "游戏结束",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
|
|||||||
@@ -214,10 +214,17 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
uni.setStorageSync("last-battle", msg.endStatus);
|
uni.setStorageSync("last-battle", msg.endStatus);
|
||||||
|
if (msg.endStatus.nosaved) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "游戏结束",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user