Files
GaCy-GO/tools/cw_method_tokens.lua
T

24 lines
1.3 KiB
Lua

-- Named CW types only, at most 64 method tokens per heartbeat.
do
local names={'RPG.Client.GridFightModule','AMEEHIIPMFP','CKPOBLIFMGN','MPIMAEMCEFH','RPG.Client.GridFightTalent','RPG.Client.GridFightPlayerProfile','RPG.Client.GridFightGameSession','RPG.Client.GridFightPlayer'}
_G.__gacCwMethodTokens=_G.__gacCwMethodTokens or {index=1,method=0}
local state=_G.__gacCwMethodTokens
if state.index<=#names then
local function log(v)CS.UnityEngine.Debug.Log('[GAC_CW_METHOD_TOKEN] '..tostring(v))end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local assembly=typeof(CS.RPG.Client.GridFightModule).Assembly
local t=assembly:GetType(names[state.index])
if not t then t=typeof(CS[names[state.index]])end
local methods=t:GetMethods(flags)
for i=state.method,math.min(state.method+63,methods.Length-1)do
local m=methods[i]
if m.DeclaringType==t then log('METHOD '..names[state.index]..' '..m.Name..' '..m.MetadataToken)end
end
state.method=state.method+64
if state.method>=methods.Length then log('END '..names[state.index]);state.index=state.index+1;state.method=0 end
end)
if not ok then log('ERROR '..names[state.index]..' '..tostring(err));state.index=state.index+1;state.method=0 end
end
end