Commit 1dfcef5366b8cdd8a863165666a221d003dac002
1 parent
99712f36
好友推荐列表bug
Showing
2 changed files
with
12 additions
and
13 deletions
Show diff stats
src/actions/FriendAction.lua
... | ... | @@ -118,7 +118,6 @@ function _M.applyRpc(agent, data) |
118 | 118 | |
119 | 119 | local msg = MsgPack.unpack(data) |
120 | 120 | local objectId = msg.roleId |
121 | - dump(msg) | |
122 | 121 | |
123 | 122 | if objectId == roleId then |
124 | 123 | return |
... | ... | @@ -130,7 +129,6 @@ function _M.applyRpc(agent, data) |
130 | 129 | red:sismember(FRIEND_BLACK_KEY:format(objectId), roleId) |
131 | 130 | red:sismember(FRIEND_BLACK_KEY:format(roleId), objectId) |
132 | 131 | end) |
133 | - dump(redret) | |
134 | 132 | |
135 | 133 | -- 玩家id不存在 |
136 | 134 | if not result and not roleExists(objectId) then |
... | ... | @@ -647,18 +645,19 @@ function _M.randomRpc(agent, data) |
647 | 645 | for idx, objId in ipairs(needRoleIds) do |
648 | 646 | if not redret[idx] then |
649 | 647 | local online, info = getRoleInfo(objId) |
650 | - table.insert(randomRoles, table_merge({ | |
651 | - roleId = objId, | |
652 | - online = online, | |
653 | - hadApply = hadApply, | |
654 | - inBlack = inBlack, | |
655 | - }, info, { | |
656 | - | |
657 | - })) | |
658 | - if #randomRoles >= globalCsv.friendRecommendLimit then break end | |
648 | + if next(info) then | |
649 | + table.insert(randomRoles, table_merge({ | |
650 | + roleId = objId, | |
651 | + online = online, | |
652 | + hadApply = hadApply, | |
653 | + inBlack = inBlack, | |
654 | + }, info, { | |
655 | + | |
656 | + })) | |
657 | + if #randomRoles >= globalCsv.friendRecommendLimit then break end | |
658 | + end | |
659 | 659 | end |
660 | 660 | end |
661 | - | |
662 | 661 | SendPacket(actionCodes.Friend_randomRpc, MsgPack.pack({list = randomRoles})) |
663 | 662 | return true |
664 | 663 | end | ... | ... |