From 2a62f2a94e63907f5be588f3a3bb763ea71c5d65 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 19 Sep 2023 15:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E7=BA=BF=E9=98=B5?= =?UTF-8?q?=E5=AE=B9=E7=AC=A6=E6=96=87=E6=95=B0=E6=8D=AE=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/common/bi_report.lua | 13 +++++++++++++ lua/app/common/data_manager.lua | 3 ++- lua/app/userdata/runes/runes_data.lua | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 13705124..c71f98de 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -331,6 +331,10 @@ BIReport.ACTIVITY_SUMMER = { BUY_LEVEL_UP = "BuyLevelUp", } +BIReport.RUNES_FORMATION = { + CHAPTER = "chapter", +} + -- b6 local EVENT_NAME_EXIT = "client_exit" local EVENT_NAME_FIGHT = "client_fight" @@ -362,6 +366,7 @@ 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" function BIReport:setIsNewPlayer(isNewPlayer) self.isNewPlayer = isNewPlayer @@ -1777,4 +1782,12 @@ function BIReport:postActOpt(event_type, actId, level, exp, 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 + return BIReport \ No newline at end of file diff --git a/lua/app/common/data_manager.lua b/lua/app/common/data_manager.lua index c1218cb8..ff1269f5 100644 --- a/lua/app/common/data_manager.lua +++ b/lua/app/common/data_manager.lua @@ -154,6 +154,8 @@ function DataManager:initWithServerData(data) self.DailyChallengeData:init(data.chapter_daily_challenge) self.DungeonData:initDungeonGold(data.chapter_gold_challenge) self.DungeonData:initDungeonShards(data.chapter_shards_challenge) + -- FormationData要在RunesData之前初始化,依赖阵容数据进行上报 + self.FormationData:init(data.fight_info) self.EquipData:init(data.heroes_equips) self.EquipData:initGifts(data.act_weapon_armor_gift) self.SkinData:init(data.bag.skins) @@ -161,7 +163,6 @@ function DataManager:initWithServerData(data) -- HeroData要在EquipData、SkinData、RunesData之后初始化,依赖它们的属性数据 self.HeroData:init(data.bag.heroes) self.BagData:init(data.bag) - self.FormationData:init(data.fight_info) self.DungeonData:initDungeonWeapon(data.chapter_weapon_challenge) self.DungeonData:initDungeonArmor(data.chapter_armor_challenge) self.CollectionData:init(data.collection) diff --git a/lua/app/userdata/runes/runes_data.lua b/lua/app/userdata/runes/runes_data.lua index f463cd5f..1a3744c7 100644 --- a/lua/app/userdata/runes/runes_data.lua +++ b/lua/app/userdata/runes/runes_data.lua @@ -22,6 +22,14 @@ function RunesData:init(data) for heroId, grids in pairs(data.heroes_grids) do self:addEquip(heroId, grids.grids) end + + -- 处理上报 + local formation = DataManager.FormationData:getStageFormation() + local runesChapter = {} + for elementType, heroId in pairs(formation) do + runesChapter[heroId] = data.heroes_grids[heroId] + end + BIReport:postRunes(BIReport.RUNES_FORMATION.CHAPTER, runesChapter) end -- 活动开启