17 lines
1.5 KiB
Lua
17 lines
1.5 KiB
Lua
-- Inspect only three CW runtime types and current saved game-event object.
|
|
do local function capture()
|
|
local s=_G.__gacCwBonfireContext1 or {index=1};_G.__gacCwBonfireContext1=s
|
|
if s.done then return end
|
|
local log=function(x)CS.UnityEngine.Debug.Log('[GAC_CW_BONFIRE_CONTEXT] '..tostring(x))end
|
|
local names={'RPG.Client.GridFightGameEventData','RPG.Client.GridFightPendingActionManager','RPG.Client.GridFightPendingSelection'}
|
|
local t=typeof(CS.RPG.Client.GridFightModule).Assembly:GetType(names[s.index])
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
|
if t then
|
|
log('TYPE '..t.FullName)
|
|
local fs=t:GetFields(flags);for i=0,math.min(fs.Length-1,63)do log('FIELD '..tostring(fs[i]))end
|
|
local ms=t:GetMethods(flags);for i=0,math.min(ms.Length-1,127)do local m=ms[i];if m.DeclaringType==t then log('METHOD '..tostring(m)..' HANDLE '..tostring(m.MethodHandle.Value))end end
|
|
if s.index==1 then local session=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule.CurGameSession;if session then local f=session:GetType():GetField('_GameEventData',flags);local obj=f and f:GetValue(session);if obj then log('OBJECT '..CS.Newtonsoft.Json.JsonConvert.SerializeObject(obj))end end end
|
|
else log('MISSING '..names[s.index])end
|
|
s.index=s.index+1;if s.index>#names then s.done=true;log('END')end
|
|
end;local ok,e=pcall(capture);if not ok then _G.__gacCwBonfireContext1={done=true};CS.UnityEngine.Debug.Log('[GAC_CW_BONFIRE_CONTEXT] ERROR '..tostring(e))end end
|