-- Read only the exact CW FirstPlay template through its typed config reader. -- No level graph loader, task execution, session mutation or HTTP call. do local flags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),60) local manager=CS.RPG.Client.GlobalVars.s_GamePhaseManager local phase=manager and typeof(CS.RPG.Client.GamePhaseManager):GetField('_CurrentPhase',flags):GetValue(manager) if not phase or typeof(CS.RPG.Client.BattleGamePhase):IsInstanceOfType(phase)then return end _G.__gacCwFirstPlayTemplate20261020=_G.__gacCwFirstPlayTemplate20261020 or {index=1} local s=_G.__gacCwFirstPlayTemplate20261020 if s.done then return end local log=function(v)CS.UnityEngine.Debug.Log('[GAC_CW_FIRSTPLAY_TEMPLATE] '..tostring(v))end local ok,err=pcall(function() if not s.text then local rule=CS.RPG.GameCore.ConstValueCommonExcelTable.GetData('GridFight_FirstPlay_JsonPath') if not rule or not rule.Value.IsString then error('FirstPlay path is absent')end local value=CS.RPG.GameCore.GameCoreConfigLoader.LoadGridFightStageTemplateConfig(rule.Value.StringValue) if not value then error('Typed FirstPlay template reader returned nil')end s.text=tostring(CS.Newtonsoft.Json.JsonConvert.SerializeObject(value)) if #s.text>1048576 then error('FirstPlay template exceeds capture bound')end log('BEGIN bytes='..#s.text) end if s.index>#s.text then s.done=true;s.text=nil;log('END');return end local finish=math.min(s.index+4095,#s.text) while finish<#s.text and string.byte(s.text,finish+1)>=128 and string.byte(s.text,finish+1)<192 do finish=finish-1 end log('CHUNK '..s.index..' '..CS.Newtonsoft.Json.JsonConvert.SerializeObject(s.text:sub(s.index,finish))) s.index=finish+1 end) if not ok then s.done=true;s.text=nil;log('ERROR '..tostring(err))end end