From d43246b01a511787e97c2133245a0394ccecba89 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Wed, 26 Aug 2020 10:19:52 +0800 Subject: [PATCH] log 增加 --- src/actions/HangAction.lua | 79 ++++++++++++++++++++----------------------------------------------------------- 1 file changed, 20 insertions(+), 59 deletions(-) diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 4ecff0a..b5ff1d2 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -329,6 +329,17 @@ function _M.getRewardRpc(agent , data) if reward[ItemId.Gold] then role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) end + + role:log("residence_reward", { + mission_threadid = math.floor(hangInfo.carbonId / 10000), --大关卡ID + mission_id = hangInfo.carbonId, --关卡ID + mission_type = 100, --关卡类型,见关卡类型枚举表 + residence_reward_type = 0, --领取奖励方式,快速(超前领取)记录为1,正常领取记录为0 + residence_time = 0, --挂机或排名时长 + residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} + }) + + SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ reward = reward, change = change @@ -336,65 +347,6 @@ function _M.getRewardRpc(agent , data) return true end --- function _M.getRewardItemRpc(agent , data) --- local role = agent.role --- checkReward(role) --- local items = role:getProperty("hangBag") --- if not next(items) then return end - --- local notNeed = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} --- local reward = {} --- for itemId , count in pairs(items) do --- if not notNeed[itemId] then --- reward[itemId] = count --- items[itemId] = nil --- end --- end --- if not next(reward) then return end --- local reward = role:award(reward) - --- local hangInfo = role:getProperty("hangInfo") --- local nowTime = skynet.timex() --- hangInfo.endItemTime = nowTime + globalCsv.idle_producetime_max --- hangInfo.itemTime = nowTime --- role:updateProperty({field = "hangBag", value = items}) --- role:updateProperty({field = "hangInfo", value = hangInfo}) - --- SendPacket(actionCodes.Hang_getRewardItemRpc, MsgPack.pack({ --- reward = reward --- })) --- return true --- end - --- function _M.getRewardCoinRpc(agent , data) --- local role = agent.role --- checkReward(role) --- local items = role:getProperty("hangBag") --- if not next(items) then return end - --- local need = {[ItemId.Gold] = 1, [ItemId.Exp] = 1, [ItemId.PlayerExp] = 1} --- local reward = {} --- for itemId , count in pairs(items) do --- if need[itemId] then --- reward[itemId] = count --- items[itemId] = nil --- end --- end --- local reward = role:award(reward) - --- local hangInfo = role:getProperty("hangInfo") --- local nowTime = skynet.timex() --- hangInfo.endCoinTime = nowTime + globalCsv.idle_producetime_max --- hangInfo.coinTime = nowTime --- role:updateProperty({field = "hangBag", value = items}) --- role:updateProperty({field = "hangInfo", value = hangInfo}) - --- SendPacket(actionCodes.Hang_getRewardCoinRpc, MsgPack.pack({ --- reward = reward --- })) --- return true --- end - function _M.quickRpc(agent , data) local role = agent.role @@ -446,6 +398,15 @@ function _M.quickRpc(agent , data) role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) end role:checkTaskEnter("HangQuick") + + role:log("residence_reward", { + mission_threadid = math.floor(hangInfo.carbonId / 10000), --大关卡ID + mission_id = hangInfo.carbonId, --关卡ID + mission_type = 100, --关卡类型,见关卡类型枚举表 + residence_reward_type = 1, --领取奖励方式,快速(超前领取)记录为1,正常领取记录为0 + residence_time = time, --挂机或排名时长 + residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} + }) SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ reward = reward, change = change -- libgit2 0.21.2