diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 4bd36c6c..ee65381f 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -240,53 +240,37 @@ function BIReport:clearAccountId() end function BIReport:report(name, args) - -- -- 内网dev包和编辑器模式不上报 - -- if Platform and Platform:getIsDevChannel() or EDITOR_MODE then - -- return - -- end - -- -- 审核模式不上报 - -- if CS.BF.BFMain.IsShenhe then - -- return - -- end - -- --@TODO 2023-02-22 17:15:51 开发期间不上报 - -- if args and type(args) == "table" then - -- -- Level_ID 关卡ID Int 事件发生时所处关卡ID - -- -- MaxLevel 最大关卡 Int 事件发生时已解锁的最大关卡 - -- -- IsNew 是否是新用户 Boolean 事件发生时用户是否为新用户 - -- -- gold 金币数 Int 事件发生后剩余金币数 - -- -- gem 钻石数 Int 事件发生后剩余钻石数 - -- -- Energy 体力数 Int 事件发生后剩余体力数 - -- -- ResourceVersion 热更资源版本 String 事件发生时资源更新版本 - -- -- WearEquip 当前装备 String 装备id:等级|装备id:等级|装备id:等级|装备id:等级|装备id:等级(按武器盔甲头盔的顺序) - -- -- WearCherish 当前传家宝 String 传家宝id:等级|传家宝id:等级|传家宝id:等级|传家宝id:等级|传家宝id:等级 - -- -- WearRunes 当前符文 String 符文id:等级|符文id:等级|符文id:等级|符文id:等级|符文id:等级 - -- -- UserGrade 用户等级 int 事件发生后用户等级 - -- -- Skill 当前精通能力 int 精通能力强化次数 - -- if DataManager and DataManager:getIsInitWithServer() then - -- if DataManager.ChapterData then - -- if not args.max_level then - -- args.max_level = DataManager.ChapterData:getHistoryChapterId() + 1 - -- end - -- if not args.level_id then - -- args.level_id = DataManager.ChapterData:getCurChapterId() + 1 - -- end - -- end - -- if DataManager.BagData and DataManager.BagData.ItemData then - -- local goldBigBNum = DataManager.BagData.ItemData:getItemBigNumById(GConst.ItemConst.ITEM_ID_GOLD) - -- args.gold_value = goldBigBNum.value - -- args.gold_unit = goldBigBNum.unit - - -- args.gem = DataManager.BagData.ItemData:getItemById(GConst.ItemConst.ITEM_ID_GEM) - -- end - -- end - -- args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion() - -- -- args.is_today_first = LocalData:getTodayFirst() - -- 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 + -- 内网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 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 + 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) + end + 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)) + self:printArgsStr(name, args) + else + CS.BF.BFMain.Instance.SDKMgr.BFThirdReportSDKMgr:PostThinkingAnalyticsEvent(name) + end end -- 上报引导每一步 @@ -338,7 +322,6 @@ function BIReport:postOpenUI(uiName, childUI) client_ui_child_name = childUI, } self:report(EVENT_NAME_OPEN_UI, args) - BIReport:printArgsStr(EVENT_NAME_OPEN_UI, args) end -- 上报内购事件,单独处理,只上报到AF和FB,不上报数数 @@ -521,12 +504,13 @@ end -- 以下为数数 function BIReport:printArgsStr(eventName, args) - if EDITOR_MODE then - local tab = clone(args) - tab.eventName = eventName - Logger.log("============report %s===========", eventName) - Logger.printTable(tab or {}) + if not EDITOR_MODE then + return end + local tab = clone(args) + tab.eventName = eventName + Logger.log("============report %s===========", eventName) + Logger.printTable(tab or {}) end -- 开启游戏 @@ -535,7 +519,6 @@ function BIReport:postGameLogin(isFirstLogin) first_begin = isFirstLogin, } self:report(EVENT_NAME_LOGIN, args) - BIReport:printArgsStr(EVENT_NAME_LOGIN, args) end -- 登录完成 @@ -584,7 +567,6 @@ function BIReport:postGameLoginFinish() args.my_dungeon = args.my_dungeon .. "|5:" .. info end self:report(EVENT_NAME_LOGIN_FINISH, args) - BIReport:printArgsStr(EVENT_NAME_LOGIN_FINISH, args) end -- 游戏退出 @@ -595,7 +577,6 @@ function BIReport:postGameExit() -- args.duration = nowTime - DataManager:getLoginTime() -- end self:report(EVENT_NAME_EXIT, args) - BIReport:printArgsStr(EVENT_NAME_EXIT, args) end -- 进入战斗 @@ -613,7 +594,6 @@ function BIReport:postFightBegin(battleType, currLevelId, maxLevelId) event_type = BIReport.FIGHT_TYPE.START, } self:report(EVENT_NAME_FIGHT, args) - BIReport:printArgsStr(EVENT_NAME_FIGHT, args) end function BIReport:postFightEnd(battleType, currLevelId, maxLevelId, passType) @@ -631,7 +611,6 @@ function BIReport:postFightEnd(battleType, currLevelId, maxLevelId, passType) event_type = BIReport.FIGHT_TYPE.END, } self:report(EVENT_NAME_FIGHT, args) - BIReport:printArgsStr(EVENT_NAME_FIGHT, args) end function BIReport:postDungeonFightBegin(battleType, currLevelId, maxLevelId) @@ -648,7 +627,6 @@ function BIReport:postDungeonFightBegin(battleType, currLevelId, maxLevelId) event_type = BIReport.FIGHT_TYPE.START, } self:report(EVENT_NAME_FIGHT, args) - BIReport:printArgsStr(EVENT_NAME_FIGHT, args) end function BIReport:postDungeonFightEnd(battleType, currLevelId, maxLevelId, passType) @@ -666,7 +644,6 @@ function BIReport:postDungeonFightEnd(battleType, currLevelId, maxLevelId, passT event_type = BIReport.FIGHT_TYPE.END, } self:report(EVENT_NAME_FIGHT, args) - BIReport:printArgsStr(EVENT_NAME_FIGHT, args) end -- 首页按钮点击 @@ -675,7 +652,6 @@ function BIReport:postBtnCilck(clickType) event_type = clickType, } self:report(EVENT_NAME_CLICK_BTN, args) - BIReport:printArgsStr(EVENT_NAME_CLICK_BTN, args) end -- 道具获取 @@ -696,7 +672,6 @@ function BIReport:postItemGet(bigNum, itemId, getType) type = getType, } self:report(EVENT_NAME_ITEM_GET, args) - BIReport:printArgsStr(EVENT_NAME_ITEM_GET, args) end -- 道具使用 @@ -717,7 +692,6 @@ function BIReport:postItemUse(bigNum, itemId, getType) type = getType, } self:report(EVENT_NAME_ITEM_USE, args) - BIReport:printArgsStr(EVENT_NAME_ITEM_USE, args) end -- 钻石增加 @@ -741,7 +715,6 @@ function BIReport:postGemGet(bigNum, getType, itemId) args.coin_unit = bigNum.unit end self:report(EVENT_NAME_COIN_GET, args) - BIReport:printArgsStr(EVENT_NAME_COIN_GET, args) end -- 钻石使用 @@ -759,7 +732,6 @@ function BIReport:postGemUse(num, getType, itemId) -- max_chapter = DataManager.StageData:getNewChapterId(), } self:report(EVENT_NAME_COIN_USE, args) - BIReport:printArgsStr(EVENT_NAME_COIN_USE, args) end -- 点击广告按钮 @@ -769,7 +741,6 @@ function BIReport:postAdClick(adsType) event_type = BIReport.ADS_OPT_TYPE.CLICK, } self:report(EVENT_NAME_AD_OPT, args) - BIReport:printArgsStr(EVENT_NAME_AD_OPT, args) end -- 广告播放视频成功 @@ -779,7 +750,6 @@ function BIReport:postAdPlaySuccess(adsType) event_type = BIReport.ADS_OPT_TYPE.SUC, } self:report(EVENT_NAME_AD_OPT, args) - BIReport:printArgsStr(EVENT_NAME_AD_OPT, args) end -- 广告奖励发放成功 @@ -789,7 +759,6 @@ function BIReport:postAdRewardGet(adsType) event_type = BIReport.ADS_OPT_TYPE.RETURN, } self:report(EVENT_NAME_AD_OPT, args) - BIReport:printArgsStr(EVENT_NAME_AD_OPT, args) end -- 支付sdk初始化成功 @@ -798,7 +767,6 @@ function BIReport:postPayInitSuccess() event_type = BIReport.PAY_OPT_TYPE.INIT_SUC, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- 支付sdk初始化失败 @@ -808,7 +776,6 @@ function BIReport:postPayInitFailed(failedDesc) event_type = BIReport.PAY_OPT_TYPE.INIT_FAILED, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- 点击商品购买按钮 @@ -821,7 +788,6 @@ function BIReport:postPayClick(giftType, id, rechargeId) event_type = BIReport.PAY_OPT_TYPE.CLICK, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- 跳转购买界面 @@ -834,7 +800,6 @@ function BIReport:postPayTurn(giftType, id, rechargeId) event_type = BIReport.PAY_OPT_TYPE.BUY, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- 取消购买 @@ -847,7 +812,6 @@ function BIReport:postPayCancel(productId, orderId, rechargeId, giftType) event_type = BIReport.PAY_OPT_TYPE.CANCEL, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- 购买失败 @@ -861,7 +825,6 @@ function BIReport:postPayFailed(productId, orderId, rechargeId, failedType, gift event_type = BIReport.PAY_OPT_TYPE.FAILED, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) end -- -- 获得购买物品 @@ -878,7 +841,6 @@ function BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, b event_type = BIReport.PAY_OPT_TYPE.REWARD, } self:report(EVENT_NAME_PAY_OPT, args) - BIReport:printArgsStr(EVENT_NAME_PAY_OPT, args) if EDITOR_MODE then if not giftType or not id or not rechargeId then @@ -907,7 +869,6 @@ function BIReport:postEquipWear(equipPart, equipLv, equipId) event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_WEAR, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end -- 装备升级 @@ -925,7 +886,6 @@ function BIReport:postEquipUp(equipPart, equipLv, equipId) event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_LV_UP, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end function BIReport:postEquipGet(equipId, getType) @@ -940,7 +900,6 @@ function BIReport:postEquipGet(equipId, getType) event_type = BIReport.EQUIP_OPT_TYPE.EQUIP_GET, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end function BIReport:postLegacyWear(equipPart, equipLv, equipId) @@ -956,7 +915,6 @@ function BIReport:postLegacyWear(equipPart, equipLv, equipId) event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_WEAR, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end -- 装备升级 @@ -974,7 +932,6 @@ function BIReport:postLegacyUp(equipPart, equipLv, equipId) event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_LV_UP, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end function BIReport:postLegacyGet(equipId, getType) @@ -989,7 +946,6 @@ function BIReport:postLegacyGet(equipId, getType) event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_GET, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end function BIReport:postLegacyRemove(equipPart, equipId) @@ -1004,7 +960,6 @@ function BIReport:postLegacyRemove(equipPart, equipId) event_type = BIReport.EQUIP_OPT_TYPE.LEGACY_REMOVE, } self:report(EVENT_NAME_EQUIP_OPT, args) - BIReport:printArgsStr(EVENT_NAME_EQUIP_OPT, args) end function BIReport:postDataException(itemId, count, getType) @@ -1023,7 +978,6 @@ function BIReport:postBattlePassOpen() event_type = BIReport.BATTLE_PASS_OPT_TYPE.OPEN, } self:report(EVENT_NAME_BATTLE_PASS_OPT, args) - BIReport:printArgsStr(EVENT_NAME_BATTLE_PASS_OPT, args) end function BIReport:postBattlePassTaskClaim(id, lv, progress) @@ -1034,7 +988,6 @@ function BIReport:postBattlePassTaskClaim(id, lv, progress) event_type = BIReport.BATTLE_PASS_OPT_TYPE.TASK_CLAIM, } self:report(EVENT_NAME_BATTLE_PASS_OPT, args) - BIReport:printArgsStr(EVENT_NAME_BATTLE_PASS_OPT, args) end function BIReport:postBattlePassRewardClaim(lv, highLv) @@ -1044,7 +997,6 @@ function BIReport:postBattlePassRewardClaim(lv, highLv) event_type = BIReport.BATTLE_PASS_OPT_TYPE.REWARD_CLAIM, } self:report(EVENT_NAME_BATTLE_PASS_OPT, args) - BIReport:printArgsStr(EVENT_NAME_BATTLE_PASS_OPT, args) end function BIReport:postBattlePassExpGet(getExp, lv, exp) @@ -1055,7 +1007,6 @@ function BIReport:postBattlePassExpGet(getExp, lv, exp) event_type = BIReport.BATTLE_PASS_OPT_TYPE.EXP_GET, } self:report(EVENT_NAME_BATTLE_PASS_OPT, args) - BIReport:printArgsStr(EVENT_NAME_BATTLE_PASS_OPT, args) end -- 登录成功 @@ -1065,7 +1016,6 @@ function BIReport:postAccountLoginFinish(loginType) event_type = BIReport.ACCOUNT_OPT_TYPE.LOGIN_FINISH, } self:report(EVENT_NAME_ACCOUNT_OPT, args) - BIReport:printArgsStr(EVENT_NAME_ACCOUNT_OPT, args) end -- 登录失败 @@ -1076,7 +1026,6 @@ function BIReport:postAccountLoginFailed(loginType, reason) event_type = BIReport.ACCOUNT_OPT_TYPE.LOGIN_FAILED, } self:report(EVENT_NAME_ACCOUNT_OPT, args) - BIReport:printArgsStr(EVENT_NAME_ACCOUNT_OPT, args) end -- 点击绑定 @@ -1086,7 +1035,6 @@ function BIReport:postAccountBindClick(loginType) event_type = BIReport.ACCOUNT_OPT_TYPE.BIND_CLICK, } self:report(EVENT_NAME_ACCOUNT_OPT, args) - BIReport:printArgsStr(EVENT_NAME_ACCOUNT_OPT, args) end -- 绑定成功 @@ -1096,7 +1044,6 @@ function BIReport:postAccountBindFinish(loginType) event_type = BIReport.ACCOUNT_OPT_TYPE.BIND_FINISH, } self:report(EVENT_NAME_ACCOUNT_OPT, args) - BIReport:printArgsStr(EVENT_NAME_ACCOUNT_OPT, args) end -- -- 切换账号 @@ -1105,7 +1052,6 @@ end -- loginType = loginType, -- } -- self:report(EVENT_NAME_ACCOUNT_CHANGE, args) --- BIReport:printArgsStr(EVENT_NAME_ACCOUNT_CHANGE, args) -- end -- -- 删除账号 @@ -1114,7 +1060,6 @@ end -- loginType = loginType, -- } -- self:report(EVENT_NAME_ACCOUNT_DELETE, args) --- BIReport:printArgsStr(EVENT_NAME_ACCOUNT_DELETE, args) -- end -- 上报ping服务器地址情况 @@ -1125,7 +1070,6 @@ function BIReport:postPingServer(address, time, resultType) type = resultType } self:report(EVENT_NAME_PING_SERVER, args) - BIReport:printArgsStr(EVENT_NAME_PING_SERVER, args) end -- -- CDKey兑换结果 @@ -1136,7 +1080,6 @@ end -- code = code -- } -- self:report(CDKEY_EXCHANGE_RESULT, args) --- BIReport:printArgsStr(CDKEY_EXCHANGE_RESULT, args) -- end -- -- 网络异常 @@ -1148,7 +1091,6 @@ end -- failed_time = failedTime -- } -- self:report(EVENT_NAME_NET_FAIL, args) --- BIReport:printArgsStr(EVENT_NAME_NET_FAIL, args) -- end -- -- 通信成功 @@ -1160,7 +1102,6 @@ end -- code = code -- } -- self:report(EVENT_NAME_NET_SUCCESS, args) --- BIReport:printArgsStr(EVENT_NAME_NET_SUCCESS, args) -- end -- -- 重复订单 @@ -1171,7 +1112,6 @@ end -- order_id = orderId -- } -- self:report(EVENT_NAME_PAY_ORDER_REPEAT, args) --- BIReport:printArgsStr(EVENT_NAME_PAY_ORDER_REPEAT, args) -- end -- 召唤 @@ -1185,7 +1125,6 @@ function BIReport:postSummonSuc(summonType, diamondType) type = summonType, } self:report(EVENT_NAME_SUMMON, args) - BIReport:printArgsStr(EVENT_NAME_SUMMON, args) end -- 任务 @@ -1202,7 +1141,6 @@ function BIReport:postTaskFinish(taskType, taskId) event_type = BIReport.TASK_OPT_TYPE.FINISH, } self:report(EVENT_NAME_TASK_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TASK_OPT, args) end function BIReport:postTaskReward(taskType, taskId) @@ -1218,7 +1156,6 @@ function BIReport:postTaskReward(taskType, taskId) event_type = BIReport.TASK_OPT_TYPE.REWARD, } self:report(EVENT_NAME_TASK_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TASK_OPT, args) end -- 邮箱 @@ -1232,7 +1169,6 @@ function BIReport:postMailOpen(mailId) event_type = BIReport.MAIL_OPT_TYPE.OPEN, } self:report(EVENT_NAME_MAIL_OPT, args) - BIReport:printArgsStr(EVENT_NAME_MAIL_OPT, args) end function BIReport:postMailClaim(mailId) @@ -1245,7 +1181,6 @@ function BIReport:postMailClaim(mailId) event_type = BIReport.MAIL_OPT_TYPE.CLAIM, } self:report(EVENT_NAME_MAIL_OPT, args) - BIReport:printArgsStr(EVENT_NAME_MAIL_OPT, args) end -- 修炼 @@ -1261,7 +1196,6 @@ function BIReport:postTrainFinish(trainType, trainLv) event_type = BIReport.TRAIN_OPT_TYPE.TRAIN, } self:report(EVENT_NAME_TRAIN_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TRAIN_OPT, args) end function BIReport:postTrainReborn() @@ -1269,7 +1203,6 @@ function BIReport:postTrainReborn() event_type = BIReport.TRAIN_OPT_TYPE.REBORN, } self:report(EVENT_NAME_TRAIN_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TRAIN_OPT, args) end function BIReport:postTrainQuickPass() @@ -1277,7 +1210,6 @@ function BIReport:postTrainQuickPass() event_type = BIReport.TRAIN_OPT_TYPE.QUICK_PASS, } self:report(EVENT_NAME_TRAIN_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TRAIN_OPT, args) end function BIReport:postTrainQuickPassUp(level) @@ -1286,7 +1218,6 @@ function BIReport:postTrainQuickPassUp(level) event_type = BIReport.TRAIN_OPT_TYPE.QUICK_PASS, } self:report(EVENT_NAME_TRAIN_OPT, args) - BIReport:printArgsStr(EVENT_NAME_TRAIN_OPT, args) end -- function BIReport:postChapterPass(oldId, chapterId, passType) @@ -1298,7 +1229,6 @@ end -- } -- self:report(EVENT_NAME_CHAPTER_OPT, args) --- BIReport:printArgsStr(EVENT_NAME_CHAPTER_OPT, args) -- end -- 符文 @@ -1309,7 +1239,6 @@ function BIReport:postRuneGet(runeId) } self:report(EVENT_NAME_RUNE_OPT, args) - BIReport:printArgsStr(EVENT_NAME_RUNE_OPT, args) end function BIReport:postRuneUp(runeId, runeLv) @@ -1320,7 +1249,6 @@ function BIReport:postRuneUp(runeId, runeLv) } self:report(EVENT_NAME_RUNE_OPT, args) - BIReport:printArgsStr(EVENT_NAME_RUNE_OPT, args) end function BIReport:postRuneWear(runeId, runeLv) @@ -1329,9 +1257,7 @@ function BIReport:postRuneWear(runeId, runeLv) equip_lv = runeLv, event_type = BIReport.RUNE_OPT_TYPE.WEAR, } - self:report(EVENT_NAME_RUNE_OPT, args) - BIReport:printArgsStr(EVENT_NAME_RUNE_OPT, args) end return BIReport \ No newline at end of file