40 lines
1.5 KiB
Lua
40 lines
1.5 KiB
Lua
-- Bounded, read-only inspection of the active CW team container.
|
|
do
|
|
if _G.__gacCwBoardState2 then return end
|
|
local session=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule.CurGameSession
|
|
if not session then return end
|
|
_G.__gacCwBoardState2=true
|
|
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_BOARD_STATE] '..tostring(v))end
|
|
local ok,err=pcall(function()
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
|
local fields=session:GetType():GetFields(flags)
|
|
for i=0,math.min(fields.Length-1,63)do
|
|
local field=fields[i]
|
|
if field.Name:lower():find('team')then
|
|
local team=field:GetValue(session)
|
|
if team then
|
|
local fs=team:GetType():GetFields(flags)
|
|
for j=0,math.min(fs.Length-1,31)do
|
|
local f=fs[j];local value=f:GetValue(team)
|
|
if f.Name:lower():find('role')then
|
|
log('TEAM '..tostring(f)..' = '..tostring(value))
|
|
if value then
|
|
local inner=value:GetType():GetFields(flags)
|
|
for k=0,math.min(inner.Length-1,15)do local x=inner[k];local v=x:GetValue(value)
|
|
log('CONTAINER '..tostring(x)..' = '..tostring(v))
|
|
if v then pcall(function()
|
|
local en=v:GetEnumerator();local n=0
|
|
while n<6 and en:MoveNext()do n=n+1;log('ENTRY '..tostring(en.Current))end
|
|
end)end
|
|
end
|
|
pcall(function()local en=value:GetEnumerator();local n=0;while n<6 and en:MoveNext()do n=n+1;log('VALUE '..tostring(en.Current))end end)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end)
|
|
if not ok then log('ERROR '..tostring(err))end
|
|
end
|