fix(hook): GameMode hook 目标改为新版导出键(jc/ic),修复所有工具静默失效
- 根因:新版导出键语义漂移 —— \$.ac 变成两字段数据类 \、\ \$.zb 变成 ydt,不再是「取 gmt 实例 / ght 类」 - 新版对应关系:\ \$.jc = dct(scene) 取 ght 实例;\ \$.ic = wct 即 ght 类;\ \$.kc = gct(scene) 取 GameMode 实体 - hook 目标改为 \ \$.jc,并继续 hook wct.prototype 全方法作为兜底 - 重新生成 hornet_bundle.js 并同步 unpacked
This commit is contained in:
1 parent
56a1356cce
commit
1cc1afdb08
3 files changed
+27
-27
No files matched your search
@@ -13,12 +13,12 @@
|
|||||||
// 3. 定时器主动验证引用有效性,失效则重置
|
// 3. 定时器主动验证引用有效性,失效则重置
|
||||||
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
||||||
//
|
//
|
||||||
// 原理:
|
// 原理(新版 main.7cfa4058):
|
||||||
// module_87072.$_$.ac = yht 函数(接收场景,返回 ght 实例)
|
// module_87072.$_$.jc = dct 函数(接收 scene,返回 ght 实例) ← 旧版是 $_$.ac,新版键位漂移
|
||||||
// module_87072.$_$.zb = ght 类(GameMode 组件类)
|
// module_87072.$_$.ic = wct 类(ght / GameMode 组件类) ← 旧版是 $_$.zb
|
||||||
// module_87072.$_$.bc = kht 函数(接收场景,返回 GameMode entity)
|
// module_87072.$_$.kc = gct 函数(接收 scene,返回 GameMode 实体)← 旧版是 $_$.bc
|
||||||
// yht(scene).xzq_1 = Tht 实例(坦克列表管理器)
|
// dct(scene).m10b_1 = 坦克列表管理器
|
||||||
// Tht.z11b() = a12c_1(坦克列表,Lx 实例)
|
// 坦克列表 = dct(scene).m10b_1.j11y()
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
console.log('===== GameMode Hook v2 开始 =====');
|
console.log('===== GameMode Hook v2 开始 =====');
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ghtClass = mod.$_$.zb;
|
var ghtClass = mod.$_$.ic; // 新版:wct(旧版 $_$.zb)
|
||||||
var yhtFunc = mod.$_$.ac;
|
var yhtFunc = mod.$_$.jc; // 新版:dct(旧版 $_$.ac)
|
||||||
|
|
||||||
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
||||||
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
||||||
window.__yht_hooked__ = true;
|
window.__yht_hooked__ = true;
|
||||||
var origYht = yhtFunc;
|
var origYht = yhtFunc;
|
||||||
mod.$_$.ac = function(t) {
|
mod.$_$.jc = function(t) {
|
||||||
var result = origYht.call(this, t);
|
var result = origYht.call(this, t);
|
||||||
if (result) trySetGameMode(result, 'yht');
|
if (result) trySetGameMode(result, 'yht');
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
+9
-9
@@ -13,12 +13,12 @@
|
|||||||
// 3. 定时器主动验证引用有效性,失效则重置
|
// 3. 定时器主动验证引用有效性,失效则重置
|
||||||
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
||||||
//
|
//
|
||||||
// 原理:
|
// 原理(新版 main.7cfa4058):
|
||||||
// module_87072.$_$.ac = yht 函数(接收场景,返回 ght 实例)
|
// module_87072.$_$.jc = dct 函数(接收 scene,返回 ght 实例) ← 旧版是 $_$.ac,新版键位漂移
|
||||||
// module_87072.$_$.zb = ght 类(GameMode 组件类)
|
// module_87072.$_$.ic = wct 类(ght / GameMode 组件类) ← 旧版是 $_$.zb
|
||||||
// module_87072.$_$.bc = kht 函数(接收场景,返回 GameMode entity)
|
// module_87072.$_$.kc = gct 函数(接收 scene,返回 GameMode 实体)← 旧版是 $_$.bc
|
||||||
// yht(scene).xzq_1 = Tht 实例(坦克列表管理器)
|
// dct(scene).m10b_1 = 坦克列表管理器
|
||||||
// Tht.z11b() = a12c_1(坦克列表,Lx 实例)
|
// 坦克列表 = dct(scene).m10b_1.j11y()
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
console.log('===== GameMode Hook v2 开始 =====');
|
console.log('===== GameMode Hook v2 开始 =====');
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ghtClass = mod.$_$.zb;
|
var ghtClass = mod.$_$.ic; // 新版:wct(旧版 $_$.zb)
|
||||||
var yhtFunc = mod.$_$.ac;
|
var yhtFunc = mod.$_$.jc; // 新版:dct(旧版 $_$.ac)
|
||||||
|
|
||||||
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
||||||
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
||||||
window.__yht_hooked__ = true;
|
window.__yht_hooked__ = true;
|
||||||
var origYht = yhtFunc;
|
var origYht = yhtFunc;
|
||||||
mod.$_$.ac = function(t) {
|
mod.$_$.jc = function(t) {
|
||||||
var result = origYht.call(this, t);
|
var result = origYht.call(this, t);
|
||||||
if (result) trySetGameMode(result, 'yht');
|
if (result) trySetGameMode(result, 'yht');
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
// 3. 定时器主动验证引用有效性,失效则重置
|
// 3. 定时器主动验证引用有效性,失效则重置
|
||||||
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
// 4. trySetGameMode 验证坦克列表,避免捕获未初始化实例
|
||||||
//
|
//
|
||||||
// 原理:
|
// 原理(新版 main.7cfa4058):
|
||||||
// module_87072.$_$.ac = yht 函数(接收场景,返回 ght 实例)
|
// module_87072.$_$.jc = dct 函数(接收 scene,返回 ght 实例) ← 旧版是 $_$.ac,新版键位漂移
|
||||||
// module_87072.$_$.zb = ght 类(GameMode 组件类)
|
// module_87072.$_$.ic = wct 类(ght / GameMode 组件类) ← 旧版是 $_$.zb
|
||||||
// module_87072.$_$.bc = kht 函数(接收场景,返回 GameMode entity)
|
// module_87072.$_$.kc = gct 函数(接收 scene,返回 GameMode 实体)← 旧版是 $_$.bc
|
||||||
// yht(scene).xzq_1 = Tht 实例(坦克列表管理器)
|
// dct(scene).m10b_1 = 坦克列表管理器
|
||||||
// Tht.z11b() = a12c_1(坦克列表,Lx 实例)
|
// 坦克列表 = dct(scene).m10b_1.j11y()
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
console.log('===== GameMode Hook v2 开始 =====');
|
console.log('===== GameMode Hook v2 开始 =====');
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ghtClass = mod.$_$.zb;
|
var ghtClass = mod.$_$.ic; // 新版:wct(旧版 $_$.zb)
|
||||||
var yhtFunc = mod.$_$.ac;
|
var yhtFunc = mod.$_$.jc; // 新版:dct(旧版 $_$.ac)
|
||||||
|
|
||||||
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
console.log('[1] ght 类:', ghtClass ? ghtClass.name : '未找到');
|
||||||
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
console.log('[1] yht 函数:', typeof yhtFunc === 'function' ? '已找到' : '未找到');
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
if (typeof yhtFunc === 'function' && !window.__yht_hooked__) {
|
||||||
window.__yht_hooked__ = true;
|
window.__yht_hooked__ = true;
|
||||||
var origYht = yhtFunc;
|
var origYht = yhtFunc;
|
||||||
mod.$_$.ac = function(t) {
|
mod.$_$.jc = function(t) {
|
||||||
var result = origYht.call(this, t);
|
var result = origYht.call(this, t);
|
||||||
if (result) trySetGameMode(result, 'yht');
|
if (result) trySetGameMode(result, 'yht');
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in new issue
Block a user