Commit e1b1f689a6fe0e9a454e10262aee9331cd7cb004
1 parent
e66080dd
fix: 记录用户跟设备信息, openItem协议的错误返回加上返回码
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
src/actions/RoleAction.lua
@@ -83,6 +83,9 @@ function _M.loginRpc( agent, data ) | @@ -83,6 +83,9 @@ function _M.loginRpc( agent, data ) | ||
83 | end | 83 | end |
84 | end | 84 | end |
85 | 85 | ||
86 | + -- 设备记录 | ||
87 | + redisproxy:sadd(string_format("device:%d", roleId), msg.device) | ||
88 | + | ||
86 | local now = skynet.timex() | 89 | local now = skynet.timex() |
87 | local role = agent.role | 90 | local role = agent.role |
88 | -- 2 | 91 | -- 2 |
@@ -614,11 +617,11 @@ function _M.openItemRpc(agent, data) | @@ -614,11 +617,11 @@ function _M.openItemRpc(agent, data) | ||
614 | local msg = MsgPack.unpack(data) | 617 | local msg = MsgPack.unpack(data) |
615 | local itemId = msg.itemId | 618 | local itemId = msg.itemId |
616 | local count = msg.count | 619 | local count = msg.count |
617 | - if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end | 620 | + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return 1 end |
618 | local itemData = csvdb["itemCsv"][itemId] | 621 | local itemData = csvdb["itemCsv"][itemId] |
619 | - if itemData.use_type ~= 2 then return end | 622 | + if itemData.use_type ~= 2 then return 2 end |
620 | local randomData = csvdb["item_randomCsv"][tonumber(itemData.use_effect)] | 623 | local randomData = csvdb["item_randomCsv"][tonumber(itemData.use_effect)] |
621 | - if not randomData or randomData.openTime > 0 then return end | 624 | + if not randomData or randomData.openTime > 0 then return 3 end |
622 | 625 | ||
623 | local reward = {} | 626 | local reward = {} |
624 | for _i = 1, count do | 627 | for _i = 1, count do |