24 lines
1.2 KiB
Lua
24 lines
1.2 KiB
Lua
-- Bounded, read-only companion to the server's full result packet capture.
|
|
-- Remove from scripts/ after the AA reproduction.
|
|
do
|
|
local s=_G.__gacPeakResultSnapshot1 or {};_G.__gacPeakResultSnapshot1=s
|
|
local ok,err=pcall(function()
|
|
local stat=CS.RPG.Client.GlobalVars.s_ModuleManager.BattleModule.LastBattleStatistic
|
|
if stat==nil then return end
|
|
local values={}
|
|
for _,name in ipairs({'totalBattleRounds','challengeTurnCount','challengeTurnLeft','totalBattleTurns','totalAvatarTurns','totalMonsterTurns'})do
|
|
values[#values+1]=name..'='..tostring(stat[name])
|
|
end
|
|
local signature=table.concat(values,' ')
|
|
if signature~=s.signature then
|
|
s.signature=signature
|
|
CS.UnityEngine.Debug.Log('[GAC_PEAK_RESULT_SNAPSHOT] '..signature)
|
|
for _,name in ipairs({'battleRaidTargetList','battleScoringList','battleChallengeScoreList'})do
|
|
local encoded,body=pcall(function()return CS.Newtonsoft.Json.JsonConvert.SerializeObject(stat[name])end)
|
|
if encoded and #body<=16384 then CS.UnityEngine.Debug.Log('[GAC_PEAK_RESULT_SNAPSHOT] '..name..' '..body)end
|
|
end
|
|
end
|
|
end)
|
|
if not ok and s.error~=tostring(err)then s.error=tostring(err);CS.UnityEngine.Debug.Log('[GAC_PEAK_RESULT_SNAPSHOT] ERROR '..s.error)end
|
|
end
|