Files
GaCy-GO/tools/cw_shop_schema_probe.lua

30 lines
1.4 KiB
Lua

-- One named shop/protobuf type per heartbeat; metadata only, paused in Battle.
do
local names={'RPG.Client.GridFightRoleShop','POCJDMMANBM','HDEIAANGMDB','BOPHDCKJMMN'}
_G.__gacCwShopSchema1=_G.__gacCwShopSchema1 or 1
local index=_G.__gacCwShopSchema1
if 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
_G.__gacCwShopSchema1=index+1
local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_SHOP_SCHEMA] '..tostring(v))end
local good,err=pcall(function()
local a=typeof(CS.RPG.Client.GridFightModule).Assembly
local t=a:GetType(names[index])
if not t then t=typeof(CS[names[index]])end
log('TYPE '..names[index])
local fields=t:GetFields(flags)
for i=0,math.min(fields.Length-1,47)do log('FIELD '..tostring(fields[i]))end
local properties=t:GetProperties(flags)
for i=0,math.min(properties.Length-1,47)do log('PROPERTY '..tostring(properties[i]))end
if index==1 then
local m=t:GetMethod('Sync',flags)
if m then log('HANDLE '..names[index]..' Sync '..tostring(m.MethodHandle.Value)..' '..tostring(m))end
end
end)
if not good then log('ERROR '..tostring(err))end
if index==#names then log('END')end
end