Commit e0bc1298540c74f04d6ebd856b4f606d6b8aa0c6

Authored by zhouhaihai
2 parents 66e696ae 4bd10b43

Merge branch 'bugfix' into develop

* bugfix: (22 commits)
  拾荒失败也要触发成就引导
  掉落活动配置最大掉落周期数
  拆解周活动跨轮数据异常bug
  道具开时钟箱,检查箱子够不够
  增加电台任务日志完成类型
  空的是nil
  appid
  讨伐电台日志增加 开始结束
  log 发现的bug
  bug
  取消抽卡保底的保底次数默认值,因为有些卡池不需要保底
  邮件
  活动奖励bug
  cb 返利调整
  世界boss 胜利才扣门票,扫荡根据之前的最大值给行动点
  任务
  付费签到规则改为按登录天数计算进度, 世界boss
  解锁条件修改
  活动卡池保底出指定英雄
  拆解术式充能的时候领取道具,获得个数计算错误
  ...

# Conflicts:
#	src/actions/RadioAction.lua
#	src/csvdata
src/GlobalVar.lua
... ... @@ -323,6 +323,7 @@ MailId = {
323 323 PaySignAward = 241,
324 324 PayBackAward = 242,
325 325 CBBackAward = 243,
  326 + CBBackAward2 = 244,
326 327 }
327 328  
328 329 TriggerEventType = {
... ...
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 -- 奖励
... ... @@ -378,6 +378,8 @@ function _M.hangDropRpc(agent, data)
378 378 local msg = MsgPack.unpack(data)
379 379 local actid = msg.actid
380 380 if not role.activity:isOpenById(actid, "HangDrop") then return 1 end
  381 + local actCtrlData = csvdb["activity_ctrlCsv"][actid]
  382 + if not actCtrlData then return end
381 383  
382 384 local actCfg = csvdb["activity_putCsv"][actid]
383 385 if not actCfg then return 2 end
... ... @@ -410,7 +412,7 @@ function _M.hangDropRpc(agent, data)
410 412 return 4
411 413 end
412 414 local num = math.floor((timeNow - actData)/ period)
413   - num = num > 8 and 8 or num
  415 + num = num > actCtrlData.condition and actCtrlData.condition or num
414 416 if num == 0 then
415 417 return 5
416 418 end
... ... @@ -528,6 +530,10 @@ function _M.startBattleRpc(agent, data)
528 530 local reward, change = role:award(award, {log = {desc = "actBattle", int1 = actid, int2 = count or 0}})
529 531 SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change)))
530 532  
  533 + if battleCfg.worldBoss_award ~= 0 and (bi["maxP"] or 0) > 0 then
  534 + bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"]
  535 + end
  536 +
531 537 bi["sum"] = bi["sum"] + bi["top"]
532 538 actData["ticket"] = ticket - num
533 539 actData[id] = bi
... ... @@ -659,7 +665,7 @@ function _M.endBattleRpc(agent, data)
659 665 battleInfo["star"] = curStar
660 666 end
661 667  
662   - if battleCfg.rank ~= 0 then
  668 + if battleCfg.rank ~= 0 and isWin then
663 669 -- 消耗门票
664 670 role.activity:getBattleTicket(actid)
665 671 local num = battleCfg.type:toArray(true, "=")[3]
... ... @@ -678,8 +684,6 @@ function _M.endBattleRpc(agent, data)
678 684 role:updateRankCommon(RANK_TYPE.ActBattleBoss, rankVal)
679 685 end
680 686 end
681   - actData[id] = battleInfo
682   - role.activity:updateActData("ChallengeLevel", actData)
683 687  
684 688 if (oldStarNum == 0 and newStarNum > 0) or battleCfg.rank ~= 0 then
685 689 reward = battleCfg.item_clear:toNumMap()
... ... @@ -708,7 +712,10 @@ function _M.endBattleRpc(agent, data)
708 712  
709 713 if battleCfg.worldBoss_award ~= 0 and msg.point then
710 714 battleInfo["bossP"] = (battleInfo["bossP"] or 0) + msg.point
  715 + battleInfo["maxP"] = math.max(msg.point, (battleInfo["maxP"] or 0))
711 716 end
  717 + actData[id] = battleInfo
  718 + role.activity:updateActData("ChallengeLevel", actData)
712 719  
713 720 reward, change = role:award(reward, {log = {desc = "actBattle", int1 = actid, int2 = newStarNum}})
714 721  
... ... @@ -837,6 +844,10 @@ function _M.bossRewardRpc(agent, data)
837 844 if bossPoint < 1 then return 7 end
838 845  
839 846 local bossRecord = battleInfo["bossR"] or ""
  847 + local r = string.char(string.getbit(bossRecord, index))
  848 + if r == "1" then
  849 + return 9
  850 + end
840 851 local ok = false
841 852 if #preList == 0 then
842 853 ok = true
... ... @@ -852,6 +863,7 @@ function _M.bossRewardRpc(agent, data)
852 863 if not ok then return 8 end
853 864  
854 865 battleInfo["bossR"] = string.setbit(bossRecord, index)
  866 + battleInfo["bossP"] = bossPoint - 1
855 867 actData[id] = battleInfo
856 868 role.activity:updateActData("ChallengeLevel", actData)
857 869  
... ...
src/actions/HangAction.lua
... ... @@ -560,10 +560,10 @@ function _M.startBonusBattleRpc(agent, data)
560 560 end
561 561  
562 562 if not bonusData then return 3 end
563   - if not role:checkHangPass(bonusData.unlock) then return 4 end
  563 + local bonusStar = role:getProperty("bonusStar")
564 564  
  565 + if bonusData.unlock ~= 0 and (not bonusStar[bonusData.unlock] or bonusStar[bonusData.unlock] == 0) then return 4 end
565 566  
566   - local bonusStar = role:getProperty("bonusStar")
567 567 if bonusStar[id] and bonusStar[id] >= (1 << #bonusData.sweep_condition:toTableArray(true)) - 1 then
568 568 local bonusC = role.dailyData:getProperty("bonusC")
569 569 bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0}
... ...
src/actions/HeroAction.lua
... ... @@ -724,6 +724,9 @@ function _M.drawHeroRpc(agent, data)
724 724 subType = 1
725 725 if btype == 4 and role:getProperty("newerDraw") >= 10 then
726 726 subType = 2
  727 + if(role:getProperty("newerDraw") >= 30) then
  728 + return 30
  729 + end
727 730 end
728 731 end
729 732  
... ... @@ -993,7 +996,7 @@ function _M.drawHeroRpc(agent, data)
993 996 local even = repayHeroMaxCount % 2
994 997 local id = 0
995 998 if even == 1 then
996   - id = math.randWeight(csvdb["build_giftCsv"], "pool_1")
  999 + id = math.randWeight(csvdb["build_giftCsv"], "pool_"..feedbackId)
997 1000 else
998 1001 local giftHeroSet = {}
999 1002 for gid, cfg in pairs(csvdb["build_giftCsv"]) do
... ... @@ -1006,7 +1009,7 @@ function _M.drawHeroRpc(agent, data)
1006 1009 end
1007 1010 end
1008 1011 if id == 0 then
1009   - id = math.randWeight(csvdb["build_giftCsv"], "pool_1")
  1012 + id = math.randWeight(csvdb["build_giftCsv"], "pool_"..feedbackId)
1010 1013 end
1011 1014  
1012 1015 local r,change = {}
... ...
src/actions/RadioAction.lua
... ... @@ -102,6 +102,25 @@ function _M.startQuestRpc(agent, data)
102 102 role:updateProperty({field="radioTask", value=radioTask, notNotify=true})
103 103  
104 104 SendPacket(actionCodes.Radio_startQuestRpc, MsgPack.pack({id=id, task=taskData}))
  105 +
  106 + local herolist = {}
  107 + for _, heroId in ipairs(heros) do
  108 + local hero = role.heros[heroId]
  109 + if hero then
  110 + table.insert(herolist, hero:getProperty("type"))
  111 + end
  112 + end
  113 +
  114 + -- 讨伐行动
  115 + role:log("punitive_action", {
  116 + mission_id = id, --关卡ID
  117 + mission_herolist = herolist, -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555]
  118 + mission_success_rate = 0, -- 大成功几率
  119 + mission_reward = {}, -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
  120 + mission_result = 0, -- 战斗结果(0-无效,1-胜利,2-失败)
  121 + mission_roundtime = 0, -- 完成耗时(秒)
  122 + mission_cleartype = 1, -- 1-开始; 2-完成(领取奖励时)
  123 + })
105 124 return true
106 125 end
107 126  
... ... @@ -177,7 +196,8 @@ function _M.finishQuestRpc(agent, data)
177 196 mission_success_rate = totalCoef, -- 大成功几率
178 197 mission_reward = r, -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
179 198 mission_result = 1, -- 战斗结果(0-无效,1-胜利,2-失败)
180   - mission_roundtime = config.time, -- 完成耗时(秒)
  199 + mission_roundtime = config.time, -- 完成耗时(秒)
  200 + mission_cleartype = 2, -- 1-开始; 2-完成(领取奖励时)
181 201 })
182 202  
183 203 return true
... ...
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
... ... @@ -607,6 +611,8 @@ function _M.openTimeBoxRpc(agent, data)
607 611 local costKey = math.ceil((stopTime - nowTime) / (cost_pre[1] * 60)) * cost_pre[2]
608 612 if not role:checkItemEnough({[ItemId.Diamond] = costKey}) then return 5 end
609 613 role:costItems({[ItemId.Diamond] = costKey}, {log = {desc = "openTimeBox", int1 = slot}})
  614 + else
  615 + stopTime = math.min(nowTime,time + globalCsv.box_productLine_time * 3600)
610 616 end
611 617 role:pushCancel({type = "box", slot = slot})
612 618  
... ... @@ -634,6 +640,7 @@ function _M.openTimeBoxRpc(agent, data)
634 640 end
635 641  
636 642 if role:getItemCount(costId) < count then return 8 end
  643 + if not role:checkItemEnough(costs) then return 9 end
637 644  
638 645 role:costItems({[costId] = count}, {log = {desc = "openTimeBox"}})
639 646  
... ...
src/adv/Adv.lua
... ... @@ -847,10 +847,10 @@ function Adv:over(success, rewardRatio, overType)
847 847 red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo))
848 848 end)
849 849 end
850   - -- 通关的时候要把引导步骤设定到成就引导
851   - if not self.owner:checkOverGuide(57) then
852   - self.owner:saveGuide(57,1,true)
853   - end
  850 + end
  851 + -- 通关的时候要把引导步骤设定到成就引导
  852 + if not self.owner:checkOverGuide(57) then
  853 + self.owner:saveGuide(57,1,true)
854 854 end
855 855 self:clearAdvUnlockCache()
856 856  
... ...
src/models/Activity.lua
... ... @@ -61,7 +61,7 @@ Activity.schema = {
61 61 actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time}
62 62 round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum}
63 63 act4 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动
64   - act6 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动
  64 + act6 = {"table", {}}, -- {0 = day, 1 = 1, 2 = 1} == 付费签到活动
65 65 act8 = {"number", 0}, -- 充值返利
66 66  
67 67 act11 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励
... ... @@ -287,38 +287,56 @@ function Activity:checkWeeklyAct(actType, notify, count, pool)
287 287 local totalCnt = 0
288 288 local finishCnt = 0
289 289 local maxCondition = 0
290   - for k, cfg in pairs(csvdb[info.table] or {}) do
291   - totalCnt = totalCnt + 1
292   - if maxCondition < cfg.condition1 then
293   - maxCondition = cfg.condition1
294   - end
295   - if not curData[cfg.id] and curData[0] >= cfg.condition1 then
296   - if info.mailId then
  290 + local flag = true
  291 + while flag do
  292 + --print("tatal number :", curData[0])
  293 + for i = 1, #csvdb[info.table] do
  294 + local cfg = csvdb[info.table][i]
  295 + --for k, cfg in pairs(csvdb[info.table] or {}) do
  296 + totalCnt = totalCnt + 1
  297 + if maxCondition < cfg.condition1 then
  298 + maxCondition = cfg.condition1
  299 + end
  300 + --print("cur condition", cfg.condition1)
  301 + if curData[0] < cfg.condition1 then
  302 + flag = false
  303 + break
  304 + end
297 305  
298   - self.owner:log("activity", {
299   - activity_id = cfg.id, -- 活动ID(或活动指定任务的ID)
300   - activity_type = actType, -- 活动类型,见活动类型枚举表
301   - activity_reward = cfg.reward:toNumMap(), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
302   - })
  306 + --print(curData[0], cfg.condition1)
  307 + if not curData[cfg.id] and curData[0] >= cfg.condition1 then
  308 + if info.mailId then
303 309  
304   - self.owner:sendMail(info.mailId, nil, cfg.reward, {cfg.condition1})
305   - curData[cfg.id] = 1
  310 + self.owner:log("activity", {
  311 + activity_id = cfg.id, -- 活动ID(或活动指定任务的ID)
  312 + activity_type = actType, -- 活动类型,见活动类型枚举表
  313 + activity_reward = cfg.reward:toNumMap(), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  314 + })
  315 +
  316 + self.owner:sendMail(info.mailId, nil, cfg.reward, {cfg.condition1})
  317 + curData[cfg.id] = 1
  318 + end
  319 + end
  320 + if curData[cfg.id] then
  321 + finishCnt = finishCnt + 1
306 322 end
307 323 end
308   - if curData[cfg.id] then
309   - finishCnt = finishCnt + 1
310   - end
311   - end
312   - if totalCnt == finishCnt then
313   - roundData[actType] = curRound + 1
314   - for k,v in pairs(curData) do
315   - if k == 0 then
316   - curData[k] = curData[0] >= maxCondition and curData[0] - maxCondition or 0
317   - else
318   - curData[k] = nil
  324 + if totalCnt == finishCnt then
  325 + roundData[actType] = (roundData[actType] or 0) + 1
  326 + for k,v in pairs(curData) do
  327 + if k == 0 then
  328 + curData[k] = curData[0] >= maxCondition and curData[0] - maxCondition or 0
  329 + else
  330 + curData[k] = nil
  331 + end
  332 + end
  333 + --print("cur round ".. roundData[actType], ctrlData.condition)
  334 + if roundData[actType] >= ctrlData.condition then
  335 + curData[0] = maxCondition
  336 + flag = false
319 337 end
  338 + self:updateProperty({field = "round", value = roundData, notNotify = not notify})
320 339 end
321   - self:updateProperty({field = "round", value = roundData, notNotify = not notify})
322 340 end
323 341 self:updateActData(actType, curData, not notify)
324 342 end
... ... @@ -396,6 +414,11 @@ activityFunc[Activity.ActivityType.PaySignIn] = {
396 414 ["init"] = function(self, actType, isCrossDay, notify)
397 415 self:updateActData(actType, {}, not notify)
398 416 end,
  417 + ["crossDay"] = function(self, actType, notify)
  418 + local curData = self:getActData(actType)
  419 + curData[0] = (curData[0] or 0) + 1
  420 + self:updateActData(actType, curData, not notify)
  421 + end,
399 422 ["close"] = function(self, actType, notify)
400 423 self.owner.storeData:SetActGoodsFlag("paySignIn", 0)
401 424  
... ... @@ -807,7 +830,7 @@ activityFunc[Activity.ActivityType.Crisis] = {
807 830 local reward
808 831 if actSet.loop == 1 then
809 832 local rcount = math.floor(status / actSet.condition1)
810   - local reward = actSet.reward:toNumMap()
  833 + reward = actSet.reward:toNumMap()
811 834 for itemId, itemC in pairs(reward) do
812 835 reward[itemId] = itemC * rcount
813 836 end
... ... @@ -816,6 +839,7 @@ activityFunc[Activity.ActivityType.Crisis] = {
816 839 reward = actSet.reward
817 840 status = -1
818 841 end
  842 +
819 843 self.owner:award(reward, {log = {desc = "activity_crisis"}, notNotify = not notify})
820 844 end
821 845 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/RoleLog.lua
... ... @@ -508,11 +508,12 @@ local MethodType = {
508 508 },
509 509 punitive_action = { -- 讨伐行动 --TODO
510 510 mission_id = true, --关卡ID
511   - mission_herolist = true, -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555]
  511 + mission_herolist = "json", -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555]
512 512 mission_success_rate = true, -- 大成功几率
513   - mission_reward = true, -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
  513 + mission_reward = "json", -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
514 514 mission_result = true, -- 战斗结果(0-无效,1-胜利,2-失败)
515 515 mission_roundtime = true, -- 完成耗时(秒)
  516 + mission_cleartype = true, -- 1-开始; 2-完成(领取奖励时)
516 517 },
517 518 hero_talent = { --英雄精进(原英雄天赋升级) TODO
518 519 hero_id = true, --英雄ID
... ...
src/models/RolePlugin.lua
... ... @@ -390,13 +390,14 @@ function RolePlugin.bind(Role)
390 390 if not self:costDiamond(pms) then
391 391 return
392 392 end
393   - itemCountT[ItemId.Diamond] = nil
394 393 end
395 394 for itemId, count in pairs(itemCountT) do
396   - pms.itemId = itemId
397   - pms.count = - count
398   - self:addItem(pms)
399   - self:itemDeltaEvent(pms)
  395 + if itemId ~= ItemId.Diamond then
  396 + pms.itemId = itemId
  397 + pms.count = - count
  398 + self:addItem(pms)
  399 + self:itemDeltaEvent(pms)
  400 + end
400 401 end
401 402 return true
402 403 end
... ... @@ -1396,7 +1397,7 @@ function RolePlugin.bind(Role)
1396 1397 end
1397 1398 format.heros = heros
1398 1399 format.supports = team.supports or {}
1399   - format.tactics = team.tactics or {}
  1400 + format.tactics = team.tactics or nil
1400 1401 return format
1401 1402 end
1402 1403  
... ...
src/models/RoleTask.lua
... ... @@ -154,7 +154,7 @@ local CommonListener = {
154 154 [TaskType.AdvStartSelf] = {{24}},
155 155 [TaskType.ShopAll] = {{25, f("count")}},
156 156 [TaskType.RuneUp] = {{26}},
157   - [TaskType.OpenBox] = {{27, 1, f("id")}},
  157 + [TaskType.OpenBox] = {{27, f("count"), f("id")}},
158 158 [TaskType.AdvDraw] = {{28, f("count"), f("ptype")}},
159 159 [TaskType.PotionMake] = {{29, f("count"), f("id")}},
160 160 }
... ... @@ -180,7 +180,7 @@ local AchievListener = {
180 180 [TaskType.FoodSellGold] = {{15, f("count")}},
181 181 [TaskType.DinerPopular] = {{16, f("count")}},
182 182 [TaskType.TowerPass] = {{17, f("level")}},
183   - [TaskType.OpenBox] = {{18}},
  183 + [TaskType.OpenBox] = {{18, f("count")}},
184 184 [TaskType.DinerLevelUp] = {{19, f("level"), f("type")}},
185 185 [TaskType.DinerTalentUp] = {{20, 1, f("type")}},
186 186 [TaskType.HangGetGold] = {{21, f("count")}},
... ... @@ -217,7 +217,7 @@ local SudokuListener = {
217 217 [TaskType.AdvDraw] = {{10, f("count")}},
218 218 [TaskType.DinerLevelUp] = {{11, f("level"), f("type")}},
219 219 [TaskType.FoodSell] = {{12, f("count")}},
220   - [TaskType.OpenBox] = {{13, 1}},
  220 + [TaskType.OpenBox] = {{13, f("count")}},
221 221 [TaskType.TowerPass] = {{14, f("level")}},
222 222 [TaskType.PvpWin] = {{15, 1}},
223 223 [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")
... ...