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