Commit b5481708f1de88e7aafd90ef8ce4c2fbf86ce1ab

Authored by zhouhaihai
1 parent c048e676

保底日志

Showing 2 changed files with 7 additions and 2 deletions   Show diff stats
src/actions/HeroAction.lua
@@ -855,14 +855,17 @@ function _M.drawHeroRpc(agent, data) @@ -855,14 +855,17 @@ function _M.drawHeroRpc(agent, data)
855 floorHeroCount = 0 855 floorHeroCount = 0
856 end 856 end
857 857
  858 + local logReward = {}
858 if role:isHaveHero(itemData.id - ItemStartId.Hero) then 859 if role:isHaveHero(itemData.id - ItemStartId.Hero) then
859 local fragId = itemData.id - ItemStartId.Hero 860 local fragId = itemData.id - ItemStartId.Hero
860 local heroData = csvdb["unitCsv"][fragId] 861 local heroData = csvdb["unitCsv"][fragId]
861 local count = globalCsv.draw_unit_tofragment[heroData.rare] 862 local count = globalCsv.draw_unit_tofragment[heroData.rare]
862 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) 863 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  864 + logReward[fragId] = (logReward[fragId] or 0) + count
863 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) 865 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1})
864 else 866 else
865 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) 867 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}})
  868 + logReward[itemId] = (logReward[itemId] or 0) + 1
866 table.insert(reward, {id = itemId, count = 1}) 869 table.insert(reward, {id = itemId, count = 1})
867 end 870 end
868 end 871 end
@@ -884,14 +887,15 @@ function _M.drawHeroRpc(agent, data) @@ -884,14 +887,15 @@ function _M.drawHeroRpc(agent, data)
884 role:checkTaskEnter("DrawSSR", {count = ssrCount}) 887 role:checkTaskEnter("DrawSSR", {count = ssrCount})
885 end 888 end
886 role:finishGuide(11) 889 role:finishGuide(11)
887 - 890 +
888 role:log("gacha", { 891 role:log("gacha", {
889 gacha_id = poolId, -- 卡池ID 892 gacha_id = poolId, -- 卡池ID
890 gacha_type = btype, -- 卡池类型 893 gacha_type = btype, -- 卡池类型
891 gacha_up = 0, -- 卡池UP角色 894 gacha_up = 0, -- 卡池UP角色
892 gacha_times = drawCount[drawType], -- 抽卡次数 895 gacha_times = drawCount[drawType], -- 抽卡次数
893 - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 896 + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
894 currency = cost, -- 购买道具消耗的货币 897 currency = cost, -- 购买道具消耗的货币
  898 + gacha_cnt = floorHeroCount,
895 }) 899 })
896 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 900 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
897 return true 901 return true
src/models/RoleLog.lua
@@ -266,6 +266,7 @@ local MethodType = { @@ -266,6 +266,7 @@ local MethodType = {
266 gacha_times = true, -- 抽卡次数 266 gacha_times = true, -- 抽卡次数
267 gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 267 gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
268 currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} 268 currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  269 + gacha_cnt = true, -- 保底计数
269 }, 270 },
270 equip_wear = { --装备穿戴与卸载 271 equip_wear = { --装备穿戴与卸载
271 hero_id = true, --英雄ID 272 hero_id = true, --英雄ID