From 4c80f6ee3d621da9580518b22dc79f7c78b4747e Mon Sep 17 00:00:00 2001 From: chenxi Date: Wed, 21 Jun 2023 11:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E5=92=8C=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 9 ++++++++- lua/app/first/first.lua | 3 +++ lua/app/global/global_func.lua | 4 ++++ lua/app/ui/game_setting/game_setting_ui.lua | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index be24bb79..3c71f1a9 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -24,6 +24,7 @@ BIReport.PAY_OPT_TYPE = { BUY = "Buy", REWARD = "Reward", APPLE_REVIEW_REWARD = "AppleReviewReward", + WHITELIST_REWARD = "WhitelistReward", CANCEL = "Cancel", FAILED = "Failed", INIT_SUC = "InitSuc", @@ -343,7 +344,11 @@ function BIReport:postPurchase(price, content, originOrderId, orderId) return end -- 审核模式不上报 - if CS.BF.BFMain.IsShenhe then + if GFunc.isShenhe() then + return + end + -- 白名单模式也不上报 + if GFunc.isInWhitelist() then return end -- 上报AF,AF的所有事件值都是String类型 @@ -738,6 +743,8 @@ function BIReport:postPayGet(giftType, id, rechargeId, orderId, originOrderId, b } if GFunc.isShenhe() then args.event_type = BIReport.PAY_OPT_TYPE.APPLE_REVIEW_REWARD + elseif GFunc.isInWhitelist() then + args.event_type = BIReport.PAY_OPT_TYPE.WHITELIST_REWARD end self:report(EVENT_NAME_PAY_OPT, args) diff --git a/lua/app/first/first.lua b/lua/app/first/first.lua index 2dccc3cf..b481f39e 100644 --- a/lua/app/first/first.lua +++ b/lua/app/first/first.lua @@ -384,6 +384,9 @@ function First:requestAddress(callback, times, totalTimes) if serverResult then responded = true CS.BF.BFMain.IsShenhe = (serverResult.env == "audit" and CS.UnityEngine.Application.platform == CS.UnityEngine.RuntimePlatform.IPhonePlayer) + if serverResult.env == "white" then + CS.BF.BFMain.IsWhite = true + end -- 如果已经成功过了 不作处理 if self.hasReceiveAddrSuccess then return diff --git a/lua/app/global/global_func.lua b/lua/app/global/global_func.lua index 263b1790..cd7018e3 100644 --- a/lua/app/global/global_func.lua +++ b/lua/app/global/global_func.lua @@ -1208,6 +1208,10 @@ function GFunc.isShenhe() return CS.BF.BFMain.IsShenhe end +function GFunc.isInWhitelist() + return CS.BF.BFMain.IsWhite +end + function GFunc.getArray() local array = {} setmetatable(array, {__jsontype = "array"}) diff --git a/lua/app/ui/game_setting/game_setting_ui.lua b/lua/app/ui/game_setting/game_setting_ui.lua index 405b7901..49e518a5 100644 --- a/lua/app/ui/game_setting/game_setting_ui.lua +++ b/lua/app/ui/game_setting/game_setting_ui.lua @@ -158,7 +158,7 @@ function GameSettingUI:_addListeners() AudioManager:setMusicVolume(0) end - if CS.BF.BFMain.IsWhite then + if GFunc.isInWhitelist() then self.clickMusicCount = self.clickMusicCount + 1 if self.clickMusicCount > CHECK_WHITE_LIST_COUNT then GFunc.showToast("Please don't frequently operate")