Files
GaCy-GO/tools/damage_servant_probe.lua
T

42 lines
1.8 KiB
Lua

do
local s=_G.__gacServantProbe1 or {phase=0,index=0}; _G.__gacServantProbe1=s
if s.phase<3 then
local function log(v) CS.UnityEngine.Debug.Log('[GAC_SERVANT] '..tostring(v)) end
local ok,err=pcall(function()
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
local live=_G.__GAC_DAMAGE_ANALYST_LIVE_V7
local owner=live and live.statComponent
if s.phase==0 then
local final=CS.RPG.Client.GlobalVars.s_ModuleManager.BattleModule.LastBattleStatistic
if final then
local field=final:GetType():GetField('servantBattleInfoList',flags)
local list=field and field:GetValue(final)
if list then
log('FINAL_COUNT '..list.Count)
for i=0,math.min(list.Count-1,15) do log('FINAL '..CS.System.Convert.ToBase64String(CS.Google.Protobuf.MessageExtensions.ToByteArray(list[i]))) end
end
end
if not owner then return end
local dict=owner:GetType():GetField('_ServantStt',flags):GetValue(owner)
log('COUNT '..dict.Count)
local it=dict:GetEnumerator()
if it:MoveNext() then s.value=it.Current.Value end
s.type=dict:GetType():GetGenericArguments()[1]
log('TYPE '..tostring(s.type.FullName))
s.phase=1
end
local fields=s.type:GetFields(flags)
for i=s.index,math.min(s.index+11,fields.Length-1) do
local f=fields[i]; local v=s.value and f:GetValue(s.value)
log('FIELD '..f.Name..' '..tostring(f.FieldType)..' '..tostring(v))
if v and tostring(f.FieldType):find('HFALLFOEHKN',1,true) then
log('PROTO '..CS.System.Convert.ToBase64String(CS.Google.Protobuf.MessageExtensions.ToByteArray(v)))
end
end
s.index=s.index+12
if s.index>=fields.Length then s.phase=3; s.value=nil end
end)
if not ok then log('ERROR '..tostring(err)); s.phase=3 end
end
end