From 19bb63cd871c4da6d12be426c3defd2ad7c2288f Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 7 Sep 2026 11:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-conf/conf.d/nginx.conf | 24 -- .../src/playground/config_BACKUP_1249.js | 288 ------------------ .../src/playground/config_BASE_1249.js | 283 ----------------- .../src/playground/config_LOCAL_1249.js | 283 ----------------- .../src/playground/config_REMOTE_1249.js | 283 ----------------- 5 files changed, 1161 deletions(-) delete mode 100644 scratch-gui/src/playground/config_BACKUP_1249.js delete mode 100644 scratch-gui/src/playground/config_BASE_1249.js delete mode 100644 scratch-gui/src/playground/config_LOCAL_1249.js delete mode 100644 scratch-gui/src/playground/config_REMOTE_1249.js diff --git a/docker-conf/conf.d/nginx.conf b/docker-conf/conf.d/nginx.conf index e5789512..2eb2289d 100644 --- a/docker-conf/conf.d/nginx.conf +++ b/docker-conf/conf.d/nginx.conf @@ -17,23 +17,6 @@ server { return 301 /competition.html?competition_id=13; } -<<<<<<< HEAD - # Brotli 压缩 WebAssembly 文件处理 - location ~* \.wasm\.br$ { - default_type ""; - add_header Content-Encoding br; - add_header Content-Type application/wasm always; - add_header Vary Accept-Encoding; - expires 30d; - } - - location ~* \.asm\.js\.br$ { - default_type ""; - add_header Content-Encoding br; - add_header Content-Type application/javascript always; - add_header Vary Accept-Encoding; - expires 30d; -======= # Unity 预压缩文件:禁止再次 gzip,避免 Content-Length 与实际内容不一致 location ~* \.wasm\.br$ { gzip off; @@ -62,22 +45,15 @@ server { add_header Vary Accept-Encoding; add_header Accept-Ranges bytes; expires 1h; ->>>>>>> cocos-main } # 通用 Brotli 文件处理 location ~* \.br$ { -<<<<<<< HEAD - add_header Content-Encoding br; - add_header Vary Accept-Encoding; - expires 30d; -======= gzip off; add_header Content-Encoding br; add_header Vary Accept-Encoding; add_header Accept-Ranges bytes; expires 1h; ->>>>>>> cocos-main } # 静态资源缓存配置 diff --git a/scratch-gui/src/playground/config_BACKUP_1249.js b/scratch-gui/src/playground/config_BACKUP_1249.js deleted file mode 100644 index 4c93e2e0..00000000 --- a/scratch-gui/src/playground/config_BACKUP_1249.js +++ /dev/null @@ -1,288 +0,0 @@ -// config.js - -// const CONFIG = { -// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025010301", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn :true, //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:150, - -// SSN_COMPETITION_ID: [13], - -// // 计算关卡实际id -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, - -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } -// }; - - -// const CONFIG = { -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025011001", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// // disabledev: false, -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn : !(typeof localStorage !== 'undefined' && -// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:120, -// // 计算关卡实际id -// SSN_COMPETITION_ID: [21,22,23], - -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } - -// }; - - - -const CONFIG = { - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", - DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - - version: "20260717", - - /** OSS 真实地址(生产环境浏览器直连) */ - unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617', - /** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */ - unityCdnDevProxy: '/cdn-unity', - /** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */ - unityCdnUseDevProxy: false, - /** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */ - unityCdnUseSiteProxy: false, -<<<<<<< HEAD - unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260717', - unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260717/Build', -======= - unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617', - unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build', ->>>>>>> b08562d603e88576042ff972dedf771c32224b4b - python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/', - - // 可以根据需要添加其他配置 - - - - disabledev: false, - usecdn: true, - lvlock: false, - lvlock_normal_learn: !(typeof localStorage !== 'undefined' && - (localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')), - lockupdate: false, - mactchlv: false, - learnvideo: true, - gameNumber: 120, - //计算关卡实际id - SSN_COMPETITION_ID: [13], - NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], - BEGINNING_REAL_LVID: 91600, - END_REAL_LVID: 93100, - SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID - HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表 - // 计算关卡实际id - getRealLvId(gamelv, gameid, ismatch, gameNumber) { - if (localStorage.getItem('platformMode') === 'competition') { - return parseInt(window.unity_game_number, 10) - } else { - if (!ismatch) { - return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID - - } else { - //TODO 这里维护一张匹配关卡映射表 - if (gamelv === 240896 && gameid === 0) { - return 10000; - } - } - } - }, - lastGameStyle: '', - lastGameDefaultSkin: 0, - checkGameStyle(realLvId) { - - let gameStyle = 'SILU'; - let gameDefaultSkin = 0; - - if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) { - realLvId = realLvId - this.BEGINNING_REAL_LVID; - if (realLvId >= 1 && realLvId <= 300) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else if (realLvId >= 301 && realLvId <= 600) { - gameStyle = 'redArmy'; - gameDefaultSkin = 2; - } else if (realLvId >= 601 && realLvId <= 900) { - gameStyle = 'numMan'; - gameDefaultSkin = 3; - } else if (realLvId >= 901 && realLvId <= 1200) { - gameStyle = 'chinese'; - gameDefaultSkin = 1; - } else if (realLvId >= 1201 && realLvId <= 1500) { - gameStyle = 'snow'; - gameDefaultSkin = 4; - } else if (realLvId >= 1501 && realLvId <= 1800) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } - } - - - if (gameStyle !== this.lastGameStyle) { - window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); - this.lastGameStyle = gameStyle; - } - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - if (gameDefaultSkin !== this.lastGameDefaultSkin) { - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - const sendSkinMsg = (delay) => { - setTimeout(() => { - if (window.unityInstance) { - try { - window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); - console.log("CallChangeSkin sent >>> ", gameDefaultSkin); - } catch (e) { - console.log("Player not ready yet"); - } - } - }, delay); - }; - sendSkinMsg(2000); - sendSkinMsg(4000); - sendSkinMsg(6000); - this.lastGameDefaultSkin = gameDefaultSkin; - } - } -}; - - - - - - -export default CONFIG; \ No newline at end of file diff --git a/scratch-gui/src/playground/config_BASE_1249.js b/scratch-gui/src/playground/config_BASE_1249.js deleted file mode 100644 index 7bd656c2..00000000 --- a/scratch-gui/src/playground/config_BASE_1249.js +++ /dev/null @@ -1,283 +0,0 @@ -// config.js - -// const CONFIG = { -// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025010301", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn :true, //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:150, - -// SSN_COMPETITION_ID: [13], - -// // 计算关卡实际id -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, - -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } -// }; - - -// const CONFIG = { -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025011001", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// // disabledev: false, -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn : !(typeof localStorage !== 'undefined' && -// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:120, -// // 计算关卡实际id -// SSN_COMPETITION_ID: [21,22,23], - -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } - -// }; - - - -const CONFIG = { - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", - DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - - version: "20260520", - - /** OSS 真实地址(生产环境浏览器直连) */ - unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260616', - /** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */ - unityCdnDevProxy: '/cdn-unity', - /** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */ - unityCdnUseDevProxy: false, - /** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */ - unityCdnUseSiteProxy: false, - unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260616', - unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260616/Build', - python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/', - - // 可以根据需要添加其他配置 - - - - disabledev: false, - usecdn: true, - lvlock: false, - lvlock_normal_learn: !(typeof localStorage !== 'undefined' && - (localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')), - lockupdate: false, - mactchlv: false, - learnvideo: true, - gameNumber: 120, - //计算关卡实际id - SSN_COMPETITION_ID: [13], - NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], - BEGINNING_REAL_LVID: 91600, - END_REAL_LVID: 93100, - SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID - HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表 - // 计算关卡实际id - getRealLvId(gamelv, gameid, ismatch, gameNumber) { - if (localStorage.getItem('platformMode') === 'competition') { - return parseInt(window.unity_game_number, 10) - } else { - if (!ismatch) { - return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID - - } else { - //TODO 这里维护一张匹配关卡映射表 - if (gamelv === 240896 && gameid === 0) { - return 10000; - } - } - } - }, - lastGameStyle: '', - lastGameDefaultSkin: 0, - checkGameStyle(realLvId) { - - let gameStyle = 'SILU'; - let gameDefaultSkin = 0; - - if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) { - realLvId = realLvId - this.BEGINNING_REAL_LVID; - if (realLvId >= 1 && realLvId <= 300) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else if (realLvId >= 301 && realLvId <= 600) { - gameStyle = 'redArmy'; - gameDefaultSkin = 2; - } else if (realLvId >= 601 && realLvId <= 900) { - gameStyle = 'numMan'; - gameDefaultSkin = 3; - } else if (realLvId >= 901 && realLvId <= 1200) { - gameStyle = 'chinese'; - gameDefaultSkin = 1; - } else if (realLvId >= 1201 && realLvId <= 1500) { - gameStyle = 'snow'; - gameDefaultSkin = 4; - } else if (realLvId >= 1501 && realLvId <= 1800) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } - } - - - if (gameStyle !== this.lastGameStyle) { - window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); - this.lastGameStyle = gameStyle; - } - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - if (gameDefaultSkin !== this.lastGameDefaultSkin) { - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - const sendSkinMsg = (delay) => { - setTimeout(() => { - if (window.unityInstance) { - try { - window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); - console.log("CallChangeSkin sent >>> ", gameDefaultSkin); - } catch (e) { - console.log("Player not ready yet"); - } - } - }, delay); - }; - sendSkinMsg(2000); - sendSkinMsg(4000); - sendSkinMsg(6000); - this.lastGameDefaultSkin = gameDefaultSkin; - } - } -}; - - - - - - -export default CONFIG; \ No newline at end of file diff --git a/scratch-gui/src/playground/config_LOCAL_1249.js b/scratch-gui/src/playground/config_LOCAL_1249.js deleted file mode 100644 index 81f2f6cf..00000000 --- a/scratch-gui/src/playground/config_LOCAL_1249.js +++ /dev/null @@ -1,283 +0,0 @@ -// config.js - -// const CONFIG = { -// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025010301", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn :true, //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:150, - -// SSN_COMPETITION_ID: [13], - -// // 计算关卡实际id -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, - -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } -// }; - - -// const CONFIG = { -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025011001", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// // disabledev: false, -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn : !(typeof localStorage !== 'undefined' && -// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:120, -// // 计算关卡实际id -// SSN_COMPETITION_ID: [21,22,23], - -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } - -// }; - - - -const CONFIG = { - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", - DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - - version: "20260717", - - /** OSS 真实地址(生产环境浏览器直连) */ - unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617', - /** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */ - unityCdnDevProxy: '/cdn-unity', - /** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */ - unityCdnUseDevProxy: false, - /** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */ - unityCdnUseSiteProxy: false, - unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260717', - unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260717/Build', - python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/', - - // 可以根据需要添加其他配置 - - - - disabledev: false, - usecdn: true, - lvlock: false, - lvlock_normal_learn: !(typeof localStorage !== 'undefined' && - (localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')), - lockupdate: false, - mactchlv: false, - learnvideo: true, - gameNumber: 120, - //计算关卡实际id - SSN_COMPETITION_ID: [13], - NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], - BEGINNING_REAL_LVID: 91600, - END_REAL_LVID: 93100, - SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID - HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表 - // 计算关卡实际id - getRealLvId(gamelv, gameid, ismatch, gameNumber) { - if (localStorage.getItem('platformMode') === 'competition') { - return parseInt(window.unity_game_number, 10) - } else { - if (!ismatch) { - return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID - - } else { - //TODO 这里维护一张匹配关卡映射表 - if (gamelv === 240896 && gameid === 0) { - return 10000; - } - } - } - }, - lastGameStyle: '', - lastGameDefaultSkin: 0, - checkGameStyle(realLvId) { - - let gameStyle = 'SILU'; - let gameDefaultSkin = 0; - - if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) { - realLvId = realLvId - this.BEGINNING_REAL_LVID; - if (realLvId >= 1 && realLvId <= 300) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else if (realLvId >= 301 && realLvId <= 600) { - gameStyle = 'redArmy'; - gameDefaultSkin = 2; - } else if (realLvId >= 601 && realLvId <= 900) { - gameStyle = 'numMan'; - gameDefaultSkin = 3; - } else if (realLvId >= 901 && realLvId <= 1200) { - gameStyle = 'chinese'; - gameDefaultSkin = 1; - } else if (realLvId >= 1201 && realLvId <= 1500) { - gameStyle = 'snow'; - gameDefaultSkin = 4; - } else if (realLvId >= 1501 && realLvId <= 1800) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } - } - - - if (gameStyle !== this.lastGameStyle) { - window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); - this.lastGameStyle = gameStyle; - } - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - if (gameDefaultSkin !== this.lastGameDefaultSkin) { - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - const sendSkinMsg = (delay) => { - setTimeout(() => { - if (window.unityInstance) { - try { - window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); - console.log("CallChangeSkin sent >>> ", gameDefaultSkin); - } catch (e) { - console.log("Player not ready yet"); - } - } - }, delay); - }; - sendSkinMsg(2000); - sendSkinMsg(4000); - sendSkinMsg(6000); - this.lastGameDefaultSkin = gameDefaultSkin; - } - } -}; - - - - - - -export default CONFIG; \ No newline at end of file diff --git a/scratch-gui/src/playground/config_REMOTE_1249.js b/scratch-gui/src/playground/config_REMOTE_1249.js deleted file mode 100644 index 1ae71fef..00000000 --- a/scratch-gui/src/playground/config_REMOTE_1249.js +++ /dev/null @@ -1,283 +0,0 @@ -// config.js - -// const CONFIG = { -// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025010301", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn :true, //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:150, - -// SSN_COMPETITION_ID: [13], - -// // 计算关卡实际id -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, - -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } -// }; - - -// const CONFIG = { -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 -// // DataServerBaseUrl: "https://test.server.001code.com", -// DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// // DataServerBaseUrl: "https://test.server.001code.com", -// version : "2025011001", -// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826', -// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build', -// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/', - -// // 可以根据需要添加其他配置 - -// // disabledev: false, -// disabledev: false, -// usecdn :true, //资源走CDN -// lvlock :false, //关卡5关解锁,下一关加锁 -// lvlock_normal_learn : !(typeof localStorage !== 'undefined' && -// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁 -// lockupdate :false, //上传按钮 -// mactchlv : false, //比赛关卡 -// learnvideo : true, -// gameNumber:120, -// // 计算关卡实际id -// SSN_COMPETITION_ID: [21,22,23], - -// getRealLvId(gamelv,gameid, ismatch, gameNumber){ -// if(localStorage.getItem('platformMode') === 'competition'){ -// return parseInt(window.unity_game_number, 10) -// }else{ -// if (!ismatch){ -// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber) -// }else{ -// //TODO 这里维护一张匹配关卡映射表 -// if (gamelv === 240896 && gameid === 0) { -// return 10000; -// } -// } -// } -// }, -// lastGameStyle: '', -// lastGameDefaultSkin: 0, -// checkGameStyle(realLvId){ -// let gameStyle = ''; -// let gameDefaultSkin = 0; -// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) { -// gameStyle = 'chinese'; -// gameDefaultSkin = 1; -// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) { -// gameStyle = 'redArmy'; -// gameDefaultSkin = 2; -// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) { -// gameStyle = 'numMan'; -// gameDefaultSkin = 3; -// }else { -// gameStyle = 'default'; -// gameDefaultSkin = 0; -// } -// if (gameStyle !== this.lastGameStyle) { -// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); -// this.lastGameStyle = gameStyle; -// } -// if (gameDefaultSkin !== this.lastGameDefaultSkin) { -// setTimeout(() => { -// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); -// console.log("CallChangeSkin >>> ", gameDefaultSkin); -// }, 3000); -// this.lastGameDefaultSkin = gameDefaultSkin; -// } -// } - -// }; - - - -const CONFIG = { - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址 - // DataServerBaseUrl: "https://test.server.001code.com", - DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - // DataServerBaseUrl: "https://test.server.001code.com", - - version: "20260520", - - /** OSS 真实地址(生产环境浏览器直连) */ - unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617', - /** 方案 B:nginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false) */ - unityCdnDevProxy: '/cdn-unity', - /** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */ - unityCdnUseDevProxy: false, - /** 生产 nginx 反向代理 OSS 同路径时设为 true(方案 B) */ - unityCdnUseSiteProxy: false, - unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617', - unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build', - python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/', - - // 可以根据需要添加其他配置 - - - - disabledev: false, - usecdn: true, - lvlock: false, - lvlock_normal_learn: !(typeof localStorage !== 'undefined' && - (localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')), - lockupdate: false, - mactchlv: false, - learnvideo: true, - gameNumber: 120, - //计算关卡实际id - SSN_COMPETITION_ID: [13], - NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], - BEGINNING_REAL_LVID: 91600, - END_REAL_LVID: 93100, - SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID - HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表 - // 计算关卡实际id - getRealLvId(gamelv, gameid, ismatch, gameNumber) { - if (localStorage.getItem('platformMode') === 'competition') { - return parseInt(window.unity_game_number, 10) - } else { - if (!ismatch) { - return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID - - } else { - //TODO 这里维护一张匹配关卡映射表 - if (gamelv === 240896 && gameid === 0) { - return 10000; - } - } - } - }, - lastGameStyle: '', - lastGameDefaultSkin: 0, - checkGameStyle(realLvId) { - - let gameStyle = 'SILU'; - let gameDefaultSkin = 0; - - if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) { - realLvId = realLvId - this.BEGINNING_REAL_LVID; - if (realLvId >= 1 && realLvId <= 300) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else if (realLvId >= 301 && realLvId <= 600) { - gameStyle = 'redArmy'; - gameDefaultSkin = 2; - } else if (realLvId >= 601 && realLvId <= 900) { - gameStyle = 'numMan'; - gameDefaultSkin = 3; - } else if (realLvId >= 901 && realLvId <= 1200) { - gameStyle = 'chinese'; - gameDefaultSkin = 1; - } else if (realLvId >= 1201 && realLvId <= 1500) { - gameStyle = 'snow'; - gameDefaultSkin = 4; - } else if (realLvId >= 1501 && realLvId <= 1800) { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } else { - gameStyle = 'SILU'; - gameDefaultSkin = 0; - } - } - - - if (gameStyle !== this.lastGameStyle) { - window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle); - this.lastGameStyle = gameStyle; - } - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - if (gameDefaultSkin !== this.lastGameDefaultSkin) { - // 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载 - const sendSkinMsg = (delay) => { - setTimeout(() => { - if (window.unityInstance) { - try { - window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin); - console.log("CallChangeSkin sent >>> ", gameDefaultSkin); - } catch (e) { - console.log("Player not ready yet"); - } - } - }, delay); - }; - sendSkinMsg(2000); - sendSkinMsg(4000); - sendSkinMsg(6000); - this.lastGameDefaultSkin = gameDefaultSkin; - } - } -}; - - - - - - -export default CONFIG; \ No newline at end of file