细节优化

This commit is contained in:
kron
2025-07-28 09:02:02 +08:00
parent 7ce8b9c513
commit 0d7a421546
5 changed files with 105 additions and 114 deletions

View File

@@ -95,6 +95,7 @@ onLoad(async (options) => {
if (options.battleId) {
const battleInfo = uni.getStorageSync("current-battle");
if (battleInfo) recoverData(battleInfo);
setTimeout(getCurrentGameAPI, 2000);
} else {
gameType.value = options.gameType;
teamSize.value = options.teamSize;
@@ -110,13 +111,6 @@ async function stopMatch() {
async function onReceiveMessage(messages = []) {
messages.forEach((msg) => {
if (
!msg.id ||
(battleId.value && msg.id === battleId.value) ||
msg.constructor === MESSAGETYPES.WaitForAllReady
) {
console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
}
if (msg.constructor === MESSAGETYPES.WaitForAllReady) {
onComplete.value = () => {
// 这里会掉多次;