33 lines
1.2 KiB
Lua
33 lines
1.2 KiB
Lua
-- Read-only CW discovery. Copy into scripts/ only for one capture, then remove.
|
|
-- Restrict reflection to ModuleManager and the matching GridFight module.
|
|
do
|
|
if not _G.__gacCwDiscovery1 then
|
|
_G.__gacCwDiscovery1=true
|
|
local function log(v) CS.UnityEngine.Debug.Log('[GAC_CW_DISCOVERY] '..tostring(v)) end
|
|
local ok,err=pcall(function()
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
|
local manager=CS.RPG.Client.GlobalVars.s_ModuleManager
|
|
local fields=manager:GetType():GetFields(flags)
|
|
for i=0,fields.Length-1 do
|
|
local f=fields[i]
|
|
if tostring(f.Name):find('GridFight') or tostring(f.FieldType):find('GridFight') then
|
|
log('MODULE '..tostring(f))
|
|
local module=f:GetValue(manager)
|
|
if module then
|
|
local t=module:GetType()
|
|
local fs=t:GetFields(flags)
|
|
for j=0,math.min(fs.Length-1,100) do log('FIELD '..tostring(fs[j])) end
|
|
local ms=t:GetMethods(flags)
|
|
for j=0,math.min(ms.Length-1,180) do
|
|
local m=ms[j]
|
|
if m.DeclaringType==t then log('METHOD '..tostring(m)) end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
log('DONE')
|
|
end)
|
|
if not ok then log('ERROR '..tostring(err)) end
|
|
end
|
|
end
|