diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index effd86b0..c698678e 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -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 -- 上报部分档位首次付费 diff --git a/lua/app/module/login/login_manager.lua b/lua/app/module/login/login_manager.lua index d668a48a..739c48f8 100644 --- a/lua/app/module/login/login_manager.lua +++ b/lua/app/module/login/login_manager.lua @@ -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() diff --git a/lua/app/userdata/player/player_data.lua b/lua/app/userdata/player/player_data.lua index 6799f1bd..ffaafe8a 100644 --- a/lua/app/userdata/player/player_data.lua +++ b/lua/app/userdata/player/player_data.lua @@ -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()