处理一下跨等级上报
This commit is contained in:
parent
6f85752093
commit
ed400f1b75
@ -606,7 +606,7 @@ function BIReport:postHeroLev(beforeLv, lv)
|
||||
end
|
||||
|
||||
-- 上报等级提升事件,单独处理,只上报到AF和FB,不上报数数
|
||||
function BIReport:postLvEvent(lv)
|
||||
function BIReport:postLvEvent(beforeLv, nowLv)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
@ -615,7 +615,7 @@ function BIReport:postLvEvent(lv)
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not lv then
|
||||
if not nowLv then
|
||||
return
|
||||
end
|
||||
local postLV = {
|
||||
@ -635,12 +635,19 @@ function BIReport:postLvEvent(lv)
|
||||
}
|
||||
-- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_grade", json.encode({}))
|
||||
-- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_grade", json.encode({}))
|
||||
if not postLV[lv] then
|
||||
local reportLv
|
||||
for lv, _ in pairs(postLV) do
|
||||
if beforeLv < lv and nowLv >= lv then
|
||||
reportLv = lv
|
||||
break
|
||||
end
|
||||
end
|
||||
if not reportLv then
|
||||
return
|
||||
end
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_grade_" .. lv, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_grade_" .. lv, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_grade_" .. reportLv, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_grade_" .. reportLv, json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报部分档位首次付费
|
||||
|
||||
@ -175,7 +175,7 @@ function LoginManager:loginFinish(data)
|
||||
BIReport:postAccountLoginFinish(info.type)
|
||||
|
||||
if DataManager:getIsFirstLogin() then
|
||||
BIReport:postLvEvent(1)
|
||||
BIReport:postLvEvent(0, 1)
|
||||
end
|
||||
else
|
||||
local info = LocalData:getLastLoginInfo()
|
||||
|
||||
@ -122,6 +122,7 @@ function PlayerData:addExp(exp)
|
||||
end
|
||||
|
||||
function PlayerData:setLv(level, exp)
|
||||
local beforeLv = self.data.level or 0
|
||||
self.data.level = level
|
||||
self.data.exp = exp
|
||||
self.lvUpNeedExp = self:getNextExp(self.data.level)
|
||||
@ -130,7 +131,7 @@ function PlayerData:setLv(level, exp)
|
||||
local data = {}
|
||||
data.player_level = self.data.level
|
||||
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
|
||||
BIReport:postLvEvent(level)
|
||||
BIReport:postLvEvent(beforeLv, level)
|
||||
end
|
||||
|
||||
function PlayerData:getLv()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user