Commit d593a8743141705b22c30b3fd8b8792701030923
Merge remote-tracking branch 'origin/cn/develop' into cn/develop
Showing
4 changed files
with
20 additions
and
17 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 |
src/actions/GmAction.lua
@@ -301,9 +301,13 @@ function _M.get(role, pms) | @@ -301,9 +301,13 @@ function _M.get(role, pms) | ||
301 | end | 301 | end |
302 | end | 302 | end |
303 | elseif pms.pm1 == "HERO" then | 303 | elseif pms.pm1 == "HERO" then |
304 | - for itemId = 400 , 700 do | 304 | + local unitCsv = csvdb["unitCsv"] |
305 | + for itemId = 400 , 800 do | ||
305 | if csvdb["itemCsv"][itemId] then | 306 | if csvdb["itemCsv"][itemId] then |
306 | - role:award({[itemId] = 1}, {log = {desc = "gm"}}) | 307 | + local heroUnit = unitCsv[itemId - 300] |
308 | + if heroUnit.open == 1 then | ||
309 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) | ||
310 | + end | ||
307 | end | 311 | end |
308 | end | 312 | end |
309 | elseif pms.pm1 == "MAXHERO" then | 313 | elseif pms.pm1 == "MAXHERO" then |
src/actions/RoleAction.lua
@@ -1431,7 +1431,7 @@ function _M.diamondConvertRpc(agent, data) | @@ -1431,7 +1431,7 @@ function _M.diamondConvertRpc(agent, data) | ||
1431 | role:costDiamond({count = cost, log = {desc = "convert", int1 = oper, int2 = get}}) | 1431 | role:costDiamond({count = cost, log = {desc = "convert", int1 = oper, int2 = get}}) |
1432 | local reward, change | 1432 | local reward, change |
1433 | if oper == 1 then -- 钻石兑换成虹光玉 | 1433 | if oper == 1 then -- 钻石兑换成虹光玉 |
1434 | - reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert"}}) | 1434 | + reward, change = role:award({[ItemId.Jade] = get}, {log = {desc = "convert", short1=oper}}) |
1435 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 | 1435 | elseif oper == 2 then -- 钻石兑换成虹光玉再兑换成招募券 |
1436 | local old = role:getItemCount(ItemId.Jade) | 1436 | local old = role:getItemCount(ItemId.Jade) |
1437 | get = old + get | 1437 | get = old + get |
@@ -1444,7 +1444,7 @@ function _M.diamondConvertRpc(agent, data) | @@ -1444,7 +1444,7 @@ function _M.diamondConvertRpc(agent, data) | ||
1444 | allReward[ItemId.Jade] = remain - old | 1444 | allReward[ItemId.Jade] = remain - old |
1445 | elseif remain == old then | 1445 | elseif remain == old then |
1446 | else | 1446 | else |
1447 | - role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert"}}) | 1447 | + role:costItems({[ItemId.Jade] = old - remain}, {log = {desc = "convert", short1=oper}}) |
1448 | end | 1448 | end |
1449 | 1449 | ||
1450 | if quan > 0 then | 1450 | if quan > 0 then |