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,7 +118,6 @@ function _M.applyRpc(agent, data) | ||
118 | 118 | ||
119 | local msg = MsgPack.unpack(data) | 119 | local msg = MsgPack.unpack(data) |
120 | local objectId = msg.roleId | 120 | local objectId = msg.roleId |
121 | - dump(msg) | ||
122 | 121 | ||
123 | if objectId == roleId then | 122 | if objectId == roleId then |
124 | return | 123 | return |
@@ -130,7 +129,6 @@ function _M.applyRpc(agent, data) | @@ -130,7 +129,6 @@ function _M.applyRpc(agent, data) | ||
130 | red:sismember(FRIEND_BLACK_KEY:format(objectId), roleId) | 129 | red:sismember(FRIEND_BLACK_KEY:format(objectId), roleId) |
131 | red:sismember(FRIEND_BLACK_KEY:format(roleId), objectId) | 130 | red:sismember(FRIEND_BLACK_KEY:format(roleId), objectId) |
132 | end) | 131 | end) |
133 | - dump(redret) | ||
134 | 132 | ||
135 | -- 玩家id不存在 | 133 | -- 玩家id不存在 |
136 | if not result and not roleExists(objectId) then | 134 | if not result and not roleExists(objectId) then |
@@ -647,18 +645,19 @@ function _M.randomRpc(agent, data) | @@ -647,18 +645,19 @@ function _M.randomRpc(agent, data) | ||
647 | for idx, objId in ipairs(needRoleIds) do | 645 | for idx, objId in ipairs(needRoleIds) do |
648 | if not redret[idx] then | 646 | if not redret[idx] then |
649 | local online, info = getRoleInfo(objId) | 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 | end | 659 | end |
660 | end | 660 | end |
661 | - | ||
662 | SendPacket(actionCodes.Friend_randomRpc, MsgPack.pack({list = randomRoles})) | 661 | SendPacket(actionCodes.Friend_randomRpc, MsgPack.pack({list = randomRoles})) |
663 | return true | 662 | return true |
664 | end | 663 | end |