Commit 57a73438853d08878a389bd7a94f190e31156565
Merge branch 'bugfix' into tr/publish
* bugfix: 邮件 活动奖励bug cb 返利调整 世界boss 胜利才扣门票,扫荡根据之前的最大值给行动点 任务 付费签到规则改为按登录天数计算进度, 世界boss
Showing
8 changed files
with
43 additions
and
15 deletions
Show diff stats
src/GlobalVar.lua
src/actions/ActivityAction.lua
... | ... | @@ -192,13 +192,13 @@ function _M.actPaySignRpc(agent, data) |
192 | 192 | local open, actId = role.activity:isOpen("PaySignIn") |
193 | 193 | if not open then return 2 end |
194 | 194 | |
195 | - local diffDay = diffFromTs(ts) + 1 | |
195 | + --local diffDay = diffFromTs(ts) + 1 | |
196 | 196 | |
197 | 197 | local curData = role.activity:getActData("PaySignIn") |
198 | 198 | if not curData then return 3 end |
199 | 199 | local reward, change = {} |
200 | 200 | for day, csvData in ipairs(csvdb["pay_signInCsv"]) do |
201 | - if day <= diffDay and day == dayIndex then | |
201 | + if day <= (curData[0] or 0) and day == dayIndex then | |
202 | 202 | if not curData[day] then |
203 | 203 | curData[day] = 1 |
204 | 204 | -- 奖励 |
... | ... | @@ -525,6 +525,10 @@ function _M.startBattleRpc(agent, data) |
525 | 525 | local reward, change = role:award(award, {log = {desc = "actBattle", int1 = actid, int2 = count or 0}}) |
526 | 526 | SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) |
527 | 527 | |
528 | + if battleCfg.worldBoss_award ~= 0 and (bi["maxP"] or 0) > 0 then | |
529 | + bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] | |
530 | + end | |
531 | + | |
528 | 532 | bi["sum"] = bi["sum"] + bi["top"] |
529 | 533 | actData["ticket"] = ticket - num |
530 | 534 | actData[id] = bi |
... | ... | @@ -656,7 +660,7 @@ function _M.endBattleRpc(agent, data) |
656 | 660 | battleInfo["star"] = curStar |
657 | 661 | end |
658 | 662 | |
659 | - if battleCfg.rank ~= 0 then | |
663 | + if battleCfg.rank ~= 0 and isWin then | |
660 | 664 | -- 消耗门票 |
661 | 665 | role.activity:getBattleTicket(actid) |
662 | 666 | local num = battleCfg.type:toArray(true, "=")[3] |
... | ... | @@ -675,8 +679,6 @@ function _M.endBattleRpc(agent, data) |
675 | 679 | role:updateRankCommon(RANK_TYPE.ActBattleBoss, rankVal) |
676 | 680 | end |
677 | 681 | end |
678 | - actData[id] = battleInfo | |
679 | - role.activity:updateActData("ChallengeLevel", actData) | |
680 | 682 | |
681 | 683 | if (oldStarNum == 0 and newStarNum > 0) or battleCfg.rank ~= 0 then |
682 | 684 | reward = battleCfg.item_clear:toNumMap() |
... | ... | @@ -705,7 +707,10 @@ function _M.endBattleRpc(agent, data) |
705 | 707 | |
706 | 708 | if battleCfg.worldBoss_award ~= 0 and msg.point then |
707 | 709 | battleInfo["bossP"] = (battleInfo["bossP"] or 0) + msg.point |
710 | + battleInfo["maxP"] = math.max(msg.point, (battleInfo["maxP"] or 0)) | |
708 | 711 | end |
712 | + actData[id] = battleInfo | |
713 | + role.activity:updateActData("ChallengeLevel", actData) | |
709 | 714 | |
710 | 715 | reward, change = role:award(reward, {log = {desc = "actBattle", int1 = actid, int2 = newStarNum}}) |
711 | 716 | |
... | ... | @@ -834,6 +839,10 @@ function _M.bossRewardRpc(agent, data) |
834 | 839 | if bossPoint < 1 then return 7 end |
835 | 840 | |
836 | 841 | local bossRecord = battleInfo["bossR"] or "" |
842 | + local r = string.char(string.getbit(bossRecord, index)) | |
843 | + if r == "1" then | |
844 | + return 9 | |
845 | + end | |
837 | 846 | local ok = false |
838 | 847 | if #preList == 0 then |
839 | 848 | ok = true |
... | ... | @@ -849,6 +858,7 @@ function _M.bossRewardRpc(agent, data) |
849 | 858 | if not ok then return 8 end |
850 | 859 | |
851 | 860 | battleInfo["bossR"] = string.setbit(bossRecord, index) |
861 | + battleInfo["bossP"] = bossPoint - 1 | |
852 | 862 | actData[id] = battleInfo |
853 | 863 | role.activity:updateActData("ChallengeLevel", actData) |
854 | 864 | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -385,12 +385,16 @@ function _M.createRpc(agent, data) |
385 | 385 | if cbbackd then |
386 | 386 | local status, back = pcall(cluster.call, "center", cbbackd, "getCbBack", {uid = uid, id = roleId}) |
387 | 387 | if status then |
388 | - if back and next(back) then | |
388 | + if back and next(back) and back.reward and next(back.reward) then | |
389 | 389 | local reward = "" |
390 | - for itemId, count in pairs(back) do | |
390 | + for itemId, count in pairs(back.reward) do | |
391 | 391 | reward = reward:setv(itemId, count) |
392 | 392 | end |
393 | - redisproxy:insertEmail({roleId = roleId, emailId = MailId.CBBackAward, createtime = skynet.timex(), attachments = reward}) | |
393 | + if back.reward[70] then | |
394 | + redisproxy:insertEmail({roleId = roleId, emailId = MailId.CBBackAward2, contentPms = {back.money}, createtime = skynet.timex(), attachments = reward}) | |
395 | + else | |
396 | + redisproxy:insertEmail({roleId = roleId, emailId = MailId.CBBackAward, contentPms = {back.money}, createtime = skynet.timex(), attachments = reward}) | |
397 | + end | |
394 | 398 | newRole:mylog("cbback", {key1 = uid, int2 = roleId}) |
395 | 399 | end |
396 | 400 | else | ... | ... |
src/models/Activity.lua
... | ... | @@ -58,7 +58,7 @@ Activity.schema = { |
58 | 58 | actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time} |
59 | 59 | round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum} |
60 | 60 | act4 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动 |
61 | - act6 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | |
61 | + act6 = {"table", {}}, -- {0 = day, 1 = 1, 2 = 1} == 付费签到活动 | |
62 | 62 | act8 = {"number", 0}, -- 充值返利 |
63 | 63 | |
64 | 64 | act11 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 |
... | ... | @@ -386,6 +386,11 @@ activityFunc[Activity.ActivityType.PaySignIn] = { |
386 | 386 | ["init"] = function(self, actType, isCrossDay, notify) |
387 | 387 | self:updateActData(actType, {}, not notify) |
388 | 388 | end, |
389 | + ["crossDay"] = function(self, actType, notify) | |
390 | + local curData = self:getActData(actType) | |
391 | + curData[0] = (curData[0] or 0) + 1 | |
392 | + self:updateActData(actType, curData, not notify) | |
393 | + end, | |
389 | 394 | ["close"] = function(self, actType, notify) |
390 | 395 | self.owner.storeData:SetActGoodsFlag("paySignIn", 0) |
391 | 396 | |
... | ... | @@ -757,7 +762,7 @@ activityFunc[Activity.ActivityType.Crisis] = { |
757 | 762 | local reward |
758 | 763 | if actSet.loop == 1 then |
759 | 764 | local rcount = math.floor(status / actSet.condition1) |
760 | - local reward = actSet.reward:toNumMap() | |
765 | + reward = actSet.reward:toNumMap() | |
761 | 766 | for itemId, itemC in pairs(reward) do |
762 | 767 | reward[itemId] = itemC * rcount |
763 | 768 | end |
... | ... | @@ -766,6 +771,7 @@ activityFunc[Activity.ActivityType.Crisis] = { |
766 | 771 | reward = actSet.reward |
767 | 772 | status = -1 |
768 | 773 | end |
774 | + | |
769 | 775 | self.owner:award(reward, {log = {desc = "activity_crisis"}, notNotify = not notify}) |
770 | 776 | end |
771 | 777 | actData.task[id] = status | ... | ... |
src/models/Email.lua
... | ... | @@ -62,7 +62,11 @@ function Email:data() |
62 | 62 | end |
63 | 63 | |
64 | 64 | if attachments == "" and emailData.attachment ~= "" then |
65 | - attachments = emailData.attachment:format(table.unpack(rewardPms)) | |
65 | + if next(rewardPms) then | |
66 | + attachments = emailData.attachment:format(table.unpack(rewardPms)) | |
67 | + else | |
68 | + attachments = emailData.attachment | |
69 | + end | |
66 | 70 | end |
67 | 71 | end |
68 | 72 | ... | ... |
src/models/RoleTask.lua
... | ... | @@ -148,7 +148,7 @@ local CommonListener = { |
148 | 148 | [TaskType.AdvStartSelf] = {{24}}, |
149 | 149 | [TaskType.ShopAll] = {{25, f("count")}}, |
150 | 150 | [TaskType.RuneUp] = {{26}}, |
151 | - [TaskType.OpenBox] = {{27, 1, f("id")}}, | |
151 | + [TaskType.OpenBox] = {{27, f("count"), f("id")}}, | |
152 | 152 | [TaskType.AdvDraw] = {{28, f("count"), f("ptype")}}, |
153 | 153 | [TaskType.PotionMake] = {{29, f("count"), f("id")}}, |
154 | 154 | } |
... | ... | @@ -174,7 +174,7 @@ local AchievListener = { |
174 | 174 | [TaskType.FoodSellGold] = {{15, f("count")}}, |
175 | 175 | [TaskType.DinerPopular] = {{16, f("count")}}, |
176 | 176 | [TaskType.TowerPass] = {{17, f("level")}}, |
177 | - [TaskType.OpenBox] = {{18}}, | |
177 | + [TaskType.OpenBox] = {{18, f("count")}}, | |
178 | 178 | [TaskType.DinerLevelUp] = {{19, f("level"), f("type")}}, |
179 | 179 | [TaskType.DinerTalentUp] = {{20, 1, f("type")}}, |
180 | 180 | [TaskType.HangGetGold] = {{21, f("count")}}, |
... | ... | @@ -211,7 +211,7 @@ local SudokuListener = { |
211 | 211 | [TaskType.AdvDraw] = {{10, f("count")}}, |
212 | 212 | [TaskType.DinerLevelUp] = {{11, f("level"), f("type")}}, |
213 | 213 | [TaskType.FoodSell] = {{12, f("count")}}, |
214 | - [TaskType.OpenBox] = {{13, 1}}, | |
214 | + [TaskType.OpenBox] = {{13, f("count")}}, | |
215 | 215 | [TaskType.TowerPass] = {{14, f("level")}}, |
216 | 216 | [TaskType.PvpWin] = {{15, 1}}, |
217 | 217 | [TaskType.DinerTalentUp] = {{16, f("level"), f("type")}}, | ... | ... |
src/models/Store.lua
... | ... | @@ -392,6 +392,9 @@ function Store:onBuyPaySignCard(dur) |
392 | 392 | curTs = getServerOpenTs() |
393 | 393 | |
394 | 394 | self:SetActGoodsFlag("paySignIn", curTs) |
395 | + local actData = self.owner.activity:getActData("PaySignIn") | |
396 | + actData[0] = 1 | |
397 | + self.owner.activity:updateActData("PaySignIn", actData) | |
395 | 398 | |
396 | 399 | --local actGoodsFlag = self:getProperty("actGoodsFlag") or {} |
397 | 400 | --local goodsIndex = GetActGoodsIndex("paySignIn") | ... | ... |