Files

34 lines
2.1 KiB
Lua
Raw Permalink Normal View History

2026-10-28 18:54:43 +07:00
-- Two exact established CW/network types, metadata only. No request sending,
-- callbacks, scene loading, run mutation or assembly/type enumeration.
do local function capture()
local s=_G.__gacCwOrbBonfireCallbacks1 or {target=1,index=0};_G.__gacCwOrbBonfireCallbacks1=s
if s.done then return end
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 names={'RPG.Client.GridFightModule','RPG.Client.NetworkManager'}
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_ORB_BONFIRE_CALLBACKS] '..tostring(v))end
if s.target>#names then s.done=true;log('END');return end
if not s.methods then
s.t=typeof(CS.RPG.Client.GridFightModule).Assembly:GetType(names[s.target])
if not s.t then log('MISSING '..names[s.target]);s.target=s.target+1;return end
s.methods=s.t:GetMethods(flags);s.index=0
if s.methods.Length>8192 then error('exact-type method bound')end
log('TYPE '..s.t.FullName..' count='..s.methods.Length)
end
-- Name checks are cheap; limit them independently of the detailed formatting.
-- A time budget also stops the chunk if this Client's reflection is slower.
local start=CS.UnityEngine.Time.realtimeSinceStartup
local formatted=0
for n=1,64 do
if s.index>=s.methods.Length then s.target=s.target+1;s.methods=nil;s.t=nil;return end
local m=s.methods[s.index];s.index=s.index+1
local name=m.Name
if m.DeclaringType==s.t and (name:find('Orb',1,true) or name:find('Bonfire',1,true))then
log('METHOD '..s.t.FullName..' '..tostring(m)..' HANDLE '..tostring(m.MethodHandle.Value))
formatted=formatted+1
end
if formatted>=8 or CS.UnityEngine.Time.realtimeSinceStartup-start>0.002 then return end
end
end local ok,e=pcall(capture);if not ok then _G.__gacCwOrbBonfireCallbacks1={done=true};CS.UnityEngine.Debug.Log('[GAC_CW_ORB_BONFIRE_CALLBACKS] ERROR '..tostring(e))end end