From eccbb328baf0c651beb511a04a4c7703db605e40 Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 26 Apr 2023 15:03:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/first/first.lua | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/lua/app/first/first.lua b/lua/app/first/first.lua index 380497c1..beae94cc 100644 --- a/lua/app/first/first.lua +++ b/lua/app/first/first.lua @@ -332,11 +332,11 @@ function First:requestAddress(callback, times, totalTimes) print("requestAddress -- loginCenterUrl:" .. loginCenterUrl .. " version:" .. version .. " times:" .. times .. " totalTimes:" .. totalTimes) local args = { - project_id = "b5", - version = BFLaunchMgr:GetCurrentVersion(), + project_id = "b6", + version = version, device_id = CS.UnityEngine.SystemInfo.deviceUniqueIdentifier, bundle_id = CS.UnityEngine.Application.identifier, - env = "release",-- 暂时写死 + env = "release", } local platform = "Editor" if CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.Android then @@ -356,7 +356,6 @@ function First:requestAddress(callback, times, totalTimes) if rsp.Data then -- 有数据就算成功 local serverResult = json.decode(rsp.Data) if serverResult then - CS.BF.BFMain.IsShenhe = (serverResult.env == "audit" and CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer) responded = true -- 如果已经成功过了 不作处理 if self.hasReceiveAddrSuccess then @@ -406,31 +405,16 @@ 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 - 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(self.requestAddressRsp) - end - else - CS.BF.BFMain.Instance.TaskMgr:EasyTimer(0, function() - self:requestAddress(callback, 0, totalTimes) -- 重新开始 - end) - end - end) + if self.hasReceiveAddrSuccess then + return + end + self.hasReceiveAddrSuccess = true + CS.BF.BFMain.IsStandAlone = true + self:setShenHeLanguageAndReqATT() + if callback then + callback("") + end end else -- 静默重试 -- 重试