This commit is contained in:
COMPUTER\EDY
2026-09-11 19:12:58 +08:00
37 changed files with 4268 additions and 4614 deletions
+2323 -2918
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -714,7 +714,7 @@ export class GameConfig {
vibrateOpen: true, //震动
coinnum: 0, //每局的金币数
paid_user: false, //是否是付费用户
version: "1.0.51", //版本号
version: "1.0.54", //版本号
shushu_DistinctId: "", //数数访客ID
shushu_AccountId: "", //数数账号ID
uid: "", //用户和后端唯一id
+12 -10
View File
@@ -388,9 +388,11 @@ var GameTool = {
//增加关卡数
addLevel(time1, time2, callBack) {
if (cc.fx.GameTool.maxLevel()) {
} else {
const isMaxLevel = cc.fx.GameTool.maxLevel();
// 结算记录本局关卡,避免进度自增后变成下一关或误判为无尽模式。
const endLevel = isMaxLevel && cc.fx.GameConfig.GM_INFO.GameplayType == 1;
const stageId = endLevel ? cc.fx.GameConfig.GM_INFO.randomLevel : cc.fx.GameConfig.GM_INFO.level + 1;
if (!isMaxLevel) {
cc.fx.GameConfig.GM_INFO.level += 1;
}
@@ -411,11 +413,8 @@ var GameTool = {
use_frenzy = MapConroler._instance.use_frenzy;
}
if (time1 != null && time2 != null) {
let endLevel = false;
if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.GameplayType == 1) {
endLevel = true;
}
let data = {
stage_id: stageId,
time: time1,
add_Time: time2,
is_frenzy: is_frenzy,
@@ -1396,9 +1395,12 @@ var GameTool = {
}
break;
case "finish_stage":
let userLevel2 = (cc.fx.GameConfig.GM_INFO.level + 1);
if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.GameplayType == 1) {
userLevel2 = cc.fx.GameConfig.GM_INFO.randomLevel;
let userLevel2 = data.stage_id;
if (userLevel2 == null) {
userLevel2 = cc.fx.GameConfig.GM_INFO.level + 1;
if (cc.fx.GameTool.maxLevel() && cc.fx.GameConfig.GM_INFO.GameplayType == 1) {
userLevel2 = cc.fx.GameConfig.GM_INFO.randomLevel;
}
}
eventData = {
stage_id: userLevel2,
@@ -38,7 +38,7 @@ export default class SevenDayGiftBootstrapApi {
}, 5500);
Utils.POST(endpoint, params, response => {
console.log("[signInActivityInfo] 回复" + (completed ? "(已超时或重复,不再处理)" : ""), JSON.stringify(response, null, 2));
// console.log("[signInActivityInfo] 回复" + (completed ? "(已超时或重复,不再处理)" : ""), JSON.stringify(response, null, 2));
if (completed) return;
completed = true;
clearTimeout(timeoutHandle);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 29 KiB

+6 -6
View File
@@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 186,
"height": 173,
"width": 417,
"height": 388,
"platformSettings": {},
"subMetas": {
"cat": {
@@ -24,10 +24,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 186,
"height": 173,
"rawWidth": 186,
"rawHeight": 173,
"width": 417,
"height": 388,
"rawWidth": 417,
"rawHeight": 388,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -141,7 +141,7 @@ export default class NewbieGift extends cc.Component {
this.iosOldPay();
return;
}
this.failPayment(result?.errMsg || "充值未完成");
this.failPayment("充值失败");
return;
}
if (!result.outTradeNo) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "b4ec62ca-378f-47e7-9482-e0126925cb96",
"uuid": "e6217000-0c4c-42e0-995e-277ed44cad3a",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "15b1c43b-8bfc-4813-ac6f-526ed9380229",
"uuid": "07ba5301-e263-4d5a-806d-5798205a4cac",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "b03371a6-f842-44e5-8346-5413ece72cef",
"uuid": "e0501434-8366-498b-b95c-70f8acaba7f4",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "10b0a4c1-4e12-40df-b44c-4e62f546fd59",
"uuid": "6e31d016-b6d3-46b9-be2b-93336782cfc3",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "3c7e7970-336a-4cb4-ab47-90264478faaf",
"uuid": "315955ed-6683-4e51-bc22-4b08b2772df6",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "7587441a-d046-4e46-a36c-80a880aa1e20",
"uuid": "34b80ceb-def1-48b2-b3f3-038ac8696f89",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "2268a496-b07e-4c68-9fb6-cd229569842f",
"uuid": "ddab8a16-a34e-4942-a36a-cddefb3b030d",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "c38750d1-7256-4ae0-9c6f-f20cd7dd9c0d",
"uuid": "b780a788-eb74-42f6-8d0e-2b9b08185548",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "7aca1df2-3920-4492-b6cd-f4730505a262",
"uuid": "5489f215-51eb-4393-90ba-163281dde029",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "a3c6e8ac-5d57-44b5-b5dc-b94c3e6897cc",
"uuid": "55719eeb-db23-4576-b836-225b208b06a8",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "a4a55a06-d2c2-4406-bde0-a15e8b424973",
"uuid": "76c36b1a-04c7-47bd-af16-b9b777dc13db",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "7c22d643-c602-4436-a77a-5193fa047cab",
"uuid": "cd640ad5-be73-4467-832e-71685881e010",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "8115e604-9bbf-4309-afed-df32a9634f9c",
"uuid": "becd2ead-17e2-47e9-8310-e29a473e2df0",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "a7ec6491-26ac-474f-a50e-a67e55ea4946",
"uuid": "970edd16-2703-49a3-9a1b-0bd7b21a0b51",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "465c68a3-a0f9-4dd5-81af-01450574b63a",
"uuid": "41c32cf5-1b98-4754-a8d8-ed7dc291502e",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "04849aba-d519-4a6f-8b25-0bdd628b07b9",
"uuid": "590623cd-fae7-4b71-9521-b43a9259db70",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "29fba393-22fa-4bf5-96fa-c729c68af317",
"uuid": "5563966a-1d11-4b55-88e3-336fa9e48d5d",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "c043e887-e678-4d63-ad34-9cb44c05c485",
"uuid": "fec8be99-49c3-4c3d-aea4-96f87149cccb",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.0.2",
"uuid": "f7ed93a3-c33c-469d-a32d-2c6f4307433e",
"uuid": "a9b5ef72-a5bc-47ac-a3ad-fc3021407767",
"importer": "json",
"subMetas": {}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.1.3",
"uuid": "c42ca589-f18f-4ece-a24d-b5262734a10a",
"uuid": "aef15769-3ab2-4a0e-8b96-022a6d62696d",
"importer": "folder",
"isBundle": false,
"bundleName": "",
+1 -1
View File
@@ -165,7 +165,7 @@ export default class GachaManager extends cc.Component {
});
}
else if (res.code == 0) {
MiniGameSdk.API.showToast(res.msg);
// MiniGameSdk.API.showToast(res.msg);
cc.fx.GameTool.shushu_Track("avatar_gacha", {
pool_id: "spring",
pull_count: (this.own + 1),
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.1.3",
"uuid": "602e6e21-8970-4b57-862e-0553f5e88a26",
"uuid": "97538b78-7842-4668-9318-e04946661548",
"importer": "folder",
"isBundle": false,
"bundleName": "",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.1.3",
"uuid": "8b57e045-f93c-48f0-8447-8e0d33fdc582",
"uuid": "da60b47d-5d32-4804-8b5f-3411aff909a3",
"importer": "folder",
"isBundle": false,
"bundleName": "",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"ver": "1.1.3",
"uuid": "f7a94941-d75a-437b-ae31-2d25e812e70b",
"uuid": "b9306325-5a69-49d8-8065-461b7b0e87a8",
"importer": "folder",
"isBundle": false,
"bundleName": "",
+9 -9
View File
@@ -2637,7 +2637,7 @@
"ctor": "Float64Array",
"array": [
49.628,
50.547,
91.915,
0,
0,
0,
@@ -2946,8 +2946,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 395,
"height": 402
"width": 392,
"height": 399
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -2959,7 +2959,7 @@
"ctor": "Float64Array",
"array": [
11.564,
-200,
-196.188,
0,
0,
0,
@@ -2999,7 +2999,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "43a66e64-aeca-44fb-8322-ec56eabd543c"
"__uuid__": "a18073a3-11b7-4fd1-a043-814b30a83b82"
},
"_type": 0,
"_sizeMode": 1,
@@ -10976,10 +10976,10 @@
"catUI": {
"__uuid__": "ff580ec5-b05e-404f-b9f2-3e6a0fd2863c"
},
"_id": "",
"cat12": {
"__uuid__": "7d090003-0209-4a00-8b00-000000000209"
}
"__uuid__": "cbd01a77-0102-4324-a1aa-bcbc6f816850"
},
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
@@ -14488,4 +14488,4 @@
"fileId": "",
"sync": false
}
]
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+38
View File
@@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "ab6fdc88-7163-4370-bd1d-23792f25c591",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 417,
"height": 388,
"platformSettings": {},
"subMetas": {
"cat": {
"ver": "1.0.6",
"uuid": "cbd01a77-0102-4324-a1aa-bcbc6f816850",
"importer": "sprite-frame",
"rawTextureUuid": "ab6fdc88-7163-4370-bd1d-23792f25c591",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 417,
"height": 388,
"rawWidth": 417,
"rawHeight": 388,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
+99
View File
@@ -0,0 +1,99 @@
// Run: node --test tools/test-finish-stage.cjs
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const vm = require('node:vm');
const ts = require('typescript');
const file = path.join(__dirname, '../assets/Script/module/Tool/GameTool.ts');
const source = ts.createSourceFile(file, fs.readFileSync(file, 'utf8'), ts.ScriptTarget.Latest, true);
const declaration = source.statements.filter(ts.isVariableStatement)
.flatMap(statement => [...statement.declarationList.declarations])
.find(node => node.name.getText(source) === 'GameTool');
const members = declaration.initializer.properties.filter(node =>
['MAX_NORMAL_LEVEL', 'addLevel', 'maxLevel', 'shushu_Track'].includes(node.name?.getText(source)));
const code = ts.transpileModule('({' + members.map(node => node.getText(source)).join(',\n') + '})', {
compilerOptions: { target: ts.ScriptTarget.ES2017 },
}).outputText;
function fixture(overrides = {}) {
const info = { level: 0, GameplayType: 1, randomLevel: 321, otherLevel: 0, addLevel: 0,
winStreak: 2, address: 'test', ...overrides };
const events = [], progress = [], gravity = [], storage = new Map();
const cc = { fx: { GameConfig: { GM_INFO: info }, StorageMessage: {
setStorage: (key, value) => storage.set(key, value),
} } };
const api = {
setNewCloudlevel: () => progress.push({ target: 'cloud', level: info.level }),
shushu_SetSuperProperties() {},
shushu_Track: (name, data) => events.push({ name, data }),
yinli_FinishiStage: () => gravity.push(info.level),
};
const tool = vm.runInNewContext(code, { cc, MiniGameSdk: { API: api },
MapConroler: { _instance: { is_frenzy: true, use_frenzy: true, total_steps_count: 7 } },
Utils: { setUserLevel(done, infinity) {
progress.push({ target: 'server', level: info.level, infinity });
done({ code: 1, data: {} });
} },
});
cc.fx.GameTool = tool;
return { info, tool, events, progress, gravity, storage };
}
const maxLevel = fixture().tool.MAX_NORMAL_LEVEL;
for (const scenario of [
{ name: 'first stage', level: 0, stage: 1 },
{ name: 'ordinary stage', level: 41, stage: 42 },
{ name: 'last normal stage', level: maxLevel - 1, stage: maxLevel },
{ name: 'endless stage', level: maxLevel, stage: 321, infinity: true },
]) {
test(`${scenario.name}: success reports the entered stage and saves advanced progress`, () => {
const f = fixture({ level: scenario.level });
f.tool.shushu_Track('enter_stage', { infinity: !!scenario.infinity });
let completed = false;
f.tool.addLevel(1200, 0, () => { completed = true; });
const entered = f.events.find(event => event.name === 'enter_stage').data;
const finished = f.events.find(event => event.name === 'finish_stage').data;
assert.equal(finished.stage_id, scenario.stage);
assert.equal(finished.stage_id, entered.stage_id);
assert.equal(finished.infinity, !!scenario.infinity);
assert.equal(finished.result, 'success');
assert.equal(finished.stage_duration, 1200);
assert.equal(finished.added_time, 0);
assert.equal(finished.use_frenzy, true);
assert.equal(finished.total_steps_count, 7);
const nextLevel = Math.min(scenario.level + 1, maxLevel);
assert.equal(f.info.level, nextLevel);
assert.equal(f.storage.get('level').level, nextLevel);
assert.deepEqual(f.progress, [
{ target: 'cloud', level: nextLevel },
{ target: 'server', level: nextLevel, infinity: nextLevel === maxLevel },
]);
assert.deepEqual(f.gravity, [nextLevel]);
assert.equal(completed, true);
});
}
for (const result of ['failreason: time', 'give_up']) {
for (const scenario of [
{ name: 'normal', level: 41, stage: 42 },
{ name: 'endless', level: maxLevel, stage: 321 },
{ name: 'shared', level: 41, otherLevel: 88, stage: 88 },
]) {
test(`${scenario.name}: ${result} keeps its current stage without advancing progress`, () => {
const f = fixture(scenario);
f.tool.shushu_Track('finish_stage', { result, time: 1200, add_Time: 0 });
assert.equal(f.events[0].data.stage_id, scenario.stage);
assert.equal(f.events[0].data.result, result);
assert.equal(f.info.level, scenario.level);
});
}
}
test('skipping a missing level advances progress without a success event', () => {
const f = fixture();
f.tool.addLevel(null, null, null);
assert.equal(f.info.level, 1);
assert.equal(f.events.length, 0);
});