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
@@ -55,6 +55,7 @@ actionCodes = { | @@ -55,6 +55,7 @@ actionCodes = { | ||
55 | Role_updateSpark = 139, -- 更新火花 | 55 | Role_updateSpark = 139, -- 更新火花 |
56 | Role_diamondConvertRpc = 140, -- 钻石兑换成别的物品 | 56 | Role_diamondConvertRpc = 140, -- 钻石兑换成别的物品 |
57 | Role_getTimeGiftRpc = 141, | 57 | Role_getTimeGiftRpc = 141, |
58 | + Role_runeBuyRpc = 142, -- 铭文购买 | ||
58 | 59 | ||
59 | Adv_startAdvRpc = 151, | 60 | Adv_startAdvRpc = 151, |
60 | Adv_startHangRpc = 152, | 61 | Adv_startHangRpc = 152, |
src/actions/RoleAction.lua
@@ -1332,11 +1332,17 @@ function _M.guideRpc(agent, data) | @@ -1332,11 +1332,17 @@ function _M.guideRpc(agent, data) | ||
1332 | local funcGuide = role:getProperty("funcGuide") | 1332 | local funcGuide = role:getProperty("funcGuide") |
1333 | if cmdType == 1 then | 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 | elseif cmdType == 2 then | 1346 | elseif cmdType == 2 then |
1341 | -- 系统引导(玩家可选择是否进行) | 1347 | -- 系统引导(玩家可选择是否进行) |
1342 | if not msg.skip then return end | 1348 | if not msg.skip then return end |
@@ -1562,4 +1568,19 @@ function _M.getTimeGiftRpc(agent, data) | @@ -1562,4 +1568,19 @@ function _M.getTimeGiftRpc(agent, data) | ||
1562 | return true | 1568 | return true |
1563 | end | 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 | return _M | 1586 | return _M |
1566 | \ No newline at end of file | 1587 | \ No newline at end of file |
src/models/Daily.lua
@@ -21,7 +21,8 @@ Daily.schema = { | @@ -21,7 +21,8 @@ Daily.schema = { | ||
21 | giveFP = {"table", {}}, -- 给谁送过心心 | 21 | giveFP = {"table", {}}, -- 给谁送过心心 |
22 | getFP = {"table", {}}, -- 领过谁的心心 | 22 | getFP = {"table", {}}, -- 领过谁的心心 |
23 | pvpFree = {"number", 0}, -- pvp使用免费次数 | 23 | pvpFree = {"number", 0}, -- pvp使用免费次数 |
24 | - pvpFreeH = {"number", 0}, -- 高级pvp使用免费次数 | 24 | + pvpFreeH = {"number", 0}, -- 高级pvp使用免费次 |
25 | + pvpBought = {"number", 0}, -- 门票购买次数 | ||
25 | 26 | ||
26 | dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计 | 27 | dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计 |
27 | dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计 | 28 | dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计 |
@@ -69,6 +70,8 @@ function Daily:refreshDailyData(notify) | @@ -69,6 +70,8 @@ function Daily:refreshDailyData(notify) | ||
69 | -- skip | 70 | -- skip |
70 | elseif field == "treasureList" then | 71 | elseif field == "treasureList" then |
71 | dataMap[field] = self:getTreasrueList() | 72 | dataMap[field] = self:getTreasrueList() |
73 | + elseif field == "pvpBought" then | ||
74 | + dataMap[field] = 0 | ||
72 | elseif field ~= "key" then | 75 | elseif field ~= "key" then |
73 | local typ, def = table.unpack(schema) | 76 | local typ, def = table.unpack(schema) |
74 | dataMap[field] = def | 77 | dataMap[field] = def |
@@ -399,6 +402,7 @@ function Daily:data() | @@ -399,6 +402,7 @@ function Daily:data() | ||
399 | getFP = self:getProperty("getFP"), | 402 | getFP = self:getProperty("getFP"), |
400 | pvpFree = self:getProperty("pvpFree"), | 403 | pvpFree = self:getProperty("pvpFree"), |
401 | pvpFreeH = self:getProperty("pvpFreeH"), | 404 | pvpFreeH = self:getProperty("pvpFreeH"), |
405 | + pvpBought = self:getProperty("pvpBought"), | ||
402 | dailySDC = self:getProperty("dailySDC"), | 406 | dailySDC = self:getProperty("dailySDC"), |
403 | dailySDD = self:getProperty("dailySDD"), | 407 | dailySDD = self:getProperty("dailySDD"), |
404 | advSupRe = self:getProperty("advSupRe"), | 408 | advSupRe = self:getProperty("advSupRe"), |