From 44356ebb528e5556e99e74a884ea79d11c328bbd Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 19 Sep 2023 10:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=88=98=E6=96=97=E5=89=8D?= =?UTF-8?q?=E5=90=8E=E4=B8=8A=E9=98=B5=E8=8B=B1=E9=9B=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=96=B9=E4=BE=BF=E6=9F=A5=E8=AF=A2=E4=BD=9C=E5=BC=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 48 +++++++++++++++++++ lua/app/module/battle/battle_manager.lua | 2 + .../controller/battle_controller_act_pvp.lua | 1 + .../controller/battle_controller_arena.lua | 1 + .../battle_controller_boss_rush.lua | 1 + .../battle_controller_daily_challenge.lua | 1 + .../battle_controller_dungeon_armor.lua | 1 + .../battle_controller_dungeon_gold.lua | 1 + .../battle_controller_dungeon_rune.lua | 1 + .../battle_controller_dungeon_shards.lua | 1 + .../battle_controller_dungeon_weapon.lua | 1 + .../battle_controller_full_moon_skin.lua | 1 + .../controller/battle_controller_stage.lua | 1 + lua/app/ui/battle/battle_rune_result_ui.lua | 2 +- 14 files changed, 62 insertions(+), 1 deletion(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 1b723e30..9b0a35ba 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -200,6 +200,8 @@ BIReport.FIGHT_OPT_TYPE = { END = "End", SELECT_SKILL_OPEN = "SelectSkillOpen", SELECT_SKILL = "SelectSkill", + HERO_INFO = "HeroInfo", + HERO_REPORT = "HeroReport", } BIReport.FIGHT_DEATH_TYPE = { @@ -1117,6 +1119,52 @@ function BIReport:postFightSkillSelect(battleType, battleData, skillList, chapte 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 = { diff --git a/lua/app/module/battle/battle_manager.lua b/lua/app/module/battle/battle_manager.lua index 26349841..b029a9f8 100644 --- a/lua/app/module/battle/battle_manager.lua +++ b/lua/app/module/battle/battle_manager.lua @@ -145,6 +145,8 @@ function BattleManager:_play(battleType, params, snapshot) end end end + -- 上报英雄数据,方便检查是否作弊 + BIReport:postFightHeroInfo(battleType, params.atkFormation) local controllerPath = BATTLE_CONTROLLER[battleType] or BATTLE_CONTROLLER_BASE self.battleController = require(controllerPath):create() self.battleController:init(params, snapshot) diff --git a/lua/app/module/battle/controller/battle_controller_act_pvp.lua b/lua/app/module/battle/controller/battle_controller_act_pvp.lua index 0739ee27..7bfd01b0 100644 --- a/lua/app/module/battle/controller/battle_controller_act_pvp.lua +++ b/lua/app/module/battle/controller/battle_controller_act_pvp.lua @@ -103,6 +103,7 @@ function BattleControllerActpvp:controllBattleEnd() end self.combatReport.defReport = defReport local win = self.victory + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.ActPvpManager:reqFightEnd(win, self.combatReport, self.taskProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_arena.lua b/lua/app/module/battle/controller/battle_controller_arena.lua index 019c5be0..eaf4398f 100644 --- a/lua/app/module/battle/controller/battle_controller_arena.lua +++ b/lua/app/module/battle/controller/battle_controller_arena.lua @@ -80,6 +80,7 @@ function BattleControllerArena:controllBattleEnd() end self.combatReport.defReport = defReport local win = self.victory + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.ArenaManager:reqSettlement(win, self.combatReport, self.taskProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_boss_rush.lua b/lua/app/module/battle/controller/battle_controller_boss_rush.lua index e502c8d7..0ae4f0c3 100644 --- a/lua/app/module/battle/controller/battle_controller_boss_rush.lua +++ b/lua/app/module/battle/controller/battle_controller_boss_rush.lua @@ -181,6 +181,7 @@ function BattleControllerBossRush:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.ActBossRushManager:reqEndBattle(self.chapterId, self.combatReport, self.taskProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_daily_challenge.lua b/lua/app/module/battle/controller/battle_controller_daily_challenge.lua index d4272853..66d27258 100644 --- a/lua/app/module/battle/controller/battle_controller_daily_challenge.lua +++ b/lua/app/module/battle/controller/battle_controller_daily_challenge.lua @@ -108,6 +108,7 @@ function BattleControllerDailyChallenge:controllBattleEnd() self.combatReport.wave = self.combatReport.wave - 1 end local taskCurProgress = ModuleManager.DailyChallengeManager:getCurTaskProgress(self) + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DailyChallengeManager:endChallenge(self.chapterId, self.combatReport, self.taskProgress, heroInfo, taskCurProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_armor.lua b/lua/app/module/battle/controller/battle_controller_dungeon_armor.lua index fe122fad..de72b460 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_armor.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_armor.lua @@ -34,6 +34,7 @@ function BattleControllerDungeonArmor:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DungeonArmorManager:reqEndChallenge(self.chapterId, self.combatReport, self.taskProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_gold.lua b/lua/app/module/battle/controller/battle_controller_dungeon_gold.lua index 1c9a1e48..ca792b55 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_gold.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_gold.lua @@ -67,6 +67,7 @@ function BattleControllerDungeonGold:controllBattleEnd() self.combatReport.wave = self.combatReport.wave - 1 end local remainingHp = self.defTeam:getMainUnit().unitEntity:getHp() + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DungeonManager:reqEndChallengeGold(self.chapterId, self.combatReport, self.taskProgress, totalDamage, remainingHp) end diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua b/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua index 2c4e52b3..b8a5dcf6 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_rune.lua @@ -382,6 +382,7 @@ function BattleControllerDungeonRune:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DungeonRuneManager:reqFightSettlement(self.chapterId, self.combatReport, self.taskProgress, self.dungeonRuneRemainRoundCount) end diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_shards.lua b/lua/app/module/battle/controller/battle_controller_dungeon_shards.lua index 80bedbe5..4a5da296 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_shards.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_shards.lua @@ -35,6 +35,7 @@ function BattleControllerDungeonShards:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DungeonManager:reqEndChallengeShards(self.chapterId, self.combatReport, self.taskProgress, totalDamage) end diff --git a/lua/app/module/battle/controller/battle_controller_dungeon_weapon.lua b/lua/app/module/battle/controller/battle_controller_dungeon_weapon.lua index 9612880a..a2e5b875 100644 --- a/lua/app/module/battle/controller/battle_controller_dungeon_weapon.lua +++ b/lua/app/module/battle/controller/battle_controller_dungeon_weapon.lua @@ -34,6 +34,7 @@ function BattleControllerDungeonWeapon:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.DungeonWeaponManager:reqEndChallenge(self.chapterId, self.combatReport, self.taskProgress) end diff --git a/lua/app/module/battle/controller/battle_controller_full_moon_skin.lua b/lua/app/module/battle/controller/battle_controller_full_moon_skin.lua index ba960300..35864b71 100644 --- a/lua/app/module/battle/controller/battle_controller_full_moon_skin.lua +++ b/lua/app/module/battle/controller/battle_controller_full_moon_skin.lua @@ -30,6 +30,7 @@ function BattleControllerFullMoonSkin:controllBattleEnd() table.insert(atkReport, report) end self.combatReport.atkReport = atkReport + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.FullMoonManager:reqChapterSkinClaim(self.chapterId, self.combatReport) end diff --git a/lua/app/module/battle/controller/battle_controller_stage.lua b/lua/app/module/battle/controller/battle_controller_stage.lua index 017998bc..d89c04a8 100644 --- a/lua/app/module/battle/controller/battle_controller_stage.lua +++ b/lua/app/module/battle/controller/battle_controller_stage.lua @@ -74,6 +74,7 @@ function BattleControllerStage:controllBattleEnd() if not self.victory then self.combatReport.wave = self.combatReport.wave - 1 end + BIReport:postFightHeroReport(self.combatReport.battleType, atkReport) ModuleManager.ChapterManager:endFight(self.chapterId, self.combatReport, self.gotMysteryBoxIndexs, self.taskProgress) end diff --git a/lua/app/ui/battle/battle_rune_result_ui.lua b/lua/app/ui/battle/battle_rune_result_ui.lua index bc86d883..6d7a0422 100644 --- a/lua/app/ui/battle/battle_rune_result_ui.lua +++ b/lua/app/ui/battle/battle_rune_result_ui.lua @@ -229,7 +229,7 @@ function BattleRuneResultUI:refreshTaskNode() objs.descUnDone:setText(GConst.EMPTY_STRING) objs.check:setVisible(true) else - objs.descUnDone:setText(GConst.UNFINISHED) + objs.descUnDone:setText(I18N:getGlobalText(I18N.GlobalConst.UNFINISHED)) objs.check:setVisible(false) end else