Files
GaCy-GO/tools/cw_inventory_wire_handles.lua
T
2026-10-28 18:54:43 +07:00

19 lines
1.8 KiB
Lua

-- Bounded method metadata for one explicitly named inventory type per beat.
do local function capture()
local s=_G.__gacCwInventoryWire3 or {index=1,offset=0};_G.__gacCwInventoryWire3=s
local names={'RPG.Client.GridFightTeam','MMEDLCAENAL','IBPDPCOGDEP','RPG.GameCore.GridFightForgeFuncType','RPG.GameCore.GridFightEquipCategory'}
if s.index>#names 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 name=names[s.index]
local t=typeof(CS.RPG.Client.GridFightModule).Assembly:GetType(name)or typeof(CS.RPG.GameCore.GridFightRoleConfigRow).Assembly:GetType(name)
local log=function(x)CS.UnityEngine.Debug.Log('[GAC_CW_INVENTORY_WIRE] '..tostring(x))end
if not t then log('MISSING '..name);s.index=s.index+1;return end
if s.offset==0 then log('TYPE '..name);if t.IsEnum then local ns=CS.System.Enum.GetNames(t);local vs=CS.System.Enum.GetValues(t);for i=0,math.min(ns.Length-1,47)do log('ENUM '..name..' '..ns[i]..' '..CS.System.Convert.ToInt32(vs:GetValue(i)))end;s.index=s.index+1;return end end
local ms=t:GetMethods(flags)
for i=s.offset,math.min(s.offset+31,ms.Length-1)do local m=ms[i];if m.DeclaringType==t and (m.Name:find('Forge')or m.Name:find('get_'))then log('METHOD '..tostring(m)..' HANDLE '..tostring(m.MethodHandle.Value))end end
s.offset=s.offset+32;if s.offset>=ms.Length then s.offset=0;s.index=s.index+1;if s.index>#names then log('END')end end
end;local ok,e=pcall(capture);if not ok then _G.__gacCwInventoryWire3={index=99};CS.UnityEngine.Debug.Log('[GAC_CW_INVENTORY_WIRE] ERROR '..tostring(e))end end