From 5de23af5cc529fc0ac83c078910f995d66bb7e7f Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Thu, 9 Sep 2021 17:51:53 +0800 Subject: [PATCH] fix: 世界积分 名字修改成Rpc,抽世界轮盘返回基数和倍率 --- src/ProtocolCode.lua | 4 ++-- src/actions/RoleAction.lua | 8 ++++---- src/models/RolePlugin.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index dcbf3f5..3937a2e 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -62,8 +62,8 @@ actionCodes = { Role_setFriendTeamRpc = 143, -- 设置好友切磋队伍 Role_setBgRpc = 144, -- 设置看板娘 Role_itemConvertSpecialRpc = 145, -- 兑换月卡/战令探索指令等 特殊道具 - Role_worldLineRoulette = 146, --世界线抽轮盘 - Role_worldLineReward = 147, -- 世界线一键领取奖励 + Role_worldLineRouletteRpc = 146, --世界线抽轮盘 + Role_worldLineRewardRpc = 147, -- 世界线一键领取奖励 Adv_startAdvRpc = 151, Adv_startHangRpc = 152, diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 416cd0b..c63198a 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -1762,7 +1762,7 @@ function _M.itemConvertSpecialRpc(agent, data) return true end -function _M.worldLineRoulette(agent, data) +function _M.worldLineRouletteRpc(agent, data) local role = agent.role local worldChangePoints = role:getProperty("worldChangePoints") or {} @@ -1794,11 +1794,11 @@ function _M.worldLineRoulette(agent, data) worldChangePoints[ItemWorldLine.Points] = worldChangePoints[ItemWorldLine.Points] + points role:updateProperty({field = "worldChangePoints", value = worldChangePoints}) - SendPacket(actionCodes.Role_worldLineRoulette, MsgPack.pack(worldChangePoints)) + SendPacket(actionCodes.Role_worldLineRouletteRpc, MsgPack.pack({base_10 = gift_base_10, base_1 = gift_base_1, magnification_1 = gift_magnification_1, magnification_0 = gift_magnification_0})) return true end -function _M.worldLineReward(agent, data) +function _M.worldLineRewardRpc(agent, data) local role = agent.role local worldLineReward = role:getProperty("worldLineReward") or {} local worldChangePoints = role:getProperty("worldChangePoints") or {} @@ -1819,7 +1819,7 @@ function _M.worldLineReward(agent, data) if next(reward) then reward, change = role:award(reward, {log = {desc = "worldLine", int1 = role:getProperty("id")}}) end - SendPacket(actionCodes.Role_worldLineReward, MsgPack.pack(role:packReward(reward, change))) + SendPacket(actionCodes.Role_worldLineRewardRpc, MsgPack.pack(role:packReward(reward, change))) return true end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 44e9ca6..935ae35 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -3307,7 +3307,7 @@ function RolePlugin.bind(Role) worldChangePoints[ItemWorldLine.CostDiamond] = worldChangePoints[ItemWorldLine.CostDiamond] - cost * globalCsv.worldline_count_currency worldChangePoints[ItemWorldLine.Points] = (worldChangePoints[ItemWorldLine.Points] or 0) + cost end - self:setProperty("worldChangePoints", worldChangePoints) + self:updateProperty({field = "worldChangePoints", value = worldChangePoints}) end end -- libgit2 0.21.2