Merge branch 'master' into dev_20230725
This commit is contained in:
commit
be2e185a77
@ -430,6 +430,394 @@ function BIReport:postFirstLoginEvent()
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_first_login", json.encode({}))
|
||||
end
|
||||
|
||||
-- 上报广告播放提升事件,单独处理,只上报到AF和FB,不上报数数
|
||||
function BIReport:postAdEvent()
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
local adCount = DataManager.PlayerData:getAdCount()
|
||||
if not adCount then
|
||||
return
|
||||
end
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_AdRewardAD", json.encode({}))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_AdRewardAD", json.encode({}))
|
||||
if not self.afPostAdCount then
|
||||
self.afPostAdCount = {
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
[10] = true,
|
||||
[20] = true,
|
||||
[40] = true,
|
||||
[80] = true,
|
||||
}
|
||||
end
|
||||
|
||||
if self.afPostAdCount[adCount] then
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_AdRewardAD_" .. adCount, json.encode(args))
|
||||
end
|
||||
|
||||
if not self.fbPostAdCount then
|
||||
self.fbPostAdCount = {
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
[10] = true,
|
||||
[20] = true,
|
||||
}
|
||||
end
|
||||
|
||||
if self.fbPostAdCount[adCount] then
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_AdRewardAD_" .. adCount, json.encode(args))
|
||||
end
|
||||
end
|
||||
|
||||
-- 上报进入章节事件,单独处理,只上报到AF和FB,不上报数数
|
||||
function BIReport:postChapterEvent(chapter)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not chapter then
|
||||
return
|
||||
end
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Level", json.encode({}))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Level", json.encode({}))
|
||||
if not self.afPostChapter then
|
||||
self.afPostChapter = {
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[4] = true,
|
||||
[5] = true,
|
||||
[6] = true,
|
||||
[7] = true,
|
||||
[8] = true,
|
||||
[9] = true,
|
||||
[10] = true,
|
||||
[11] = true,
|
||||
[12] = true,
|
||||
[13] = true,
|
||||
[14] = true,
|
||||
[15] = true,
|
||||
[16] = true,
|
||||
[17] = true,
|
||||
[18] = true,
|
||||
[19] = true,
|
||||
[20] = true,
|
||||
[30] = true,
|
||||
[40] = true,
|
||||
[50] = true,
|
||||
}
|
||||
end
|
||||
if self.afPostChapter[chapter] then
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_Chapter_" .. chapter, json.encode(args))
|
||||
end
|
||||
|
||||
if not self.fbPostChapter then
|
||||
self.fbPostChapter = {
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[4] = true,
|
||||
[5] = true,
|
||||
[6] = true,
|
||||
[7] = true,
|
||||
[8] = true,
|
||||
[9] = true,
|
||||
[10] = true,
|
||||
[15] = true,
|
||||
[20] = true,
|
||||
[30] = true,
|
||||
[40] = true,
|
||||
[50] = true,
|
||||
}
|
||||
end
|
||||
|
||||
if self.fbPostChapter[chapter] then
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_Chapter_" .. chapter, json.encode(args))
|
||||
end
|
||||
end
|
||||
|
||||
-- 上报获取任意x个英雄
|
||||
function BIReport:postFirstGetHero(num)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not self.postHeroNum then
|
||||
self.postHeroNum = {
|
||||
[4] = true,
|
||||
[6] = true,
|
||||
[8] = true,
|
||||
[10] = true,
|
||||
[12] = true,
|
||||
[14] = true,
|
||||
[16] = true,
|
||||
[18] = true,
|
||||
[20] = true,
|
||||
}
|
||||
end
|
||||
|
||||
if not self.postHeroNum[num] then
|
||||
return
|
||||
end
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_herosum_" .. num, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_herosum_" .. num, json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报英雄等级
|
||||
function BIReport:postHeroLev(beforeLv, lv)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
|
||||
local allHeroes = DataManager.HeroData:getAllHeroes()
|
||||
if not self.postHeroLevel then
|
||||
self.postHeroLevel = {
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
[7] = true,
|
||||
[9] = true
|
||||
}
|
||||
end
|
||||
|
||||
local temp = {}
|
||||
for heroid, heroEntity in pairs(allHeroes) do
|
||||
for heroLv, _ in pairs(self.postHeroLevel) do
|
||||
if heroEntity:getLv() >= heroLv then
|
||||
temp[heroLv] = (temp[heroLv] or 0) + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
for heroLv, count in pairs(temp) do
|
||||
if heroLv > beforeLv and heroLv <= lv and count == 5 then
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_hero4_lev" .. heroLv, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_hero4_lev" .. heroLv, json.encode(args))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 上报等级提升事件,单独处理,只上报到AF和FB,不上报数数
|
||||
function BIReport:postLvEvent(beforeLv, nowLv)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not nowLv then
|
||||
return
|
||||
end
|
||||
if not self.postLV then
|
||||
self.postLV = {
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
[10] = true,
|
||||
[15] = true,
|
||||
[20] = true,
|
||||
[30] = true,
|
||||
[40] = true,
|
||||
[50] = true,
|
||||
[60] = true,
|
||||
[70] = true,
|
||||
[80] = true,
|
||||
}
|
||||
end
|
||||
|
||||
-- CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_grade", json.encode({}))
|
||||
-- CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_grade", json.encode({}))
|
||||
local reportLv
|
||||
for lv, _ in pairs(self.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_" .. reportLv, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_grade_" .. reportLv, json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报部分档位首次付费
|
||||
function BIReport:postFirstRechargeEvent(id)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not self.postRechargeID then
|
||||
self.postRechargeID = {
|
||||
[1] = false, -- 0.99
|
||||
[2] = false, -- 1.99
|
||||
[3] = true, -- 2.99
|
||||
[4] = false, -- 3.99
|
||||
[5] = true, -- 4.99
|
||||
[6] = false, -- 5.99
|
||||
[7] = false, -- 6.99
|
||||
[8] = false, -- 7.99
|
||||
[9] = false, -- 8.99
|
||||
[10] = true, -- 9.99
|
||||
[11] = false, -- 11.99
|
||||
[12] = false, -- 14.99
|
||||
[13] = true, -- 19.99
|
||||
[14] = false, -- 24.99
|
||||
[15] = true, -- 29.99
|
||||
[16] = true, -- 49.99
|
||||
[17] = false, -- 69.99
|
||||
[18] = false, -- 99.99
|
||||
[19] = false, -- 199.99
|
||||
}
|
||||
end
|
||||
|
||||
if not self.postRechargeID[id] then
|
||||
return
|
||||
end
|
||||
local cfg = ConfigManager:getConfig("recharge")[id]
|
||||
if not cfg then
|
||||
return
|
||||
end
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_package_" .. cfg.price, json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_package_" .. cfg.price, json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报24小时内部分章节第一次失败的用户
|
||||
function BIReport:postFirstDayGradeFailEvent(chapterId)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not DataManager:getIsInCreate24Hour() then
|
||||
return
|
||||
end
|
||||
if not self.postChapterId then
|
||||
self.postChapterId = {
|
||||
[1] = true,
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
[5] = true,
|
||||
}
|
||||
end
|
||||
|
||||
if not self.postChapterId[chapterId] then
|
||||
return
|
||||
end
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_24_grade_" .. chapterId .. "_fail", json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_24_grade_" .. chapterId .. "_fail", json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报24小时内部分英雄升级
|
||||
function BIReport:postFirstDayHeroLevel(heroId)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not DataManager:getIsInCreate24Hour() then
|
||||
return
|
||||
end
|
||||
local heroEntity = DataManager.HeroData:getHeroById(heroId)
|
||||
if not heroEntity or heroEntity:getLv() > 2 then
|
||||
return
|
||||
end
|
||||
if not self.postHeroId then
|
||||
self.postHeroId = {
|
||||
[22001] = "24_blade_levelup",
|
||||
[32001] = "24_onion_levelup",
|
||||
[42001] = "24_iceheart_levelup",
|
||||
}
|
||||
end
|
||||
|
||||
if not self.postHeroId[heroId] then
|
||||
return
|
||||
end
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_" .. self.postHeroId[heroId], json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_" .. self.postHeroId[heroId], json.encode(args))
|
||||
end
|
||||
|
||||
-- 上报24小时内开宝箱
|
||||
function BIReport:postFirstDayOpenBox(count)
|
||||
-- 只有外网正式渠道真机包才上报
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
-- 审核/白名单模式不上报
|
||||
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
|
||||
return
|
||||
end
|
||||
if not DataManager:getIsInCreate24Hour() then
|
||||
return
|
||||
end
|
||||
if not self.postBoxCount then
|
||||
self.postBoxCount = {
|
||||
[3] = true
|
||||
}
|
||||
end
|
||||
|
||||
if not self.postBoxCount[count] then
|
||||
return
|
||||
end
|
||||
|
||||
local args = {}
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_24_boxopen_3", json.encode(args))
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogAppEvent("fb_24_boxopen_3", json.encode(args))
|
||||
end
|
||||
|
||||
-- Firebase
|
||||
function BIReport:postFirebaseLog(eventName, eventValue)
|
||||
if not Platform:getIsPublishChannel() or EDITOR_MODE then
|
||||
return
|
||||
end
|
||||
if not eventName or not eventValue then
|
||||
return
|
||||
end
|
||||
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostFireBaseEvent(eventName, json.encode(eventValue))
|
||||
end
|
||||
|
||||
-- 以下为数数
|
||||
function BIReport:printArgsStr(eventName, args)
|
||||
if not EDITOR_MODE then
|
||||
@ -1046,6 +1434,10 @@ function BIReport:postAppLovinAdRevenue(msg)
|
||||
self:report(EVENT_NAME_APPLOVIN_AD_REVENUE, args)
|
||||
if args.revenue and args.network_name and args.ad_unit_identifier and args.placement then
|
||||
self:postAdjustAdRevenueAppLovinMAX(args.revenue, args.network_name, args.ad_unit_identifier, args.placement)
|
||||
local args = {
|
||||
applovin_revenue = args.revenue
|
||||
}
|
||||
self:postFirebaseLog("ad_impression", args)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -127,6 +127,8 @@ function DataManager:initWithServerData(data)
|
||||
Logger.logHighlight("initWithServerData")
|
||||
Logger.printTable(data)
|
||||
end
|
||||
self.registerTs = data.stat and data.stat.register_ts or Time:getServerTime()
|
||||
self.registerTs = GFunc.formatTimeStep(self.registerTs or Time:getServerTime())
|
||||
self.todayFirstLogin = data.today_first_login
|
||||
self.PlayerData:init(data)
|
||||
self.ChapterData:init(data.chapter)
|
||||
@ -178,12 +180,20 @@ end
|
||||
-- 是否首次登录
|
||||
function DataManager:getIsFirstLogin()
|
||||
local nowTime = Time:getServerTime()
|
||||
if self.registerTs%86400 == nowTime %8640 and self:getIsTodayFirstLogin() then
|
||||
local offset = nowTime - (self.registerTs or 0)
|
||||
if math.abs(offset) <= 10 and self:getIsTodayFirstLogin() then -- 允许误差
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- 是否在新号24小时内
|
||||
function DataManager:getIsInCreate24Hour()
|
||||
local nowTime = Time:getServerTime()
|
||||
local passTime = nowTime - (self.registerTs or 0)
|
||||
return passTime < 86400
|
||||
end
|
||||
|
||||
function DataManager:getIsTodayFirstLogin()
|
||||
return self.todayFirstLogin or false
|
||||
end
|
||||
|
||||
@ -175,6 +175,7 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, produc
|
||||
local cfgName = PayManager.PURCHARSE_TYPE_CONFIG[gift.act_type]
|
||||
local cfgInfo = ConfigManager:getConfig(cfgName)[gift.id]
|
||||
local rechargeId = cfgInfo.recharge_id
|
||||
local beforCount = DataManager.PlayerData:getPayCounts(rechargeId)
|
||||
DataManager.PlayerData:addPayment(rechargeId)
|
||||
DataManager.ShopData:addPayment(rechargeId) -- 降档版本
|
||||
DataManager.ShopData:updateGiftInfo(gift)
|
||||
@ -183,6 +184,9 @@ function PayManager:requestRewards(purchaseToken, orderId, originOrderId, produc
|
||||
giftId = gift.id,
|
||||
rechargeId = cfgInfo.recharge_id
|
||||
})
|
||||
if beforCount <= 0 then
|
||||
BIReport:postFirstRechargeEvent(rechargeId)
|
||||
end
|
||||
end)
|
||||
|
||||
for _, info in ipairs(biPayGetInfo) do
|
||||
|
||||
@ -301,6 +301,12 @@ function SDKManager:showFullScreenAds(adsClickType, adCallback)
|
||||
|
||||
BIReport:postAdClick(adsClickType)
|
||||
if EDITOR_MODE then
|
||||
if DataManager.PlayerData then
|
||||
DataManager.PlayerData:addAdCount()
|
||||
local data = {}
|
||||
data.ads_num = DataManager.PlayerData:getAdCount()
|
||||
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
|
||||
end
|
||||
self:adRewradAd()
|
||||
if adCallback then
|
||||
adCallback()
|
||||
@ -364,7 +370,7 @@ end
|
||||
function SDKManager:adRewradAd(noReport)
|
||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_WATCH_AD)
|
||||
if not noReport then
|
||||
-- BIReport:postAdEvent()
|
||||
BIReport:postAdEvent()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -58,6 +58,12 @@ function ChapterManager:startFightFinish(result)
|
||||
end
|
||||
|
||||
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.STAGE, params)
|
||||
-- 上报FB AF章节
|
||||
local chapterId = DataManager.ChapterData:getChapterId()
|
||||
if result.reqData.chapter_id then
|
||||
chapterId = result.reqData.chapter_id
|
||||
end
|
||||
BIReport:postChapterEvent(chapterId)
|
||||
end
|
||||
end
|
||||
|
||||
@ -162,6 +168,9 @@ function ChapterManager:endFightFinish(result)
|
||||
|
||||
if not reqData.win then
|
||||
DataManager.ShopData:markPopLastChapterActGift()
|
||||
if DataManager.ChapterData:getChapterFightCount(fightChapterId) == 1 then -- 首次失败上报
|
||||
BIReport:postFirstDayGradeFailEvent(fightChapterId)
|
||||
end
|
||||
end
|
||||
|
||||
ModuleManager.TaskManager:addFightTaskProgress(reqData.task_stat)
|
||||
|
||||
@ -173,6 +173,10 @@ function LoginManager:loginFinish(data)
|
||||
|
||||
local info = LocalData:getLastLoginInfo()
|
||||
BIReport:postAccountLoginFinish(info.type)
|
||||
|
||||
if DataManager:getIsFirstLogin() then
|
||||
BIReport:postLvEvent(0, 1)
|
||||
end
|
||||
else
|
||||
local info = LocalData:getLastLoginInfo()
|
||||
BIReport:postAccountLoginFailed(info.type, data.err_code)
|
||||
|
||||
@ -41,6 +41,13 @@ function SummonManager:summonFinish(result)
|
||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_OPEN_SHOP_BOX_LEVEL_3, 1)
|
||||
end
|
||||
end
|
||||
if result.summon_info.count then
|
||||
local totalCount = 0
|
||||
for t, count in pairs(result.summon_info.count) do
|
||||
totalCount = totalCount + count
|
||||
end
|
||||
BIReport:postFirstDayOpenBox(totalCount)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -127,7 +127,9 @@ function HeroData:setHeroLv(id, lv)
|
||||
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_NEW_HERO_GOT)
|
||||
ModuleManager.PlayerManager:checkUnlockAvatar(id)
|
||||
activeBefore = false
|
||||
BIReport:postFirstGetHero(self.data.activeCount)
|
||||
end
|
||||
local beforeLv = entity:getLv()
|
||||
entity:setLv(lv)
|
||||
if entity:isActived() then
|
||||
local matchType = entity:getMatchType()
|
||||
@ -145,6 +147,9 @@ function HeroData:setHeroLv(id, lv)
|
||||
end
|
||||
BIReport:postHeroOpt(id, BIReport.HERO_OPT_TYPE.ACTIVE)
|
||||
end
|
||||
|
||||
BIReport:postHeroLev(beforeLv, lv)
|
||||
BIReport:postFirstDayHeroLevel(id)
|
||||
end
|
||||
|
||||
function HeroData:getMatchActiveHeroMap()
|
||||
|
||||
@ -18,6 +18,8 @@ function PlayerData:init(data)
|
||||
self.data.payAmount = 0
|
||||
self.data.payCount = 0
|
||||
self.data.adCount = stat.ad_count or 0
|
||||
self.pay_counts = stat.pay_counts or {}
|
||||
self.register_ts = GFunc.formatTimeStep(stat.register_ts or Time:getServerTime())
|
||||
if stat.pay_counts then
|
||||
for id, count in pairs(stat.pay_counts) do
|
||||
if RECHARGE_CFG[id] then
|
||||
@ -120,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)
|
||||
@ -128,6 +131,7 @@ function PlayerData:setLv(level, exp)
|
||||
local data = {}
|
||||
data.player_level = self.data.level
|
||||
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
|
||||
BIReport:postLvEvent(beforeLv, level)
|
||||
end
|
||||
|
||||
function PlayerData:getLv()
|
||||
@ -191,12 +195,17 @@ function PlayerData:addPayment(rechargeId)
|
||||
local cfg = ConfigManager:getConfig("recharge")[rechargeId]
|
||||
self.data.payAmount = self.data.payAmount + cfg.price
|
||||
self.data.payCount = self.data.payCount + 1
|
||||
self.pay_counts[rechargeId] = (self.pay_counts[rechargeId] or 0) + 1
|
||||
end
|
||||
|
||||
function PlayerData:getPayCount()
|
||||
return self.data.payCount
|
||||
end
|
||||
|
||||
function PlayerData:getPayCounts(rechargeId)
|
||||
return self.pay_counts[rechargeId] or 0
|
||||
end
|
||||
|
||||
function PlayerData:addPayCount()
|
||||
self.data.payCount = self.data.payCount + 1
|
||||
end
|
||||
@ -563,4 +572,8 @@ function PlayerData:addArenaTicketAdBuyCount()
|
||||
self.data.arenaTicketADCount = self.data.arenaTicketADCount + 1
|
||||
end
|
||||
|
||||
function PlayerData:getRegisterTs()
|
||||
return self.register_ts or Time:getServerTime()
|
||||
end
|
||||
|
||||
return PlayerData
|
||||
Loading…
x
Reference in New Issue
Block a user