Commit 57a73438853d08878a389bd7a94f190e31156565

Authored by zhouhaihai
2 parents ece07be5 e1b5f6ec

Merge branch 'bugfix' into tr/publish

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