Commit a0b219dd9cde5946cfa6131cba3a3ec23b8b2f9e
Merge branch 'cn/develop' into cn/player
Showing
3 changed files
with
32 additions
and
6 deletions
Show diff stats
src/ProtocolCode.lua
src/actions/RoleAction.lua
| ... | ... | @@ -1332,11 +1332,17 @@ function _M.guideRpc(agent, data) |
| 1332 | 1332 | local funcGuide = role:getProperty("funcGuide") |
| 1333 | 1333 | if cmdType == 1 then |
| 1334 | 1334 | -- 新手引导 |
| 1335 | - local master = msg.master or -1 | |
| 1336 | - local slave = msg.slave or -1 | |
| 1337 | - if master < 0 or slave < 0 then return end | |
| 1338 | - | |
| 1339 | - role:saveGuide(master, slave) | |
| 1335 | + if msg.masters then | |
| 1336 | + for _, master in pairs(msg.masters) do | |
| 1337 | + role:saveGuide(master,1,true) | |
| 1338 | + end | |
| 1339 | + else | |
| 1340 | + local master = msg.master or -1 | |
| 1341 | + local slave = msg.slave or -1 | |
| 1342 | + if master < 0 or slave < 0 then return end | |
| 1343 | + role:saveGuide(master, slave) | |
| 1344 | + end | |
| 1345 | + | |
| 1340 | 1346 | elseif cmdType == 2 then |
| 1341 | 1347 | -- 系统引导(玩家可选择是否进行) |
| 1342 | 1348 | if not msg.skip then return end |
| ... | ... | @@ -1562,4 +1568,19 @@ function _M.getTimeGiftRpc(agent, data) |
| 1562 | 1568 | return true |
| 1563 | 1569 | end |
| 1564 | 1570 | |
| 1571 | +function _M.runeBuyRpc(agent, data) | |
| 1572 | + local role = agent.role | |
| 1573 | + local msg = MsgPack.unpack(data) | |
| 1574 | + local count = msg.count | |
| 1575 | + | |
| 1576 | + local glodCount = globalCsv.rune_exchange * count | |
| 1577 | + if not role:checkItemEnough({[ItemId.Gold] = glodCount}) then return end | |
| 1578 | + role:costItems({[ItemId.Gold] = glodCount}, {log = {desc = "glodConvertRune", int1 = count, int2 = glodCount}}) | |
| 1579 | + local reward, change = {} | |
| 1580 | + reward[ItemId.RuneFragment] = count | |
| 1581 | + reward, change = role:award(reward, {log = {desc = "glodConvertRune"}}) | |
| 1582 | + SendPacket(actionCodes.Role_runeBuyRpc, MsgPack.pack(role:packReward(reward, change))) | |
| 1583 | + return true | |
| 1584 | +end | |
| 1585 | + | |
| 1565 | 1586 | return _M |
| 1566 | 1587 | \ No newline at end of file | ... | ... |
src/models/Daily.lua
| ... | ... | @@ -21,7 +21,8 @@ Daily.schema = { |
| 21 | 21 | giveFP = {"table", {}}, -- 给谁送过心心 |
| 22 | 22 | getFP = {"table", {}}, -- 领过谁的心心 |
| 23 | 23 | pvpFree = {"number", 0}, -- pvp使用免费次数 |
| 24 | - pvpFreeH = {"number", 0}, -- 高级pvp使用免费次数 | |
| 24 | + pvpFreeH = {"number", 0}, -- 高级pvp使用免费次 | |
| 25 | + pvpBought = {"number", 0}, -- 门票购买次数 | |
| 25 | 26 | |
| 26 | 27 | dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计 |
| 27 | 28 | dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计 |
| ... | ... | @@ -69,6 +70,8 @@ function Daily:refreshDailyData(notify) |
| 69 | 70 | -- skip |
| 70 | 71 | elseif field == "treasureList" then |
| 71 | 72 | dataMap[field] = self:getTreasrueList() |
| 73 | + elseif field == "pvpBought" then | |
| 74 | + dataMap[field] = 0 | |
| 72 | 75 | elseif field ~= "key" then |
| 73 | 76 | local typ, def = table.unpack(schema) |
| 74 | 77 | dataMap[field] = def |
| ... | ... | @@ -399,6 +402,7 @@ function Daily:data() |
| 399 | 402 | getFP = self:getProperty("getFP"), |
| 400 | 403 | pvpFree = self:getProperty("pvpFree"), |
| 401 | 404 | pvpFreeH = self:getProperty("pvpFreeH"), |
| 405 | + pvpBought = self:getProperty("pvpBought"), | |
| 402 | 406 | dailySDC = self:getProperty("dailySDC"), |
| 403 | 407 | dailySDD = self:getProperty("dailySDD"), |
| 404 | 408 | advSupRe = self:getProperty("advSupRe"), | ... | ... |