24 lines
1.4 KiB
Lua
24 lines
1.4 KiB
Lua
-- Isolated protobuf setters/getters only; nothing sent to gameplay modules.
|
|
do local function capture()
|
|
if _G.__gacCwBattleSpotWire1 then return end
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
|
local mgr=CS.RPG.Client.GlobalVars.s_GamePhaseManager
|
|
local phase=mgr and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(mgr)
|
|
if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end
|
|
_G.__gacCwBattleSpotWire1=true
|
|
local log=function(x)CS.UnityEngine.Debug.Log('[GAC_CW_BATTLE_SPOT_WIRE] '..tostring(x))end
|
|
local ok,err=pcall(function()
|
|
local t=typeof(CS.ABJGLPCOMMK);local methods=t:GetMethods(flags)
|
|
for i=0,math.min(methods.Length-1,31)do
|
|
local m=methods[i];local ps=m:GetParameters()
|
|
if m.DeclaringType==t and ps.Length==1 and ps[0].ParameterType==typeof(CS.System.UInt32)then
|
|
local obj=CS.System.Activator.CreateInstance(t);obj[m.Name](obj,1)
|
|
log('SET '..m.Name..' '..CS.System.BitConverter.ToString(CS.Google.Protobuf.MessageExtensions.ToByteArray(obj)))
|
|
for j=0,math.min(methods.Length-1,31)do local g=methods[j];if g.DeclaringType==t and g:GetParameters().Length==0 and g.ReturnType==typeof(CS.System.UInt32) and obj[g.Name](obj)==1 then log('GET '..g.Name..' '..tostring(g.MethodHandle.Value))end end
|
|
end
|
|
end
|
|
end)
|
|
if not ok then log('ERROR '..tostring(err))end
|
|
log('END')
|
|
end;capture()end
|