Commit a4e66edad36cff5a22921043a660d7804b196c83
1 parent
cac28f5f
餐厅协议
Showing
2 changed files
with
7 additions
and
5 deletions
Show diff stats
src/ProtocolCode.lua
src/actions/DinerAction.lua
| ... | ... | @@ -785,7 +785,8 @@ function _M.collectRpc(agent , data) |
| 785 | 785 | local msg = MsgPack.unpack(data) |
| 786 | 786 | |
| 787 | 787 | local id = msg.id |
| 788 | - if not id or not csvdb["diner_customerCsv"][id] then return end | |
| 788 | + local customerData = csvdb["diner_customerCsv"][id] | |
| 789 | + if not id or not customerData then return end | |
| 789 | 790 | local customer = role.dinerData:getProperty("customer") |
| 790 | 791 | if customer[id] ~= 0 then |
| 791 | 792 | return |
| ... | ... | @@ -796,11 +797,11 @@ function _M.collectRpc(agent , data) |
| 796 | 797 | for slot, _ in pairs(sells) do |
| 797 | 798 | role.dinerData:updateSell(slot) |
| 798 | 799 | end |
| 799 | - | |
| 800 | + local reward = role:award(customerData.reward) | |
| 800 | 801 | customer[id] = 1 |
| 801 | 802 | role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了 |
| 802 | 803 | |
| 803 | - SendPacket(actionCodes.Diner_collectRpc, '') | |
| 804 | + SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward})) | |
| 804 | 805 | return true |
| 805 | 806 | end |
| 806 | 807 | |
| ... | ... | @@ -824,11 +825,11 @@ function _M.comboRewardRpc(agent , data) |
| 824 | 825 | end |
| 825 | 826 | |
| 826 | 827 | comboStatus[id] = 1 |
| 827 | - role:award(comboData.reward) | |
| 828 | + local reward = role:award(comboData.reward) | |
| 828 | 829 | |
| 829 | 830 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
| 830 | 831 | |
| 831 | - SendPacket(actionCodes.Diner_comboRewardRpc, '') | |
| 832 | + SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward})) | |
| 832 | 833 | return true |
| 833 | 834 | end |
| 834 | 835 | ... | ... |