请求版本号
This commit is contained in:
parent
f1274720e8
commit
eccbb328ba
@ -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 -- 静默重试
|
||||
-- 重试
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user