fix: 百人赛匹配、活动进度异常处理,黄金矿工样式

This commit is contained in:
guanchao
2026-10-22 17:17:52 +08:00
parent 421e35b89c
commit 47995a0ba0
18 changed files with 575 additions and 350 deletions
@@ -1,9 +1,10 @@
import Utils from "../Pay/Utils";
import ActivityBundleLoader from "./ActivityBundleLoader";
function traceResources(event: string, details: any, error?: any) {
console[error ? 'error' : 'log']('[CloudRiseFlow] ' + event + ' ' + JSON.stringify({ ...details,
...(error ? { error: { message: error.message || String(error), errMsg: error.errMsg, stack: error.stack } } : {}) }));
function traceResources(event: string, details: any, error: any) {
if (!error) return;
console.error('[CloudRiseFlow] ' + event + ' ' + JSON.stringify({ ...details,
error: { message: error.message || String(error), errMsg: error.errMsg, stack: error.stack } }));
}
/** The home bundle is a local subpackage; matching/stages load independently. */
@@ -128,19 +129,15 @@ export default class CloudRiseService {
static async pageFragment(page: "matching" | "stage", stage = 1): Promise<cc.Prefab> {
if (page === "stage" && ![1, 2, 3].includes(stage)) throw new Error("无效的百人赛阶段");
const name = page === "matching" ? "matching" : "stage" + stage;
traceResources('fragment.request', { name, page, stage });
const release = this.retainResources();
let phase = 'home-and-manifest';
try {
await Promise.all([this.bundle(), this.prepareActivityVersion()]);
phase = 'art';
traceResources('fragment.art', { name });
await ActivityBundleLoader.ensureBundle("art");
phase = 'page-bundle';
traceResources('fragment.bundle', { name });
const bundle = await ActivityBundleLoader.ensureBundle(name);
phase = 'prefab';
traceResources('fragment.prefab', { name, path: 'prefab/CloudRise', cached: !!this.pageTasks[name] && this.pageTasks[name].bundle === bundle });
if (!this.pageTasks[name] || this.pageTasks[name].bundle !== bundle) {
const entry = { bundle, task: null as Promise<cc.Prefab> };
entry.task = new Promise<cc.Prefab>((resolve, reject) => {
@@ -149,7 +146,6 @@ export default class CloudRiseService {
this.pageTasks[name] = entry;
}
const prefab = await this.pageTasks[name].task;
traceResources('fragment.ready', { name });
return prefab;
} catch (error) { traceResources('fragment.failed', { name, phase }, error); throw error; }
finally { release(); }
+1 -1
View File
@@ -779,7 +779,7 @@ export class GameConfig {
vibrateOpen: true, //震动
coinnum: 0, //每局的金币数
paid_user: false, //是否是付费用户
version: "1.0.92", //版本号
version: "1.0.93", //版本号
shushu_DistinctId: "", //数数访客ID
shushu_AccountId: "", //数数账号ID
uid: "", //用户和后端唯一id
+5 -1
View File
@@ -67,7 +67,11 @@ export function starterPackFailureKey(): string {
export function starterPackRecordResult(won: boolean): number {
const key = starterPackFailureKey();
const count = won ? 0 : Math.min(4, Math.max(0, Number(cc.fx.StorageMessage.getStorage(key)) || 0) + 1);
if (won) {
cc.fx.StorageMessage.removeStorage(key);
return 0;
}
const count = Math.min(4, Math.max(0, Number(cc.fx.StorageMessage.getStorage(key)) || 0) + 1);
cc.fx.StorageMessage.setStorage(key, count);
return count;
}