24 lines
1.2 KiB
Lua
24 lines
1.2 KiB
Lua
-- Export already loaded native CW division configs, eight rows per heartbeat.
|
|
do
|
|
_G.__gacCwDivisions=_G.__gacCwDivisions or {index=0}
|
|
local state=_G.__gacCwDivisions
|
|
if not state.done then
|
|
local function log(v)CS.UnityEngine.Debug.Log('[GAC_CW_DIVISIONS] '..tostring(v))end
|
|
local ok,err=pcall(function()
|
|
local module=CS.RPG.Client.GlobalVars.s_ModuleManager.GridFightModule
|
|
local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60)
|
|
local first=typeof(CS.RPG.Client.GridFightModule):GetField('FirstSeasonID',flags):GetValue(nil)
|
|
local season=module:GetSeason(first,nil)
|
|
local configs=season.SeasonDivision.SeasonDivisionConfigs
|
|
if state.index==0 then log('BEGIN count='..configs.Count)end
|
|
for i=state.index,math.min(state.index+7,configs.Count-1) do
|
|
local row=configs[i]
|
|
log('ROW {"ID":'..row.ID..',"SeasonID":'..row.SeasonID..',"DivisionLevel":'..row.DivisionLevel..',"Progress":'..row.Progress..',"IsPromotion":'..tostring(row.IsPromotion)..'}')
|
|
end
|
|
state.index=state.index+8
|
|
if state.index>=configs.Count then state.done=true;log('END')end
|
|
end)
|
|
if not ok then log('ERROR '..tostring(err));state.done=true end
|
|
end
|
|
end
|