29 lines
1.4 KiB
Lua
29 lines
1.4 KiB
Lua
-- Look up two exact table names across loaded assemblies, never enumerate types.
|
|||
|
|
-- Eight exact-name lookups per heartbeat; no type enumeration or loader.
|
||
|
|
do
|
||
|
|
_G.__gacCwTableAssembly2=_G.__gacCwTableAssembly2 or {index=0}
|
||
|
|
local s=_G.__gacCwTableAssembly2
|
||
|
|
if not s.done then
|
||
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
||
|
|
local manager=CS.RPG.Client.GlobalVars.s_GamePhaseManager
|
||
|
|
local phase=manager and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(manager)
|
||
|
|
if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase) then return end
|
||
|
|
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_TABLE_ASSEMBLY] '..tostring(v))end
|
||
|
|
if not s.assemblies then
|
||
|
|
s.assemblies=CS.System.AppDomain.CurrentDomain:GetAssemblies()
|
||
|
|
if s.assemblies.Length>256 then log('ERROR Assembly count exceeds capture bound');s.done=true;return end
|
||
|
|
log('BEGIN count='..s.assemblies.Length)
|
||
|
|
end
|
||
|
|
for batch=1,8 do
|
||
|
|
if s.index<s.assemblies.Length then
|
||
|
|
local assembly=s.assemblies[s.index]
|
||
|
|
log('ASSEMBLY '..assembly.FullName)
|
||
|
|
for _,name in ipairs({'RPG.GameCore.GridFightPlayerLevelConfigExcelTable','RPG.GameCore.GridFightRoleConfigExcelTable'})do
|
||
|
|
local t=assembly:GetType(name)
|
||
|
|
if t then log('FOUND '..name..' '..assembly.FullName)end
|
||
|
|
end
|
||
|
|
s.index=s.index+1
|
||
|
|
else s.done=true;log('END');return end
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|