From 432937819731e79fcf547dce8eea4a0fbccc2921 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Wed, 9 Sep 2020 14:41:17 +0800 Subject: [PATCH] 日志bug --- src/actions/HeroAction.lua | 21 +++++++++++++-------- src/actions/RoleAction.lua | 4 ++-- src/actions/StoreAction.lua | 2 +- src/models/RoleLog.lua | 4 +++- src/models/RolePlugin.lua | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index de43e2c..d93ef16 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -109,6 +109,7 @@ function _M.wakeRpc(agent, data) role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) local oldAttr = hero:getTotalAttrs() + local oldBattleV = hero:getProperty("battleV") hero:updateProperty({field = "wakeL", delta = 1}) local curLevel = hero:getProperty("wakeL") @@ -122,6 +123,7 @@ function _M.wakeRpc(agent, data) hero_id = typ, --英雄ID hero_rise_cost = cost, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} hero_rise_score = hero:getProperty("battleV"), --英雄觉醒后评分提升 + hero_rise_scoreget = hero:getProperty("battleV") - oldBattleV, --英雄觉醒后评分提升 hero_rise_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} }) @@ -198,6 +200,7 @@ function _M.talentRpc(agent, data) role:log("hero_talent", { hero_id = hero:getProperty("type"), --英雄ID + hero_talent_id = index, --天赋ID hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级 hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级 @@ -581,14 +584,16 @@ function _M.referRunesRpc(agent, data) local attrChange = getChangeAttrJson(oldAttr, hero:getTotalAttrs()) for runeId, typ in pairs(wear) do local ownRune = role.runeBag[runeId] - role:log("hero_jewel", { - hero_id = hero:getProperty("type"), -- 英雄ID - hero_jewel_id = ownRune:getProperty("id"), -- 铭文ID - hero_jewel_part = typ, -- 铭文装备部位 - hero_jewel_score = hero:getProperty("battleV"), -- 铭文装备后的英雄分值 - hero_jewel_scorebefore = oldBattleV, -- 铭文装备前的英雄分值 - hero_jewel_result = attrChange, -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} - }) + if ownRune then + role:log("hero_jewel", { + hero_id = hero:getProperty("type"), -- 英雄ID + hero_jewel_id = ownRune:getProperty("id"), -- 铭文ID + hero_jewel_part = typ, -- 铭文装备部位 + hero_jewel_score = hero:getProperty("battleV"), -- 铭文装备后的英雄分值 + hero_jewel_scorebefore = oldBattleV, -- 铭文装备前的英雄分值 + hero_jewel_result = attrChange, -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} + }) + end end SendPacket(actionCodes.Hero_referRunesRpc, "") diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 29877ba..8ea3519 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -549,7 +549,6 @@ function _M.openTimeBoxRpc(agent, data) local quick = msg.quick if not boxL[slot] then return end local costKey = 0 - local costTime = skynet.timex() - boxL[slot].time if boxL[slot].time > skynet.timex() then -- 没开完 if not quick then return end local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") @@ -560,6 +559,7 @@ function _M.openTimeBoxRpc(agent, data) local boxId = boxL[slot].id local itemData = csvdb["itemCsv"][boxId] local randomData = csvdb["item_randomCsv"][itemData.id] + local costTime = skynet.timex() - (boxL[slot].time - randomData.openTime) -- 随机奖励 reward = {} for i = 1, 10 do @@ -684,7 +684,7 @@ function _M.storyBookRewardRpc(agent, data) role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) - role:log("carriage_decals", { + role:log("carriage_video", { carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 carriage_video_id = storyId, --放映室片段ID carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index 4ef6ff2..290b627 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -177,7 +177,7 @@ function _M.purchaseOrderResult(agent, data) item_level = 1, -- 购买的道具等级 order_cost = dataSet.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 - order_type = self.getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 + order_type = role:getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 order_id = msg.platformOrder, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' }) diff --git a/src/models/RoleLog.lua b/src/models/RoleLog.lua index ad9032d..e6e2033 100644 --- a/src/models/RoleLog.lua +++ b/src/models/RoleLog.lua @@ -215,6 +215,7 @@ local MethodType = { hero_id = true, --英雄ID hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} hero_rise_score = true, --英雄觉醒后评分提升 + hero_rise_scoreget = true, -- 提升的评分 hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} }, hero_upgrade = { --英雄升级 @@ -236,6 +237,7 @@ local MethodType = { hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} hero_talent_levelbef = true, -- 英雄技能升级前等级 hero_talent_level = true, -- 英雄技能升级后等级 + hero_talent_id = true, -- 天赋id }, hero_jewel = { --英雄铭文 hero_id = true, -- 英雄ID @@ -285,7 +287,7 @@ local MethodType = { equip_upgrade_amount = true, -- 升级获取的装备数量 equip_upgrade_usedid = true, -- 升级消耗的装备ID equip_upgrade_cost = true, -- 升级操作消耗装备数量 - equip_upgrade_current = true, -- 升级操作消耗货币数量 + equip_upgrade_current = "json", -- 升级操作消耗货币数量 }, carriage_dismantle = { --物资拆解 item_id = true, -- 道具id diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 2f57280..4757bab 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -229,7 +229,7 @@ function RolePlugin.bind(Role) self:log("setLevel", { level_before = oldLevel, level_changemain = log.desc, - level_changedetail = log.sub or "", + level_changedetail = log.int1 or 0, level_reward = {}, }) else -- libgit2 0.21.2