增加上报属性

This commit is contained in:
xiekaidong 2023-08-07 10:35:11 +08:00
parent 792a5a1672
commit f74226c056
8 changed files with 58 additions and 3 deletions

View File

@ -134,6 +134,7 @@ BIReport.ITEM_GET_TYPE = {
WEAPON_GIFT = "WeaponGift", WEAPON_GIFT = "WeaponGift",
ARMOR_GIFT = "ArmorGift", ARMOR_GIFT = "ArmorGift",
EQUIP_UPGRADE = "EquipUpgrade", EQUIP_UPGRADE = "EquipUpgrade",
ARMOR_UPGRADE = "ArmorUpgrade",
} }
BIReport.ADS_CLICK_TYPE = { BIReport.ADS_CLICK_TYPE = {
@ -357,6 +358,9 @@ function BIReport:report(name, args)
local str, lv, atk, hp = DataManager.FormationData:getStageFormationBIStr() local str, lv, atk, hp = DataManager.FormationData:getStageFormationBIStr()
args.formation_atk = atk args.formation_atk = atk
args.formation_hp = hp args.formation_hp = hp
if DataManager.DungeonData then
args.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
end
end end
args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion() args.current_version = CS.BF.BFMain.Instance.GameLaunchMgr:GetCurrentVersion()
args.is_new_player = self.isNewPlayer args.is_new_player = self.isNewPlayer
@ -1091,11 +1095,12 @@ function BIReport:postVitGet(num, getType, vitAll)
end end
-- 体力使用 -- 体力使用
function BIReport:postVitUse(num) function BIReport:postVitUse(num, getType)
-- EnergyNum 当前体力数 减少体力时 Int 使用体力数量 -- EnergyNum 当前体力数 减少体力时 Int 使用体力数量
-- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否 -- IsNew 是否是新用户 Boolean 是否为当天新用户True = 是False = 否
-- MaxChapter 最大章节 Int 已解锁的最大章节 -- MaxChapter 最大章节 Int 已解锁的最大章节
local args = { local args = {
type = getType,
vit_num = num, vit_num = num,
vit_all = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT), vit_all = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_VIT),
} }

View File

@ -93,8 +93,15 @@ end
-- 响应结算金币副本 -- 响应结算金币副本
function DungeonManager:respEndChallengeGold(result) function DungeonManager:respEndChallengeGold(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
local passId = DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD)
DataManager.DungeonData:initDungeonGold(result.gold_challenge) DataManager.DungeonData:initDungeonGold(result.gold_challenge)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, result.rewards, result.reqData.combatReport) ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_GOLD, result.rewards, result.reqData.combatReport)
if passId ~= DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_GOLD) then
local data = {}
data.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
end
end end
end end
@ -182,8 +189,15 @@ end
-- 响应结算碎片副本 -- 响应结算碎片副本
function DungeonManager:respEndChallengeShards(result) function DungeonManager:respEndChallengeShards(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
local passId = DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS)
DataManager.DungeonData:initDungeonShards(result.shards_challenge) DataManager.DungeonData:initDungeonShards(result.shards_challenge)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, result.rewards, result.reqData and result.reqData.combatReport or {}) ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_SHARDS, result.rewards, result.reqData and result.reqData.combatReport or {})
if passId ~= DataManager.DungeonData:getPassedMaxId(ModuleManager.MODULE_KEY.DUNGEON_SHARDS) then
local data = {}
data.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
end
end end
end end

View File

@ -94,11 +94,18 @@ end
function DungeonArmorManager:rspEndChallenge(result) function DungeonArmorManager:rspEndChallenge(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR)
local passId = armorData:getPassedMaxId()
if result.reqData then if result.reqData then
armorData:refreshInfoOnSettlement(result.reqData.chapter_armor_id, result) armorData:refreshInfoOnSettlement(result.reqData.chapter_armor_id, result)
end end
ModuleManager.BattleManager:showBattleArmorResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, result.rewards, result.reqData.combatReport) ModuleManager.BattleManager:showBattleArmorResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_ARMOR, result.rewards, result.reqData.combatReport)
DataManager.DungeonData:setDirty() DataManager.DungeonData:setDirty()
if passId ~= armorData:getPassedMaxId() then
local data = {}
data.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
end
end end
end end

View File

@ -80,6 +80,7 @@ end
function DungeonWeaponManager:rspEndChallenge(result) function DungeonWeaponManager:rspEndChallenge(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then if result.err_code == GConst.ERROR_STR.SUCCESS then
local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON) local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON)
local passId = weaponData:getPassedMaxId()
weaponData:refreshInfoOnSettlement(result.reqData.chapter_weapon_id, result) weaponData:refreshInfoOnSettlement(result.reqData.chapter_weapon_id, result)
local firstRewardsIdx = #result.first_rewards local firstRewardsIdx = #result.first_rewards
@ -102,6 +103,12 @@ function DungeonWeaponManager:rspEndChallenge(result)
end end
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, resultRewards, result.reqData.combatReport, nil, firstRewardsIdx, true) ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.DUNGEON_WEAPON, resultRewards, result.reqData.combatReport, nil, firstRewardsIdx, true)
DataManager.DungeonData:setDirty() DataManager.DungeonData:setDirty()
if passId ~= weaponData:getPassedMaxId() then
local data = {}
data.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
end
end end
end end

View File

@ -35,7 +35,11 @@ function EquipManager:reqUpgrade(id, part)
return return
end end
self:sendMessage(ProtoMsgType.FromMsgEnum.EquipUpgradeReq, {hero_id = id, position = part}, {}, self.rspUpgrade, BIReport.ITEM_GET_TYPE.EQUIP_UPGRADE) local itemGetType = BIReport.ITEM_GET_TYPE.EQUIP_UPGRADE
if part ~= GConst.EquipConst.PART_TYPE.WEAPON then
itemGetType = BIReport.ITEM_GET_TYPE.ARMOR_UPGRADE
end
self:sendMessage(ProtoMsgType.FromMsgEnum.EquipUpgradeReq, {hero_id = id, position = part}, {}, self.rspUpgrade, itemGetType)
end end
function EquipManager:rspUpgrade(result) function EquipManager:rspUpgrade(result)

View File

@ -164,6 +164,7 @@ function LoginManager:loginFinish(data)
data.formation, data.formation_lv, data.formation_atk, data.formation_hp = DataManager.FormationData:getStageFormationBIStr() data.formation, data.formation_lv, data.formation_atk, data.formation_hp = DataManager.FormationData:getStageFormationBIStr()
data.formation_lv = nil data.formation_lv = nil
data.all_heroes = DataManager.HeroData:getAllHeroesBIStr() data.all_heroes = DataManager.HeroData:getAllHeroesBIStr()
data.dungeon_progress = DataManager.DungeonData:getDungeonBIStr()
CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data) CS.ThinkingAnalytics.ThinkingAnalyticsAPI.UserSet(data)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.LOGIN_REQ_SUCCESS) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.LOGIN_REQ_SUCCESS)

View File

@ -160,7 +160,7 @@ function ItemData:addItem(data, itemGetType)
elseif data.id == GConst.ItemConst.ITEM_ID_VIT then elseif data.id == GConst.ItemConst.ITEM_ID_VIT then
if data.count < 0 then if data.count < 0 then
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_VIT_COST, -data.count) ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_VIT_COST, -data.count)
BIReport:postVitUse(data.count) BIReport:postVitUse(data.count, itemGetType)
else else
BIReport:postVitGet(data.count, itemGetType) BIReport:postVitGet(data.count, itemGetType)
end end

View File

@ -473,4 +473,21 @@ function DungeonData:getDungeonDataByType(moduleKey)
return self.dataDungeons[moduleKey] return self.dataDungeons[moduleKey]
end end
function DungeonData:getDungeonBIStr()
local str
if not self.dataDungeons then
return GConst.EMPTY_STRING
end
for moduleKey, entity in pairs(self.dataDungeons) do
if str then
str = str .. "|"
else
str = GConst.EMPTY_STRING
end
str = str .. string.gsub(moduleKey, "_open", "") .. ":" .. entity:getPassedMaxId()
end
Logger.logHighlight(str)
return str
end
return DungeonData return DungeonData