首包逻辑处理

This commit is contained in:
chenxi 2023-06-05 21:58:33 +08:00
parent 4a7e11114a
commit 755c9937b3

View File

@ -55,12 +55,6 @@ function First:initLanguage()
end
PlayerPrefs.SetString("SELECTED_LANGUAGE", self.language)
end
-- 根据语言来,不切换
self.language = self:getSystemLanguage()
if self.language == nil then
self.language = BFPlatform.GetCurrentLanguageInfo():GetFallbackLanguage()
end
PlayerPrefs.SetString("SELECTED_LANGUAGE", self.language)
self.stringMap = firstText.data
self.strNoNetwork = self.stringMap["STR_NO_NETWORK_CONNECTION"][self.language]
@ -411,16 +405,31 @@ function First:tryShowRequestAddrErrorBox(connectStartTimes, callback, reqAddrEr
print("tryShowRequestAddrErrorBox errorType:" .. reqAddrErrorType .. " hasRecord:" .. tostring(hasRecord) .. " times:" .. times .. " totalTimes:" .. totalTimes)
if times > REQUEST_ADDR_MAX_RETRY_TIMES then
-- 尝试弹出错误框
if not self.showAddrErrorBox then
if self.hasReceiveAddrSuccess then
return
end
self.hasReceiveAddrSuccess = true
CS.BF.BFMain.IsStandAlone = true
self.showAddrErrorBox = true
self:showDialog(self.dialogStr[100], function()
self.showAddrErrorBox = false
if self.hasReceiveAddrSuccess then -- 延迟成功了 不需要重新request
self:setShenHeLanguageAndReqATT()
-- 上报版本请求成功
local args = {
client_version = BFLaunchMgr:GetCurrentVersion(),
client_version_url = BFPlatform.GetLoginCenterURL(),
client_connect_time = (os.clock() - connectStartTimes)*1000,
client_retry_times = totalTimes - 1
}
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostThinkingAnalyticsEvent("client_request_version_success", json.encode(args))
if callback then
callback("")
callback(self.requestAddressRsp)
end
else
CS.BF.BFMain.Instance.TaskMgr:EasyTimer(0, function()
self:requestAddress(callback, 0, totalTimes) -- 重新开始
end)
end
end)
end
else -- 静默重试
-- 重试