c1_lua/lua/app/common/bi_report.lua
2025-10-24 14:36:35 +08:00

2117 lines
59 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local BIReport = {
isNewPlayer = false
}
-- 客户端的所有的上报事件都要加"client_"前缀
local EVENT_NAME_TUTORIAL = "client_tutorial"
local EVENT_NAME_LUA_CRASH = "client_lua_crash"
local EVENT_NAME_OPEN_UI = "client_open_ui"
-- 所有需要上报的按钮点击事件
BIReport.CLICK_BTN_TYPE = {
HOME = "Home",
HERO = "Hero",
}
BIReport.ADS_OPT_TYPE = {
CLICK = "Click",
SUCCESS = "Success",
REWARD_GET = "RewardGet",
}
BIReport.PAY_OPT_TYPE = {
CLICK = "Click",
BUY = "Buy",
REWARD = "Reward",
APPLE_REVIEW_REWARD = "AppleReviewReward",
WHITELIST_REWARD = "WhitelistReward",
CANCEL = "Cancel",
FAILED = "Failed",
INIT_SUC = "InitSuc",
INIT_FAILED = "InitFailed",
}
BIReport.ACCOUNT_OPT_TYPE = {
LOGIN_SUCCESS = "LoginSuccess",
LOGIN_FAILED = "LoginFailed",
CLICK_BIND = "ClickBind",
BIND_SUCCESS = "BindSuccess",
BIND_FAILED = "BindFailed",
DELETE = "Delete",
CLICK_CHANGE_ACCOUNT = "ClickChangeAccount",
CHANGE_ACCOUNT_SUCCESS = "ChangeAccountSuccess",
CHANGE_ACCOUNT_FAILED = "ChangeAccountFailed",
}
BIReport.CHAPTER_OPT_TYPE = {
PASS = "Pass",
BOX_OPEN = "BoxOpen",
}
BIReport.TASK_TYPE = {
DAILY = "Daily",
}
BIReport.TASK_OPT_TYPE = {
FINISH = "Finish",
REWARD = "Reward",
}
BIReport.ITEM_GET_TYPE = {
NONE = "None",
NEW_PLAYER_INITIAL = "NewPlayerInitial", -- 新玩家创号自带
UPGRADE_HERO = "UpgradeHero",
CHAPTER_FIGHT_START = "ChapterFightStart",
CHAPTER_FIGHT_END = "ChapterFightEnd",
CHAPTER_BOX = "ChapterBox",
CROSS_DAY = "CrossDay",
RECOVERY_TIME = "RecoveryTime",
ADS_BUY_VIT = "AdsBuyVit",
GEM_BUY_VIT = "GemBuyVit",
ADS_BUY_ARENA_TICKET = "AdsBuyArenaTicket",
GEM_BUY_ARENA_TICKET = "GemBuyArenaTicket",
TASK_DAILY_REFRESH = "TaskDailyRefresh",
TASK_DAILY_REWARD = "TaskDailyReward",
BOUNTY_UNLOCK_LEVEL = "BountyUnlockLevel",
BOUNTY_REWARD = "BountyReward",
BOUNTY = "Bounty",
ARENA_BOUNTY_UNLOCK_LEVEL = "ArenaBountyUnlockLevel",
ARENA_BOUNTY_REWARD = "ArenaBountyReward",
ARENA_BOUNTY = "ArenaBounty",
IDLE_DROP = "IdleDrop",
IDLE_QUICK_DROP = "IdleQuickDrop",
MAIL = "Mail",
MALL = "Mall",
MALL_IDLE = "MallIdle", -- 常驻金币挂机礼包
MALL_TREASURE = "MallTreasure", -- 常驻钻石礼包
MALL_DAILY = "MallDaily", -- 每日特惠
MALL_DAILY_RESET = "MallDailyReset",
COIN_GIFT = "CoinGift",
BEGINNER_GIFT = "BeginnerGift",
LEVEL_UP_GIFT = "LevelUpGift",
ACT_CHAPTER_STORE = "ActChapterStore", -- 章节礼包
SUMMON = "Summon",
PLAYER_LV_UP = "PlayerLvUp",
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
GROWTH_FUND = "GrowthFund",
GROW_UP_GIFT_NEW = "GrowUpGiftNew", -- 新成长礼包
DAILY_CHALLENGE = "DailyChallenge", -- 每日挑战进入战斗扣体力
DAILY_CHALLENGE_END = "DailyChallengeEnd", -- 每日挑战结算
DAILY_CHALLENGE_RESET = "DailyChallengeReset", -- 每日挑战重置
DAILY_CHALLENGE_TASK_REWARD = "DailyChallengeTaskReward", -- 每日挑战任务奖励
CDKEY = "Cdkey",
DUNGEON_GOLD_CHALLENGE = "DungeonGoldChallenge", -- 金币副本挑战
DUNGEON_GOLD_END = "DungeonGoldEnd", -- 金币副本结算
DUNGEON_GOLD_SWEEP = "DungeonGoldSweep", -- 金币副本扫荡
DUNGEON_SHARDS_CHALLENGE = "DungeonShardsChallenge", -- 碎片副本挑战
DUNGEON_SHARDS_END = "DungeonShardsEnd", -- 碎片副本结算
DUNGEON_SHARDS_SWEEP = "DungeonShardsSweep", -- 碎片副本扫荡
ARENA_REMATCH_CD = "ArenaRematchCd",
ARENA_REWARD = "ArenaReward",
ARENA_AD_BOX_REWARD = "ArenaAdBoxReward",
ARENA_GRADING_REWARD = "ArenaGradingReward",
CHANGE_NAME = "ChangeName", -- 重命名
CHANGE_AVATAR = "ChangeAvatar", -- 修改头像
CHANGE_FRAME = "ChangeFrame", -- 修改头像框
INTRODUCTORY_GIFT = "IntroductoryGift", -- 入门礼包
ARENA_CHALLENGE = "ArenaChallenge",
ARENA_SETTLEMENT = "ArenaSettlement",
ARENA_GIFT = "ArenaGift",
ACTIVITY_BOUNTY_REWARD = "ActivityBountyReward",
ACTIVITY_BOUNTY_LEVEL = "ActivityBountyLevel",
COLLECTION_HERO_REWARD = "CollectionHeroReward",
DUNGEON_WEAPON_CHALLENGE = "DungeonWeaponChallenge",
DUNGEON_WEAPON_END = "DungeonWeaponEnd",
DUNGEON_WEAPON_SWEEP = "DungeonWeaponSweep",
DUNGEON_ARMOR_CHALLENGE = "DungeonArmorChallenge",
DUNGEON_ARMOR_END = "DungeonArmorEnd",
DUNGEON_ARMOR_SWEEP = "DungeonArmorSweep",
DUNGEON_ARMOR_STAR_REWARD = "DungeonArmorStarReward",
DUNGEON_ARMOR_FUND_REWARD = "DungeonArmorFundReward",
ARMOR_FUND = "ArmorFund",
WEAPON_GIFT = "WeaponGift",
ARMOR_GIFT = "ArmorGift",
EQUIP_UPGRADE = "EquipUpgrade",
ARMOR_UPGRADE = "ArmorUpgrade",
OFFLINE_RECOVERY = "OfflineRecovery",
ACT_SUMMER = "ActSummer",
ACT_HERO_FUND = "ActHeroFund",
ACT_BOSS_RUSH_FIGHT_START = "ActBossRushFightStart",
ACT_BOSS_RUSH_FIGHT = "ActBossRushFight",
ACT_BOSS_RUSH_FUND = "ActBossRushFund",
ACT_BOSS_RUSH_SHOP = "ActBossRushShop",
ACT_BOSS_RUSH_RANK = "ActBossRushRank",
ACT_BOSS_RUSH_BUY_FUND = "ActBossRushBuyFund",
ACT_FOURTEEN_DAY_BOUNTY = "ActFourteenDayBounty",
ACT_FOURTEEN_DAY_TASK = "ActFourteenDayTask",
ACT_FOURTEEN_DAY_EXCHANGE = "ActFourteenDayExchange",
FOURTEEN_DAY_GIFT = "FourteenDayGift",
FULL_MOON_HERO_GIFT = "FullMoonHeroGift",
FULL_MOON_NEW_HERO_GIFT = "FullMoonNewHeroGift",
FULL_MOON_SKIN_GIFT = "FullMoonSkinGift",
DUNGEON_RUNE_START = "DungeonRuneStart",
DUNGEON_RUNE_SETTLEMENT = "DungeonRuneSettlement",
DUNGEON_RUNE_SWEEP = "DungeonRuneSweep",
DUNGEON_RUNE_BUY_WING = "DungeonRunebuyWing",
ACT_PVP_ENTER = "ActPvpEnter",
ACT_PVP_REFRESH_HERO = "ActPvpRefreshHero",
ACT_PVP_FIGHT_END = "ActPvpFightEnd",
ACT_PVP_OVER_CD = "ActPvpOverCd",
ACT_PVP_DAILY_REWARD = "ActPvpDailyReward",
ACT_PVP_BOUNTY = "ActPvpBounty",
ACT_PVP_BOUNTY_GIFT = "ActPvpBountyGift",
ACT_PVP_RANK_REWARD = "ActPvpRankReward",
ACT_PVP_BUY_BOUNTY_LEVEL = "ActPvpBuyBountyLevel",
RUNES_QUENCHING = "RuneQuenching",
RUNES_AUTO_QUENCHING = "RuneAutoQuenching",
RUNES_GIFT = "RuneGift",
TOURN_WAVE_BOUNTY_REWARD = "TournWaveBountyReward",
TOURN_WAVE_BOUNTY_LEVEL = "TournWaveBountyLevel",
TOURN_WAVE_RANK_REWARD = "TournWaveRankReward",
TOURN_WAVE_GIFT = "TournWaveGift",
TOURN_ARENA_BOUNTY_REWARD = "TournArenaBountyReward",
TOURN_ARENA_BOUNTY_LEVEL = "TournArenaBountyLevel",
TOURN_ARENA_RANK_REWARD = "TournArenaRankReward",
TOURN_ARENA_GIFT = "TournArenaGift",
FULL_MOON_TASK = "FullMoonTask",
FULL_MOON_TASK_PROG_REWARD = "FullMoonTaskProgReward",
FULL_MOON_SKIN_CHALLENGE_REWARD = "FullMoonSkinChallengeReward",
TASK_ACHIEVEMENT = "task_achievement",
-- 装备相关
EQUIP_WEAR = "equip_wear",
EQUIP_LV_UP = "equip_lv_up",
EQUIP_REFINE = "equip_refine",
EQUIP_RESOLVE = "equip_resolve",
-- 召唤
FORCE_SUMMON = "force_summon",
FORCE_SUMMON_WISH_HREO_ID = "force_summon_wish_hero_id",
ACT_SUMMON_HERO_GIFT = "act_summon_hero_gift",
-- 等级弹窗礼包
-- GIFT_POP_LV = "gift_pop_lv",
-- GIFT_POP_HERO_LV = "gift_pop_hero_lv",
GIFT_POP_CHAPTER = "gift_pop_chapter",
-- 商城相关
SHOP_CHAPTER = "shop_chapter",
-- SHOP_CORE_SOUL = "shop_core_soul",
SHOP_DAILY = "shop_daily",
SHOP_DAILY_REFRESH = "shop_daily_refresh",
SHOP_GEM = "shop_gem",
SHOP_GOLD = "shop_gold",
-- SHOP_EMBLEM = "shop_emblem",
-- 基金
FUND_GROW = "fund_grow",-- 基金
ACT_CHAPTER_FUND_REWARD = "act_chapter_fund_reward",
ACT_LEVEL_FUND_REWARD = "act_level_fund_reward",
-- 七日签到战令
SIGN_BOUNTY = "signin_bounty",
SIGN_BOUNTY_REWARD = "sign_bounty_reward", -- 补领上次奖励
SIGN_BOUNTY_RESIGH = "sign_bounty_resigh",
SIGN_BOUNTY_SIGH = "sign_bounty_sigh",
SIGN_MONTH_ACCUM_CLAIM = "signin_30_accum_claim",
-- 首充
FIRST_RECHARGE = "first_recharge",
-- 特权卡
PRIVILEGE_CARD = "privilege_card",
-- 七日乐
SEVEN_DAY_GIFT = "seven_day_gift",
BATTLE_REVIVE = "battle_revive",
CHAPTER_DOUBLE_REWARD = "chapter_double_reward",
}
BIReport.ADS_CLICK_TYPE = {
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
BATTLE_SKILL_ALL = "BattleSkillAll",
BATTLE_SKILL_DEITY = "BattleSkillDeity",
BATTLE_DOUBLE_BOX = "BattleDoubleBox",
BATTLE_REVIVE = "BattleRevive",
BATTLE_RESULT_DOUBLE = "BattleResultDouble",
AD_ENERGY = "AdEnergy",
TASK_DAILY_REFRESH = "TaskDailyRefresh",
TASK_DAILY_TASK = "TaskDailyTask",
IDLE_QUICK_DROP = "IdleQuickDrop",
ARENA_TICKET = "ArenaTicket",
ARENA_REMATCH = "ArenaRematch",
ARENA_AD_BOX = "ArenaAdBox",
ARMOR_FUND_AD = "ArmorFundAd",
DUNGEON_RUNE_REBIRTH = "DungeonRuneRebirth",
ACT_PVP_AD_REFRESH_HERO = "ActPvpAdRefreshHero",
ACT_PVP_AD_REMATCH = "ActPvpAdRematch",
MALL_DAILY = "MallDaily",
MALL_DAILY_RESET = "MallDailyReset",
MALL_GOLD = "MallGold",
MALL_TREASURE = "MallTreasure",
MAIL = "Mail",
SUMMON_AD = "SummonAd",
AD_ACT_SEVEN_DAY_GIFT = "AdActSevenDayGift",
AD_ACT_SPRINT = "AdActSprint", -- 冲刺活动
}
BIReport.FIGHT_OPT_TYPE = {
START = "Start",
END = "End",
SELECT_SKILL_OPEN = "SelectSkillOpen",
SELECT_SKILL = "SelectSkill",
HERO_INFO = "HeroInfo",
HERO_REPORT = "HeroReport",
}
BIReport.FIGHT_DEATH_TYPE = {
SURVIVE = "Survive",
ELITE_FAIL = "EliteFail",
BOSS_FAIL = "BossFail",
NORMAL_FAIL = "NormalFail",
}
BIReport.FIGHT_WAVE_END_TYPE = {
WIN = "Win",
FAIL = "Fail",
QUIT = "Quit",
}
BIReport.BATTLE_TYPE = {
["1"] = "Stage",
["2"] = "DailyChallenge",
["3"] = "DungeonGold",
["4"] = "DungeonShards",
["5"] = "Arena",
["6"] = "DungeonWeapon",
["7"] = "DungeonArmor",
["8"] = "ActBossRush",
["9"] = "DungeonRune",
["10"] = "FullMoonSkin",
["11"] = "ActPvp",
}
BIReport.GIFT_TYPE = {
FIRST_RECHARGE = "FirstRecharge",
COIN_GIFT = "CoinGift",
BEGINNER_GIFT = "BeginnerGift",
LEVEL_UP_GIFT = "LevelUpGift",
BOUNTY = "Bounty",
MALL_TREASURE = "MallTreasure",
ACT_CHAPTER_STORE = "ActChapterStore",
GROWTH_FUND = "GrowthFund",
GROW_UP_GIFT_NEW = "GrowUpGiftNew",
ARENA_BOUNTY = "ArenaBounty",
INTRODUCTORY_GIFT = "IntroductoryGift",
ARENA_GIFT = "ArenaGift",
ARMOR_FUND = "ArmorFund",
WEAPON_GIFT = "WeaponGift",
ARMOR_GIFT = "ArmorGift",
ACT_SUMMER = "ActSummer",
ACT_HERO_FUND = "ActHeroFund",
FOURTEEN_DAY_GIFT = "FourteenDayGift",
ACT_PVP_BOUNTY_GIFT = "ActPvpBountyGift",
FULL_MOON_HERO_GIFT = "FullMoonHeroGift",
FULL_MOON_NEW_HERO_GIFT = "FullMoonNewHeroGift",
FULL_MOON_SKIN_GIFT = "FullMoonSkinGift",
RUNES_GIFT = "RunesGift",
TOURN_WAVE_GIFT = "TournWaveGift",
TOURN_ARENA_GIFT = "TournArenaGift",
-- 等级弹窗礼包
-- GIFT_POP_LV = "gift_pop_lv",
-- GIFT_POP_HERO_LV = "gift_pop_hero_lv",
GIFT_POP_CHAPTER = "gift_pop_chapter",
-- 商城相关
SHOP_CHAPTER = "shop_chapter",
-- SHOP_CORE_SOUL = "shop_core_soul",
SHOP_DAILY = "shop_daily",
SHOP_DAILY_REFRESH = "shop_daily_refresh",
SHOP_GEM = "shop_gem",
SHOP_GOLD = "shop_gold",
-- SHOP_EMBLEM = "shop_emblem",
-- 高级战令
BOUNTY_PRO_REWARD = "bounty_pro_reward",
FUND_GROW = "fund_grow",-- 成长基金
SIGN_BOUNTY = "sign_bounty",
PRIVILEGE_CARD = "privilege_card",
SEVEN_DAY_GIFT = "seven_day_gift",
}
BIReport.COIN_TYPE = {
[1] = "Gold",
[2] = "Gem",
}
BIReport.MAIL_OPT_TYPE = {
OPEN = "Open",
CLAIM = "Claim",
CLICK = "Click",
}
BIReport.BOUNTY_OPT_TYPE = {
BOUNTY_LEVEL_UP = "BountyLevelUp",
BOUNTY_REWARD = "BountyReward",
ARENA_BOUNTY_LEVEL_UP = "ArenaBountyLevelUp",
ARENA_BOUNTY_REWARD = "ArenaBountyReward",
}
BIReport.HERO_OPT_TYPE = {
UNLOCK = "Unlock",
ACTIVE = "Active",
LEVEL_UP = "LevelUp",
FORMATION = "Formation",
}
BIReport.NETWORK_OPT_TYPE = {
DISCONNECT = "disconnect",
RECONNECT = "reconnect",
ERROR_CODE = "errorCode",
PD_DECODE_FAILED = "pdDecodeFailed",
AUTH_FAILED = "authFailed",
}
BIReport.DIALY_CHALLENGE_OPT_TYPE = {
TASK_STATE = "TaskState",
}
BIReport.MISCELLANEOUS_OPT_TYPE = {
EVALUATE_OPEN = "EvaluateOpen",
EVALUATE_CLOSE = "EvaluateClose",
BATTLE_SNAP_SHOP_OPEN = "BattleSnapShopOpen",
}
BIReport.ARENA_OPT_TYPE = {
CONSUME = "Consume",
SETTLEMENT = "Settlement",
}
BIReport.PAY_UI_SHOW_TYPE = {
LOGIN_POP = "LoginPop",
TRIGGER_POP = "TriggerPop",
CLICK_SHOW = "ClickShow",
SHOP_SHOW = "ShopShow",
ENTER_SHOW = "EnterShow",
}
BIReport.BOX_OPEN_BOX_TYPE = {
SHOP = "Shop",
ACTIVITY = "Activity",
}
BIReport.BOX_OPEN_OPEN_TYPE = {
USE_KEY = "UseKey",
USE_GEM = "UseGem",
BOUNTY = "Bounty",
ARENA_BOUNTY = "ArenaBounty",
}
BIReport.ACTIVITY_SUMMER = {
TASK_REWARD = "TaskReward",
BUY_LEVEL_UP = "BuyLevelUp",
}
BIReport.RUNES_FORMATION = {
CHAPTER = "chapter",
}
BIReport.PAY_DOUBLE = {
NORMAL = "Normal",
DOUBLED = "Doubled",
}
-- 冲刺活动
BIReport.ACT_SPRINT_TYPE = {
SUMMON = "Summon",
SOUL_BOX = "SoulBox",
TREE = "Tree",
}
BIReport.VIDEO_AD_OPT_TYPE = {
CLICK = "click",
PLAY_SUCCESS = "play_success",
PLAY_FAIL = "play_fail",
GET_REWARD = "get_reward",
LOAD_RUSULT = "load_result",
GET_REWARD_SKIP_AD = "get_reward_skip_ad",
}
BIReport.SEVEN_DAY_GIFT_OPT = {
CLICK = "Click",
REWARD = "Reward",
}
-- b6
local EVENT_NAME_EXIT = "client_exit"
local EVENT_NAME_FIGHT = "client_fight"
local EVENT_NAME_CLICK_BTN = "client_click_btn"
local EVENT_NAME_ITEM_GET = "client_item_get"
local EVENT_NAME_ITEM_USE = "client_item_use"
local EVENT_NAME_COIN_GET = "client_coin_get"
local EVENT_NAME_COIN_USE = "client_coin_use"
local EVENT_NAME_AD_OPT = "client_ads_opt"
local EVENT_NAME_PAY_OPT = "client_pay_opt"
local EVENT_NAME_LOGIN_FINISH = "client_login_finish"
local EVENT_NAME_LOGIN = "client_login"
local EVENT_NAME_PING_SERVER = "client_ping_server"
local EVENT_NAME_ACCOUNT_OPT = "client_account_opt"
local EVENT_NAME_CHAPTER_OPT = "client_chapter_opt" -- 章节
local EVENT_NAME_VIT_USE = "client_vit_use"
local EVENT_NAME_VIT_GET = "client_vit_get"
local EVENT_NAME_DAILY_TASK = "client_daily_task"
local EVENT_NAME_MAIL_OPT = "client_mail_opt"
local EVENT_NAME_HERO_OPT = "client_hero_opt"
local EVENT_NAME_PLAYER_LV_UP = "client_player_lv_up" -- 玩家升级
local EVENT_NAME_PAY_UI_SHOW = "client_pay_ui_show" -- 内购相关界面展示
local EVENT_NAME_BOUNTY_OPT = "client_bounty_opt" -- 通用战令事件(包括常规,竞技场等)
local EVENT_NAME_NETWORK_OPT = "client_network_opt" -- 网络操作
local EVENT_NAME_APPLOVIN_AD_REVENUE = "client_applovin_ad_revenue" -- applovin广告收入
local EVENT_NAME_IRONSOURCE_AD_REVENUE = "client_ironsource_ad_revenue" -- applovin广告收入
local EVENT_NAME_DAILY_CHALLENGE_OPT = "client_daily_challenge_opt"
local EVENT_NAME_ARENA_OPT = "client_arena_opt"-- 竞技场
local EVENT_NAME_MISCELLANEOUS_OPT = "event_name_miscellaneous_opt" -- 一些杂项
local EVENT_BOX_OPEN = "client_box_open"
local EVENT_ACT_OPT = "client_act_opt"
local EVENT_NAME_RUNES = "client_runes"
local EVENT_NAME_PAY_ORDER_REPEAT = "client_pay_order_repeat"
local EVENT_NAME_VIDEO_AD_OPT = "client_ad_opt"
BIReport.TASK_OPT = {
TASK_REWARD = "TaskReward",
STAGE_REWARD = "StageReward",
ACHIEVEMENT_REWARD = "AchievementReward",
}
function BIReport:setIsNewPlayer(isNewPlayer)
self.isNewPlayer = isNewPlayer
end
-- adjust
function BIReport:postAdjustSimpleTrackEvent(eventName)
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
if not eventName then
return
end
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAdjustSimpleTrackEvent(eventName)
end
function BIReport:postAdjustAdRevenueAppLovinMAX(revenue, networkName, adUnitIdentifier, placement)
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAdjustAdRevenueAppLovinMAX(revenue, networkName, adUnitIdentifier, placement)
end
function BIReport:updateAccountId(id)
if id == nil then
return
end
self:clearAccountId()
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:SetThinkingAnalyticsAccountId(tostring(id))
end
function BIReport:clearAccountId()
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:ClearThinkingAnalyticsAccountId()
end
function BIReport:TAUserAdd(args)
-- 测试包和编辑器模式不上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserAdd", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserAdd(args)
end
end
function BIReport:TAUserSet(args)
-- 测试包和编辑器模式不上报报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserSet", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(args)
end
end
function BIReport:TAUserSetOnce(args)
-- 测试包和编辑器模式不上报报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
self:printArgsStr("TAUserSetOnce", args)
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if args and type(args) == "table" then
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSetOnce(args)
end
end
function BIReport:report(name, args)
self:printArgsStr(name, args)
-- 内网dev包和编辑器模式不上报
if Platform and Platform:getIsDevChannel() or EDITOR_MODE then
return
end
-- 审核模式不上报
if CS.BF.BFMain.IsShenhe then
return
end
if args and type(args) == "table" then
if DataManager and DataManager:getIsInitWithServer() then
if DataManager.ChapterData then
if args.max_level == nil then
args.max_level = DataManager.ChapterData:getMaxChapterId()
end
if args.level_id == nil then
args.level_id = DataManager.ChapterData:getChapterId()
end
if args.max_chapter == nil then
args.max_chapter = DataManager.ChapterData:getNextChapter(DataManager.ChapterData:getMaxChapterId())
end
end
if DataManager.BagData and DataManager.BagData.ItemData then
args.gold = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GOLD)
args.gem = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_GEM)
args.energy = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT)
end
if DataManager.PlayerData then
args.player_level = DataManager.PlayerData:getLv()
end
local str, lv, atk, hp = DataManager.FormationData:getStageFormationBIStr()
args.formation_atk = atk
args.formation_hp = hp
if DataManager.DungeonData then
args.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
end
args.game_version = DataManager.PlayerData:getGameVersion()
end
args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion()
args.is_new_player = self.isNewPlayer
args.device_unique_identifier = CS.UnityEngine.SystemInfo.deviceUniqueIdentifier
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostThinkingAnalyticsEvent(name, json.encode(args))
else
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostThinkingAnalyticsEvent(name)
end
end
-- 上报引导每一步
function BIReport:postTutorialStep(id)
local level = DataManager.PlayerData:getLv()
local args = {
client_tutorial_id = id,
level = level
}
self:report(EVENT_NAME_TUTORIAL, args)
end
-- Lua crash
function BIReport:postLuaCrash(logString, stackTrace)
local msg = logString .. stackTrace
if #msg > 2000 then
msg = string.sub(msg, 1, 2000)
end
local args = {
client_lua_crash_msg = msg,
}
self:report(EVENT_NAME_LUA_CRASH, args)
end
-- 上报界面打开
function BIReport:postOpenUI(uiName, childUI)
if uiName == nil or uiName == "" then
return
end
local args = {
client_ui_name = uiName,
client_ui_child_name = childUI,
}
self:report(EVENT_NAME_OPEN_UI, args)
end
-- 上报内购事件,单独处理,只上报到AF和FB,不上报数数
function BIReport:postPurchase(price, content, originOrderId, orderId)
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核模式不上报
if GFunc.isShenhe() then
return
end
-- 白名单模式也不上报
if GFunc.isInWhitelist() then
return
end
-- 上报AF,AF的所有事件值都是String类型
local args = {
af_revenue = tostring(price),
af_currency = "USD",
af_quantity = "1",
af_content_id = content,
af_order_id = originOrderId,
af_receipt_id = orderId
}
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_purchase", json.encode(args))
-- 上报FB的付费事件
local fbArgs = {
order_id = originOrderId,
product_id = content
}
CS.BF.BFMain.Instance.SDKMgr.BFLoginSDKMgr.FBSdk:LogPurchase(price, "USD", json.encode(fbArgs))
-- 上报付费到adjust
if Platform:isIosPlatform() then
self:postAdjustSimpleTrackEvent("rumq9q")
else
self:postAdjustSimpleTrackEvent("xzqrsb")
end
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAdjustRevenueTrackEvent("naoyh8", price, "USD")
end
-- 上报等级提升事件,单独处理,只上报到AF和FB,不上报数数
function BIReport:postFirstLoginEvent()
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核模式不上报
if CS.BF.BFMain.IsShenhe then
return
end
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("af_first_login", json.encode({}))
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
function BIReport:postRechargeEvent(id)
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
local postRechargeID = {
[3] = true, -- 2.99
[5] = true, -- 4.99
[10] = true, -- 9.99
[13] = true, -- 19.99
[15] = true, -- 29.99
[16] = true, -- 49.99
}
if not postRechargeID[id] then
return
end
local cfg = ConfigManager:getConfig("recharge")[id]
if not cfg then
return
end
self:postFirebaseLog("gg_package_" .. cfg.price, {})
end
function BIReport:postPurchaseAmountEvent(postAmount)
-- 只有外网正式渠道真机包才上报
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
-- 审核/白名单模式不上报
if CS.BF.BFMain.IsShenhe or CS.BF.BFMain.IsWhite then
return
end
if postAmount == 1 then
self:postFirebaseLog("purchase_1", {})
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("purchase_1", json.encode({}))
end
if postAmount == 5 then
self:postFirebaseLog("purchase_5", {})
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostAppsflyerEvent("purchase_5", json.encode({}))
end
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
-- AF广告价值回传
function BIReport:logAppsFlyerAdRevenue(mediationNetwork, monetizationNetwork, eventRevenue, data)
if not Platform:getIsPublishChannel() or EDITOR_MODE then
return
end
if not mediationNetwork or not monetizationNetwork or not eventRevenue then
return
end
local jsonStr = data and json.encode(data) or "{}"
CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:LogAppsFlyerAdRevenue(mediationNetwork, monetizationNetwork, eventRevenue, jsonStr)
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
return
end
local tab = clone(args)
tab.eventName = eventName
Logger.log("============report %s===========", eventName)
Logger.printTable(tab or {})
end
-- 开启游戏
function BIReport:postGameLogin(isFirstLogin)
local args = {
first_begin = isFirstLogin,
-- LogType -- 进入类型,不处理
}
self:report(EVENT_NAME_LOGIN, args)
end
-- 登录完成
function BIReport:postGameLoginFinish()
-- FirstBegin 是否是首次登陆
-- DailyFirstBegin 是否当日首次登录
-- LogType 进入类型
-- PushID 推送id
-- MaxLevel 已解锁最大关卡
-- Duration 登录加载时长
-- MyEquip 拥有装备
-- MyCherish 拥有传家宝
-- MyRunes 拥有符文
-- MaxTrial 副本进度
-- IsNew 是否是新用户
local args = {
-- is_daily_first = DataManager:getIsTodayFirstLogin(),
-- is_first = DataManager:getIsFirstLogin(),
}
args.all_heroes = DataManager.HeroData:getAllHeroesBIStr()
self:report(EVENT_NAME_LOGIN_FINISH, args)
end
-- 游戏退出
function BIReport:postGameExit()
local args = {}
self:report(EVENT_NAME_EXIT, args)
end
-- 进入战斗
function BIReport:postFightBegin(battleType, wave, chapterId, maxChapter, startTimes)
-- wave -- 波次
-- chapterId 进入关卡编号
-- maxChapter 已解锁最大关卡
-- startTimes 累计进入次数
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.START,
wave_id = wave,
chapter_id = chapterId,
fight_max_chapter = maxChapter,
start_times = startTimes,
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postFightBegin 没有battle_type 请检查===========")
end
end
args.formation, args.famation_level = DataManager.FormationData:getStageFormationBIStr()
self:report(EVENT_NAME_FIGHT, args)
end
function BIReport:postFightEnd(battleType, battleData, chapterId, wave, duration, totalTime, eliminateCount, chapterEliminateCount, type, deathType, startTimes, isFirstWin, isFianlStep, maxLinkCount)
-- wave 进入关卡编号
-- LevelType 进入关卡类型
-- MaxLevel 已解锁最大关卡
-- StartTimes 累计进入次数
-- IsNew 是否是新用户
local skillStr = GConst.EMPTY_STRING
local skillNum = 0
local skillMap = battleData:getSelectSkillMap()
if skillMap then
for skillId, info in pairs(skillMap) do
skillStr = skillStr .. skillId .. "|"
skillNum = skillNum + (info.count or 0)
end
end
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.END,
wave_id = wave,
chapter_id = chapterId,
duration = duration,
chapter_duration = totalTime,
eliminate = eliminateCount,
chapter_eleminate = chapterEliminateCount,
skill = skillStr,
skill_num = skillNum,
type = type, -- "Win Fail Quit",
death_type = deathType,
start_times = startTimes,
is_first_win = isFirstWin,
isFianlStep = isFianlStep,
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postFightEnd 没有battle_type 请检查===========")
end
end
args.formation, args.famation_level = DataManager.FormationData:getStageFormationBIStr()
args.max_link_count = maxLinkCount
self:report(EVENT_NAME_FIGHT, args)
end
function BIReport:postShowFightSkillSelect(battleType, battleData, skillList, chapterId, totalTime, wave)
local skillNum = 0
local skillMap = battleData:getSelectSkillMap()
if skillMap then
for skillId, info in pairs(skillMap) do
skillNum = skillNum + (info.count or 0)
end
end
local skillStr = GConst.EMPTY_STRING
if skillList then
for _, skillId in ipairs(skillList) do
skillStr = skillStr .. skillId .. "|"
end
end
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.SELECT_SKILL_OPEN,
wave_id = wave,
chapter_id = chapterId,
chapter_duration = totalTime,
skill = skillStr,
skill_num = skillNum,
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postShowFightSkillSelect 没有battle_type 请检查===========")
end
end
self:report(EVENT_NAME_FIGHT, args)
end
function BIReport:postFightSkillSelect(battleType, battleData, skillList, chapterId, totalTime, wave)
local skillNum = 0
local skillMap = battleData:getSelectSkillMap()
if skillMap then
for skillId, info in pairs(skillMap) do
skillNum = skillNum + (info.count or 0)
end
end
local skillStr = GConst.EMPTY_STRING
if skillList then
for _, skillId in ipairs(skillList) do
skillStr = skillStr .. skillId .. "|"
end
end
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.SELECT_SKILL,
wave_id = wave,
chapter_id = chapterId,
chapter_duration = totalTime,
skill = skillStr,
skill_num = skillNum,
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postFightSkillSelect 没有battle_type 请检查===========")
end
end
self:report(EVENT_NAME_FIGHT, args)
end
function BIReport:postFightHeroInfo(battleType, arkFormation)
if not arkFormation then
return
end
local heroInfo = {}
for matchType, heroEntity in pairs(arkFormation) do
if heroEntity then
local unit = {
id = heroEntity:getCfgId(),
level = heroEntity:getLv(),
atk = heroEntity:getAtk(),
hp = heroEntity:getHp(),
}
table.insert(heroInfo, unit)
end
end
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.HERO_INFO,
hero_info = json.encode(heroInfo)
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postFightSkillSelect 没有battle_type 请检查===========")
end
end
self:report(EVENT_NAME_FIGHT, args)
end
function BIReport:postFightHeroReport(battleType, atkReport)
if not atkReport then
return
end
local args = {
battle_type = BIReport.BATTLE_TYPE[battleType],
event_type = BIReport.FIGHT_OPT_TYPE.HERO_REPORT,
atk_report = json.encode(atkReport)
}
if EDITOR_MODE then
if not args.battle_type then
Logger.logFatal("============report postFightSkillSelect 没有battle_type 请检查===========")
end
end
self:report(EVENT_NAME_FIGHT, args)
end
-- 首页按钮点击
function BIReport:postHomeBtnCilck(clickType)
local args = {
event_type = clickType,
type = BIReport.CLICK_BTN_TYPE[clickType],
chapter_id = DataManager.ChapterData:getChapterId()
}
self:report(EVENT_NAME_CLICK_BTN, args)
end
function BIReport:postChapterOpenBox(chapterId, wave, rewards)
local rewardStr = GFunc.getRewardsStr(rewards)
local args = {
box_level = wave,
rewards = rewardStr,
chapter_id = chapterId,
event_type = BIReport.CHAPTER_OPT_TYPE.BOX_OPEN
}
self:report(EVENT_NAME_CHAPTER_OPT, args)
end
-- 道具获取
function BIReport:postItemGet(num, itemId, getType)
-- Item 道具id
-- Type 获得方式
-- MaxLevel 最大关卡
-- ItemNum 获取道具数量
-- ItemAll 获取后道具数量
-- IsNew 是否是新用户
local allNum = DataManager.BagData.ItemData:getItemNumById(itemId)
local args = {
item_value = num,
item_id = itemId,
item_all_value = allNum,
type = getType,
}
self:report(EVENT_NAME_ITEM_GET, args)
end
-- 道具使用
function BIReport:postItemUse(num, itemId, getType)
-- Item 道具id
-- Type 消耗方式
-- MaxLevel 最大关卡
-- ItemNum 消耗道具数量
-- ItemAll 消耗后道具数量
-- IsNew 是否是新用户
local allNum = DataManager.BagData.ItemData:getItemNumById(itemId)
local args = {
item_value = num,
item_id = itemId,
item_all_value = allNum,
type = getType,
}
self:report(EVENT_NAME_ITEM_USE, args)
end
-- 体力获得
function BIReport:postVitGet(num, getType, vitAll)
-- Type 获得类型 获得体力时 String Ads=广告、Gold=金币 、Time=时间恢复 、Stores=商品恢复
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
-- EnergyNum 当前体力数 Int 获得体力数量
-- MaxChapter 最大章节 Int 已解锁的最大章节
local args = {
type = getType,
vit_num = num,
vit_all = vitAll or DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT),
}
self:report(EVENT_NAME_VIT_GET, args)
end
-- 体力使用
function BIReport:postVitUse(num, getType)
-- EnergyNum 当前体力数 减少体力时 Int 使用体力数量
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
-- MaxChapter 最大章节 Int 已解锁的最大章节
local args = {
type = getType,
vit_num = num,
vit_all = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT),
}
self:report(EVENT_NAME_VIT_USE, args)
end
-- 点击广告按钮
function BIReport:postAdClick(adsType)
local args = {
ad_type = adsType,
event_type = BIReport.ADS_OPT_TYPE.CLICK,
}
self:report(EVENT_NAME_AD_OPT, args)
end
-- 广告播放视频成功
function BIReport:postAdPlaySuccess(adsType)
local args = {
ad_type = adsType,
event_type = BIReport.ADS_OPT_TYPE.SUCCESS,
}
self:report(EVENT_NAME_AD_OPT, args)
end
-- 广告奖励发放成功
function BIReport:postAdRewardGet(adsType)
local args = {
ad_type = adsType,
event_type = BIReport.ADS_OPT_TYPE.REWARD_GET,
}
self:report(EVENT_NAME_AD_OPT, args)
end
-- 支付sdk初始化状态
function BIReport:postPayInitStatus(optType, desc)
local args = {
opt_type = optType,
desc = desc or GConst.EMPTY_STRING,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 创建订单
function BIReport:postPayCreateOrder(giftType, id, rechargeId, uuid, isFromBattle, purchaseType)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CREATE_ORDER,
gift_type = giftType,
commodity_id = id,
uuid_string = uuid,
recharge_id = rechargeId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 点击商品购买按钮
function BIReport:postPayClick(giftType, id, rechargrId, payDouble, isFromBattle, purchaseType)
-- Commodity_ID 商品ID 点击商品按钮时 String 商品ID
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CLICK,
gift_type = giftType,
commodity_id = id,
commodity_state = payDouble,
recharge_id = rechargrId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 跳转购买界面
function BIReport:postPayTurn(giftType, id, rechargrId, payDouble, isFromBattle, purchaseType)
-- Commodity_ID 商品ID 跳转到支付界面时 String 商品ID
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
local args = {
opt_type = BIReport.PAY_OPT_TYPE.BUY,
gift_type = giftType,
commodity_id = id,
commodity_state = payDouble,
recharge_id = rechargrId,
from_battle = isFromBattle,
purchase_type = purchaseType,
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 取消购买
function BIReport:postPayCancel(productId, orderId, rechargeId, giftType, giftId, isFromBattle, purchaseType)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CANCEL,
product_id = productId,
order_id = orderId,
recharge_id = rechargeId,
gift_type = giftType,
commodity_id = giftId,
from_battle = isFromBattle,
purchase_type = purchaseType
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 购买失败
function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, giftType, giftId, isFromBattle, purchaseType)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.FAILED,
product_id = productId,
order_id = orderId,
recharge_id = rechargeId,
failed_type = failedType,
gift_type = giftType,
commodity_id = giftId,
from_battle = isFromBattle,
purchase_type = purchaseType
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 未完成订单
function BIReport:postPayResendOrder(productId, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.RESEND,
product_id = productId,
order_id = orderId
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 消耗订单
function BIReport:postPayConsumeOrder(productId, debugInfo)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.CONSUME,
product_id = productId,
debug_info = debugInfo
}
self:report(EVENT_NAME_PAY_OPT, args)
end
function BIReport:postPayDoUncompleteOrder(productId, transactionID, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.UNCOMPLETEORDER,
product_id = productId,
transaction_id = transactionID,
orderId = orderId
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 本地找不到信息,尝试向服务器请求补单(IOS专用)
function BIReport:postPayTryReissueOrder(productId, orderId)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.TRY_REISSUE_ORDER,
product_id = productId,
order_id = orderId,
platform = VersionCompatible:getPayPlatform(),
-- streamer = PayManager:getPayStreamer()
}
self:report(EVENT_NAME_PAY_OPT, args)
end
-- 获得购买物品
function BIReport:postPayGet(giftType, id, rechargrId, payDouble, orderId, originOrderId, buyNum, rewards, isFromBattle, isDaiJinJuan, purchaseType)
-- Commodity_ID 商品ID 获得支付回调发放购买物品时 String 商品ID
-- GiftType 礼包类型 String Gife表内的ICON名称
-- BuyNum 购买次数 Int 购买物品次数
-- CommodityItem 奖励物品 String 获得奖类型|数量
-- Dill_ID 返回物品订单号 String 返回货品订单号
-- MaxChapter 最大章节 Int 已解锁的最大章节
-- Commodity_State 商品状态 String Normal=正常Doubled=奖励翻倍
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
payDouble = payDouble or BIReport.PAY_DOUBLE.NORMAL
local itemStr = GFunc.getRewardsStr(rewards)
local args = {
opt_type = BIReport.PAY_OPT_TYPE.REWARD,
gift_type = giftType,
commodity_id = id,
commodity_state = payDouble,
commodity_item = itemStr,
buy_count = buyNum,
uuid_string = orderId,
origin_order_id_new = tostring(originOrderId),
recharge_id = rechargrId,
from_battle = isFromBattle,
dai_jin_juan_pay = isDaiJinJuan,
purchase_type = purchaseType,
platform = VersionCompatible:getPayPlatform(),
}
if GFunc.isShenhe() then
args.opt_type = BIReport.PAY_OPT_TYPE.APPLE_REVIEW_REWARD
elseif GFunc.isInWhitelist() then
args.opt_type = BIReport.PAY_OPT_TYPE.WHITELIST_REWARD
end
self:report(EVENT_NAME_PAY_OPT, args)
if EDITOR_MODE then
if not giftType or not id or not rechargrId then
local params = {
content = "BI Report postPayGet has no basic params",
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
Logger.log("BI Report postPayGet has no basic params")
end
end
end
-- 重复订单
function BIReport:postRepeatPayOrder(productId, originOrderId, orderId, isFromBattle)
local args = {
product_id = productId,
origin_order_id = tostring(originOrderId),
order_id = orderId,
from_battle = isFromBattle
}
self:report(EVENT_NAME_PAY_ORDER_REPEAT, args)
end
function BIReport:postPayUIShow(giftType, giftId)
local args = {
gift_type = giftType,
commodity_id = giftId,
}
self:report(EVENT_NAME_PAY_UI_SHOW, args)
end
-- 登录成功
function BIReport:postAccountLoginFinish(loginType)
local args = {
login_type = loginType,
event_type = BIReport.ACCOUNT_OPT_TYPE.LOGIN_SUCCESS,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
-- 登录失败
function BIReport:postAccountLoginFailed(loginType, reason)
local args = {
login_type = loginType,
login_failed_desc = reason,
event_type = BIReport.ACCOUNT_OPT_TYPE.LOGIN_FAILED,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
-- 上报ping服务器地址情况
function BIReport:postPingServer(address, time, resultType)
local args = {
address = address,
time = time,
type = resultType
}
self:report(EVENT_NAME_PING_SERVER, args)
end
-- 钻石增加
function BIReport:postGemGet(num, getType, itemId)
-- CoinNum 代币数量 增加代币时 Int 获得代币数量
-- Type 获得类型 String 广告=Ads、商店宝箱=Box、关卡宝箱=LevelBox、关卡奖励=LevelReward、
-- CoinsType 代币类型 String Gold=金币、Gems=钻石
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
-- MaxChapter 最大章节 Int 已解锁的最大章节
local args = {
type = getType,
coin_num = num,
coin_type = BIReport.COIN_TYPE[itemId],
coin_all = DataManager.BagData.ItemData:getItemNumById(itemId),
}
self:report(EVENT_NAME_COIN_GET, args)
end
-- 钻石使用
function BIReport:postGemUse(num, getType, itemId)
-- CoinNum 代币数量 减少代币时 Int 使用代币数量
-- Type 使用类型 String Box=开启宝箱、复活=Revive、天赋升级=Talent、Equip=装备升级
-- CoinsType 代币类型 String Gold=金币、Gems=钻石
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
-- MaxChapter 最大章节 Int 已解锁的最大章节
local args = {
type = getType,
coin_num = num,
coin_type = BIReport.COIN_TYPE[itemId],
coin_all = DataManager.BagData.ItemData:getItemNumById(itemId),
}
self:report(EVENT_NAME_COIN_USE, args)
end
function BIReport:postDailyTaskFinish(taskType, cfgId, taskId, refresh)
local args = {
task_type = taskType,
task_id = taskId,
cfg_id = cfgId,
task_refresh = refresh,
event_type = BIReport.TASK_OPT_TYPE.FINISH,
}
self:report(EVENT_NAME_DAILY_TASK, args)
end
function BIReport:postTaskAchievementOpt(id, stage, rewards)
local args = {
opt_type = BIReport.TASK_OPT.ACHIEVEMENT_REWARD,
achievement_id = id,
achievement_stage = stage,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
}
self:report(EVENT_NAME_DAILY_TASK, args)
end
-- 邮箱
function BIReport:postMailOpen(mailId)
-- IsNew 是否是新用户
-- MaxLevel 最大关卡
-- Email_ID 邮件编号
local args = {
mail_id = mailId,
event_type = BIReport.MAIL_OPT_TYPE.OPEN,
}
self:report(EVENT_NAME_MAIL_OPT, args)
end
function BIReport:postMailClaim(mailId)
-- IsNew 是否是新用户
-- MaxLevel 最大关卡
-- Email_ID 邮件编号
local args = {
mail_id = mailId,
event_type = BIReport.MAIL_OPT_TYPE.CLAIM,
}
self:report(EVENT_NAME_MAIL_OPT, args)
end
function BIReport:postMailClick(mailId)
-- Email_ID 邮件编号
local args = {
mail_id = mailId,
event_type = BIReport.MAIL_OPT_TYPE.CLICK,
}
self:report(EVENT_NAME_MAIL_OPT, args)
end
function BIReport:postAccountDelete(loginType)
local args = {
login_type = loginType,
event_type = BIReport.ACCOUNT_OPT_TYPE.DELETE,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
function BIReport:postAccountBindClick(loginType)
local args = {
login_type = loginType,
event_type = BIReport.ACCOUNT_OPT_TYPE.CLICK_BIND,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
function BIReport:postAccountBindFinish(loginType, success)
local args = {
login_type = loginType,
event_type = success and BIReport.ACCOUNT_OPT_TYPE.BIND_SUCCESS or BIReport.ACCOUNT_OPT_TYPE.BIND_FAILED,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
function BIReport:postAccountChangeClick(loginType)
local args = {
login_type = loginType,
event_type = BIReport.ACCOUNT_OPT_TYPE.CLICK_CHANGE_ACCOUNT,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
function BIReport:postAccountChangeFinish(loginType, success)
local args = {
login_type = loginType,
event_type = success and BIReport.ACCOUNT_OPT_TYPE.CHANGE_ACCOUNT_SUCCESS or BIReport.ACCOUNT_OPT_TYPE.CHANGE_ACCOUNT_FAILED,
}
self:report(EVENT_NAME_ACCOUNT_OPT, args)
end
function BIReport:postHeroOpt(heroId, optType)
local heroEntity = DataManager.HeroData:getHeroById(heroId)
if not heroEntity then
return
end
local args = {
hero_id = heroId,
level = heroEntity:getLv(),
event_type = optType
}
args.formation = DataManager.FormationData:getStageFormationBIStr()
self:report(EVENT_NAME_HERO_OPT, args)
end
function BIReport:postPlayerLvUp(fromLevel, toLevel)
local args = {
player_level_from = fromLevel,
player_level = toLevel,
}
self:report(EVENT_NAME_PLAYER_LV_UP, args)
end
function BIReport:postBountyLevelUp(bountyType, level, exp, season)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.BOUNTY_LEVEL_UP,
season = season,
level = level,
exp = exp,
bounty_type = bountyType,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postBountyReward(bountyType, level, exp, season, rewardLevelId, isPro)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.BOUNTY_REWARD,
season = season,
level = level,
exp = exp,
bounty_type = bountyType,
bounty_level_id = rewardLevelId,
is_pro = isPro,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postArenaBountyLevelUp(bountyType, level, exp, season)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.ARENA_BOUNTY_LEVEL_UP,
season = season,
level = level,
exp = exp,
bounty_type = bountyType,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postArenaBountyReward(bountyType, level, exp, season, rewardLevelId, isPro)
local args = {
event_type = BIReport.BOUNTY_OPT_TYPE.ARENA_BOUNTY_REWARD,
season = season,
level = level,
exp = exp,
bounty_type = bountyType,
bounty_level_id = rewardLevelId,
is_pro = isPro,
}
self:report(EVENT_NAME_BOUNTY_OPT, args)
end
function BIReport:postNetWorkOpt(optType, uiName, errorCode, disconnectTime)
local args = {
event_type = optType,
ui_name = uiName,
error_code = errorCode,
disconnect_time = disconnectTime
}
self:report(EVENT_NAME_NETWORK_OPT, args)
end
function BIReport:postAppLovinAdRevenue(msg)
local args = json.decode(msg) or {}
if args.revenue then
self:postAdjustAdRevenueAppLovinMAX(args.revenue, args.network_name or GConst.EMPTY_STRING, args.ad_unit_identifier or GConst.EMPTY_STRING, args.placement or GConst.EMPTY_STRING)
local args2 = {
ad_platform = "applovin",
ad_source = args.network_name,
ad_unit_name = args.ad_unit_identifier,
ad_format = args.ad_format,
currency = "USD",
value = args.revenue,
}
self:postFirebaseLog("ad_impression", args2)
self:logAppsFlyerAdRevenue(3, args.network_name, args.revenue, args)
-- 最后上报数数因为数数会给args里面增加一些字段
self:report(EVENT_NAME_APPLOVIN_AD_REVENUE, args)
end
end
function BIReport:postIronSourceAdRevenue(msg)
local args = json.decode(msg) or {}
if args.revenue then
local args2 = {
ad_platform = "ironSource",
ad_source = args.network_name,
ad_unit_name = args.ad_unit_identifier,
ad_format = args.ad_format,
currency = "USD",
value = args.revenue
}
self:postFirebaseLog("ad_impression", args2)
self:logAppsFlyerAdRevenue(2, args.network_name, args.revenue, args)
-- 最后上报数数因为数数会给args里面增加一些字段
self:report(EVENT_NAME_IRONSOURCE_AD_REVENUE, args)
end
end
-- 竞技场进入消耗上报
function BIReport:postArenaConsume(gradingId, todayConsume)
local args = {
event_type = BIReport.ARENA_OPT_TYPE.CONSUME,
grading_id = gradingId,
today_consume = todayConsume,
}
self:report(EVENT_NAME_ARENA_OPT, args)
end
-- 竞技场结算数据上报
function BIReport:postArenaSettlement(gradingId, round, winRate, win)
local args = {
event_type = BIReport.ARENA_OPT_TYPE.SETTLEMENT,
grading_id = gradingId,
round = round,
win_rate = winRate,
win = win,
}
self:report(EVENT_NAME_ARENA_OPT, args)
end
function BIReport:postDailyChallengeTaskState(completedCount, taskInfo)
local args = {
event_type = BIReport.DIALY_CHALLENGE_OPT_TYPE.TASK_STATE,
task_completed_count = completedCount,
task_info = json.encode(taskInfo)
}
self:report(EVENT_NAME_DAILY_CHALLENGE_OPT, args)
end
function BIReport:postNetError(pbName, code, reqData, pbData)
local msg = GConst.EMPTY_STRING
if pbData then
msg = json.encode(pbData)
if msg and #msg > 2000 then
msg = string.sub(msg, 1, 2000)
end
end
local args = {
event_type = BIReport.NETWORK_OPT_TYPE.ERROR_CODE,
pb_name = pbName,
ui_name = UIManager:getTopUIIndex(),
error_code = code,
req_data = reqData,
msg = msg,
}
self:report(EVENT_NAME_NETWORK_OPT, args)
end
function BIReport:postPbDecodefailed(pbName, reqData)
local args = {
event_type = BIReport.NETWORK_OPT_TYPE.PD_DECODE_FAILED,
pb_name = pbName,
ui_name = UIManager:getTopUIIndex(),
req_data = reqData
}
self:report(EVENT_NAME_NETWORK_OPT, args)
end
function BIReport:postPbAuthfailed(pbName, lastLoginInfo, authFailToLogin)
local args = {
event_type = BIReport.NETWORK_OPT_TYPE.AUTH_FAILED,
pb_name = pbName,
ui_name = UIManager:getTopUIIndex(),
lastLoginInfo = lastLoginInfo,
authFailToLogin = authFailToLogin
}
self:report(EVENT_NAME_NETWORK_OPT, args)
end
function BIReport:postRateClose(rateStar)
local args = {
event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_CLOSE,
rate_star = rateStar,
}
self:report(EVENT_NAME_MISCELLANEOUS_OPT, args)
end
function BIReport:postRateOpen()
local args = {
event_type = BIReport.MISCELLANEOUS_OPT_TYPE.EVALUATE_OPEN,
}
self:report(EVENT_NAME_MISCELLANEOUS_OPT, args)
end
function BIReport:postBatttleSnapshotOpen()
local args = {
event_type = BIReport.MISCELLANEOUS_OPT_TYPE.BATTLE_SNAP_SHOP_OPEN,
}
self:report(EVENT_NAME_MISCELLANEOUS_OPT, args)
end
function BIReport:postPbAuthfailed(pbName, lastLoginInfo, authFailToLogin)
local args = {
event_type = BIReport.NETWORK_OPT_TYPE.AUTH_FAILED,
pb_name = pbName,
ui_name = UIManager:getTopUIIndex(),
lastLoginInfo = lastLoginInfo,
authFailToLogin = authFailToLogin
}
self:report(EVENT_NAME_NETWORK_OPT, args)
end
function BIReport:postBoxOpen(id, boxType, openType, box_level, rewards, box_count)
local args = {
box_type = boxType,
open_type = openType,
box_item_id = id,
box_level = box_level,
box_count = box_count,
rewards_str = GFunc.getItemRewardsStr(rewards)
}
self:report(EVENT_BOX_OPEN, args)
end
function BIReport:postActOpt(event_type, actId, level, exp, buyLevelCost)
local args = {
event_type = event_type,
act_id = actId,
cur_level = level,
cur_exp = exp,
buy_level_cost = buyLevelCost,
}
self:report(EVENT_ACT_OPT, args)
end
function BIReport:postRunes(event_type, runes)
local args = {
event_type = event_type,
runes = runes
}
self:report(EVENT_NAME_RUNES, args)
end
-- 视频广告相关
function BIReport:postVideoAdOpt(optType, adName, result)
if optType == nil or adName == nil then
Logger.logFatal("视频广告上报为空 optType:" .. tostring(optType) .. " adName:" .. tostring(adName))
end
local args = {
opt_type = optType,
ad_name = adName,
}
self:report(EVENT_NAME_VIDEO_AD_OPT, args)
end
return BIReport