Update AA synchronization, CW progression and diagnostics
This commit is contained in:
1 parent
67a819a4d3
commit
30bee81fe9
30 files changed
+1143
-55
No files matched your search
@@ -1,5 +1,7 @@
|
||||
-- Current Client metadata: ChallengePeakModule exposes CurrentPeakGroupID and
|
||||
-- SendGetChallengePeakDataRequest(). Request real server data; never set a
|
||||
-- SendModuleInitRequest() requests the round/group catalog. The similarly named
|
||||
-- SendGetChallengePeakDataRequest() requests the current run, not the catalog.
|
||||
-- Request real server data; never set a
|
||||
-- private group field, fake a response, remap a room or close a running mode.
|
||||
do local function synchronize()
|
||||
local data=_G.__GAC_AA_ROUND_REFRESH
|
||||
@@ -12,8 +14,8 @@ do local function synchronize()
|
||||
local module=modules and modules.ChallengePeakModule
|
||||
if not module then return end
|
||||
local state=_G.__GAC_AA_ROUND_REFRESH_STATE
|
||||
if not state or state.module~=module then
|
||||
state={module=module};_G.__GAC_AA_ROUND_REFRESH_STATE=state
|
||||
if not state or state.module~=module or state.adapter~='module-init-v2' then
|
||||
state={module=module,adapter='module-init-v2'};_G.__GAC_AA_ROUND_REFRESH_STATE=state
|
||||
end
|
||||
local current=module.CurrentPeakGroupID
|
||||
-- Wait for the native login initialization request; do not duplicate it.
|
||||
@@ -31,13 +33,17 @@ do local function synchronize()
|
||||
state.pending=nil
|
||||
end
|
||||
if state.requested==data.revision then return end
|
||||
local sender=module.SendGetChallengePeakDataRequest
|
||||
if type(sender)~='function' then error('observed AA refresh API is unavailable') end
|
||||
-- Native methods are not consistently exposed as Lua functions by xLua.
|
||||
-- Resolve this exact observed zero-argument method on the live module type.
|
||||
local sender=module:GetType():GetMethod('SendModuleInitRequest',flags)
|
||||
if not sender or sender:GetParameters().Length~=0 then error('observed AA refresh API is unavailable') end
|
||||
-- No known in-flight query is exposed by this module. Send once and wait
|
||||
-- for its actual CurrentPeakGroupID change, instead of flooding retries.
|
||||
local args=CS.System.Array.CreateInstance(typeof(CS.System.Object),0)
|
||||
local invokeFlags=CS.System.Enum.ToObject(typeof(CS.System.Reflection.BindingFlags),0)
|
||||
sender:Invoke(module,invokeFlags,nil,args,nil)
|
||||
state.requested=data.revision
|
||||
state.pending={from=current,desired=data.desired_group}
|
||||
module:SendGetChallengePeakDataRequest()
|
||||
CS.UnityEngine.Debug.Log('[GAC_AA_ROUND_SYNC] requested group='..data.desired_group..' previous='..current)
|
||||
end
|
||||
local ok,err=pcall(synchronize)
|
||||
|
||||
Reference in new issue
Block a user