diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 0fe6933..e14fead 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -83,6 +83,9 @@ function _M.loginRpc( agent, data ) end end + -- 设备记录 + redisproxy:sadd(string_format("device:%d", roleId), msg.device) + local now = skynet.timex() local role = agent.role -- 2 @@ -614,11 +617,11 @@ function _M.openItemRpc(agent, data) local msg = MsgPack.unpack(data) local itemId = msg.itemId local count = msg.count - if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return 1 end local itemData = csvdb["itemCsv"][itemId] - if itemData.use_type ~= 2 then return end + if itemData.use_type ~= 2 then return 2 end local randomData = csvdb["item_randomCsv"][tonumber(itemData.use_effect)] - if not randomData or randomData.openTime > 0 then return end + if not randomData or randomData.openTime > 0 then return 3 end local reward = {} for _i = 1, count do -- libgit2 0.21.2