Commit ba8b6160c812a04e50da801c68007bd5e1e94d2c

Authored by jiyue
2 parents 83734e23 9e5f9701

Merge branch 'cn/develop' into cn/publish/preview

src/actions/ActivityAction.lua
@@ -645,7 +645,7 @@ function _M.startBattleRpc(agent, data) @@ -645,7 +645,7 @@ function _M.startBattleRpc(agent, data)
645 award[k] = v * count 645 award[k] = v * count
646 end 646 end
647 local reward, change = role:award(award, {log = {desc = "actBattle", int1 = actid, int2 = count or 0}}) 647 local reward, change = role:award(award, {log = {desc = "actBattle", int1 = actid, int2 = count or 0}})
648 - SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change))) 648 +
649 changeFlag = true 649 changeFlag = true
650 actData["ticket"] = ticket - num 650 actData["ticket"] = ticket - num
651 651
@@ -665,11 +665,15 @@ function _M.startBattleRpc(agent, data) @@ -665,11 +665,15 @@ function _M.startBattleRpc(agent, data)
665 end 665 end
666 role:updateRankCommon(RANK_TYPE.ActBattleBoss, rankVal) 666 role:updateRankCommon(RANK_TYPE.ActBattleBoss, rankVal)
667 end 667 end
  668 + role.activity:updateActData("ChallengeLevel", actData)
668 669
  670 + SendPacket(actionCodes.Activity_startBattleRpc, MsgPack.pack(role:packReward(reward, change)))
  671 +
  672 + return true
669 end 673 end
670 - if changeFlag then  
671 - role.activity:updateActData("ChallengeLevel", actData)  
672 - end 674 + --if changeFlag then
  675 + -- role.activity:updateActData("ChallengeLevel", actData)
  676 + --end
673 677
674 return true 678 return true
675 end 679 end
src/actions/HttpAction.lua
@@ -143,7 +143,7 @@ function _M.gm_action(query) @@ -143,7 +143,7 @@ function _M.gm_action(query)
143 role:startActionUcode() 143 role:startActionUcode()
144 local status = gmFuncs[query.cmd](role, query) 144 local status = gmFuncs[query.cmd](role, query)
145 role:endActionUcode() 145 role:endActionUcode()
146 - role:update() 146 + role:saveRoleData()
147 147
148 return status 148 return status
149 end 149 end
@@ -174,6 +174,7 @@ function _M.pay_action(query) @@ -174,6 +174,7 @@ function _M.pay_action(query)
174 role:startActionUcode() 174 role:startActionUcode()
175 local status = gmFuncs[query.cmd](role, query) 175 local status = gmFuncs[query.cmd](role, query)
176 role:endActionUcode() 176 role:endActionUcode()
  177 + role:saveRoleData()
177 178
178 return status 179 return status
179 end 180 end
src/models/Activity.lua
@@ -497,6 +497,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = { @@ -497,6 +497,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = {
497 --role:checkTaskEnter("HangPass", {id = 0}) 497 --role:checkTaskEnter("HangPass", {id = 0})
498 role:checkCalendaTask(true, 15, 3) 498 role:checkCalendaTask(true, 15, 3)
499 role:checkTaskEnter("HeroStarCollect", {}) 499 role:checkTaskEnter("HeroStarCollect", {})
  500 + role:checkTaskEnter("HeroStartSum", {})
500 role:checkTaskEnter("RuneQualityCollect", {}) 501 role:checkTaskEnter("RuneQualityCollect", {})
501 502
502 end, 503 end,
@@ -565,6 +566,7 @@ activityFunc[Activity.ActivityType.BattleCommandTask] = { @@ -565,6 +566,7 @@ activityFunc[Activity.ActivityType.BattleCommandTask] = {
565 --role:checkTaskEnter("HangPass", {id = 0}) 566 --role:checkTaskEnter("HangPass", {id = 0})
566 role:checkCalendaTask(true, 15, 3) 567 role:checkCalendaTask(true, 15, 3)
567 role:checkTaskEnter("HeroStarCollect", {}) 568 role:checkTaskEnter("HeroStarCollect", {})
  569 + role:checkTaskEnter("HeroStartSum", {})
568 role:checkTaskEnter("RuneQualityCollect", {}) 570 role:checkTaskEnter("RuneQualityCollect", {})
569 571
570 end, 572 end,
@@ -669,6 +671,7 @@ activityFunc[Activity.ActivityType.NewUserTask] = { @@ -669,6 +671,7 @@ activityFunc[Activity.ActivityType.NewUserTask] = {
669 --role:checkTaskEnter("HangPass", {id = 0}) 671 --role:checkTaskEnter("HangPass", {id = 0})
670 role:checkCalendaTask(true, 15, 3) 672 role:checkCalendaTask(true, 15, 3)
671 role:checkTaskEnter("HeroStarCollect", {}) 673 role:checkTaskEnter("HeroStarCollect", {})
  674 + role:checkTaskEnter("HeroStartSum", {})
672 role:checkTaskEnter("RuneQualityCollect", {}) 675 role:checkTaskEnter("RuneQualityCollect", {})
673 676
674 end, 677 end,
src/models/RoleCross.lua
@@ -167,6 +167,7 @@ RoleCross.bind = function (Role) @@ -167,6 +167,7 @@ RoleCross.bind = function (Role)
167 }) 167 })
168 self:checkTaskEnter("Wake", {heroType = heroId, wakeL = initData.heros.wakeL}) 168 self:checkTaskEnter("Wake", {heroType = heroId, wakeL = initData.heros.wakeL})
169 self:checkTaskEnter("WakeCG", {heroType = heroId}) 169 self:checkTaskEnter("WakeCG", {heroType = heroId})
  170 + self:checkTaskEnter("WakeCGSum", {count = 1})
170 self:checkTaskEnter("HeroTalent", {heroType = heroId, alv = aheadLevel}) 171 self:checkTaskEnter("HeroTalent", {heroType = heroId, alv = aheadLevel})
171 172
172 end 173 end
src/models/RolePlugin.lua
@@ -32,6 +32,8 @@ function RolePlugin.bind(Role) @@ -32,6 +32,8 @@ function RolePlugin.bind(Role)
32 function Role:onOfflineEvent() 32 function Role:onOfflineEvent()
33 -- 设置最新的登录时间 33 -- 设置最新的登录时间
34 self:setProperty("ltime", skynet.timex()) 34 self:setProperty("ltime", skynet.timex())
  35 +
  36 + self:saveRoleData()
35 end 37 end
36 38
37 local function checkItemCount(self, itemId, count) 39 local function checkItemCount(self, itemId, count)
@@ -606,6 +608,7 @@ function RolePlugin.bind(Role) @@ -606,6 +608,7 @@ function RolePlugin.bind(Role)
606 } 608 }
607 if heroInfo.wakeL == 3 then 609 if heroInfo.wakeL == 3 then
608 self:checkTaskEnter("WakeCG", {heroType = heroType}) 610 self:checkTaskEnter("WakeCG", {heroType = heroType})
  611 + self:checkTaskEnter("WakeCGSum", {count = 1})
609 end 612 end
610 local newHero = require("models.Hero").new(heroInfo) 613 local newHero = require("models.Hero").new(heroInfo)
611 newHero:create() 614 newHero:create()
@@ -2051,10 +2054,10 @@ function RolePlugin.bind(Role) @@ -2051,10 +2054,10 @@ function RolePlugin.bind(Role)
2051 2054
2052 local SAVE_DATA_INTERVAL = 3 2055 local SAVE_DATA_INTERVAL = 3
2053 function Role:saveRoleData(now) 2056 function Role:saveRoleData(now)
2054 - if now - self._lastSaveTs < SAVE_DATA_INTERVAL then 2057 + if now and (now - self._lastSaveTs < SAVE_DATA_INTERVAL) then
2055 return 2058 return
2056 end 2059 end
2057 - self._lastSaveTs = now 2060 + self._lastSaveTs = now or skynet.timex()
2058 self:update() 2061 self:update()
2059 local objs = {self.activity, self.dailyData, self.dinerData, self.storeData, self.roleIncre} 2062 local objs = {self.activity, self.dailyData, self.dinerData, self.storeData, self.roleIncre}
2060 for _, info in ipairs(objs) do 2063 for _, info in ipairs(objs) do
src/models/RoleTask.lua
@@ -17,6 +17,9 @@ local TaskType = { @@ -17,6 +17,9 @@ local TaskType = {
17 HeroStarCollect = 12, -- 英雄星级收集进度 17 HeroStarCollect = 12, -- 英雄星级收集进度
18 DrawHeroNotFriend = 13, -- 非友情招募 -- count 18 DrawHeroNotFriend = 13, -- 非友情招募 -- count
19 DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count 19 DrawHeroLimitPack = 14, -- 抽卡限时礼貌 -- count
  20 + HeroStartSum = 15, -- 英雄星级总数
  21 + WakeCGSum = 16, -- 累计解锁xx张CG
  22 +
20 23
21 --装备相关 24 --装备相关
22 AddEquip = 101, -- 获得装备 - equipId rarity 25 AddEquip = 101, -- 获得装备 - equipId rarity
@@ -325,6 +328,8 @@ local CalendaTaskListener = { @@ -325,6 +328,8 @@ local CalendaTaskListener = {
325 [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}}, 328 [TaskType.ActBattlePass] = {{40, 3, f("chapterId")}},
326 [TaskType.AdvPass] = {{41, 3, f("id")}}, 329 [TaskType.AdvPass] = {{41, 3, f("id")}},
327 [TaskType.CostJade] = {{43, 1, f("count")}}, 330 [TaskType.CostJade] = {{43, 1, f("count")}},
  331 + [TaskType.HeroStartSum] = {{44, 3}},
  332 + [TaskType.WakeCGSum] = {{45, 1, f("count")}},
328 } 333 }
329 } 334 }
330 335
@@ -745,7 +750,7 @@ function RoleTask.bind(Role) @@ -745,7 +750,7 @@ function RoleTask.bind(Role)
745 for _,uid in pairs(hero:getRunes()) do 750 for _,uid in pairs(hero:getRunes()) do
746 if uid > 0 then 751 if uid > 0 then
747 local runeData = self.runeBag[uid] 752 local runeData = self.runeBag[uid]
748 - if runeData then 753 + if runeData then
749 local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")] 754 local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")]
750 755
751 if csvData and cfg.condition2 <= csvData.rarity then 756 if csvData and cfg.condition2 <= csvData.rarity then
@@ -765,9 +770,9 @@ function RoleTask.bind(Role) @@ -765,9 +770,9 @@ function RoleTask.bind(Role)
765 end 770 end
766 elseif cfg.type == 15 then -- 通关关卡 771 elseif cfg.type == 15 then -- 通关关卡
767 if (calTask[id] or 0) == 0 then 772 if (calTask[id] or 0) == 0 then
768 - if self:checkHangPass(cfg.condition2) then 773 + if self:checkHangPass(cfg.condition2) then
769 calTask[id] = 1 774 calTask[id] = 1
770 - end 775 + end
771 --local hangPass = self:getProperty("hangPass") 776 --local hangPass = self:getProperty("hangPass")
772 --local diff = math.floor(cfg.condition2 / 10000) 777 --local diff = math.floor(cfg.condition2 / 10000)
773 --if (hangPass[diff] or 0) >= cfg.condition2 then 778 --if (hangPass[diff] or 0) >= cfg.condition2 then
@@ -798,7 +803,7 @@ function RoleTask.bind(Role) @@ -798,7 +803,7 @@ function RoleTask.bind(Role)
798 elseif cfg.type == 37 then -- 拾荒使用道具 803 elseif cfg.type == 37 then -- 拾荒使用道具
799 if cfg.condition2 == param1 then 804 if cfg.condition2 == param1 then
800 calTask[id] = (calTask[id] or 0) + (param2 or 0) 805 calTask[id] = (calTask[id] or 0) + (param2 or 0)
801 - end 806 + end
802 elseif cfg.type == 38 then -- 和指定建筑交互 807 elseif cfg.type == 38 then -- 和指定建筑交互
803 local condArr = cfg.condition3:toArray(true, "=") 808 local condArr = cfg.condition3:toArray(true, "=")
804 for i = 0, #condArr do 809 for i = 0, #condArr do
@@ -827,6 +832,14 @@ function RoleTask.bind(Role) @@ -827,6 +832,14 @@ function RoleTask.bind(Role)
827 if cfg.condition2 <= param1 and param2 == 1 then 832 if cfg.condition2 <= param1 and param2 == 1 then
828 calTask[id] = (calTask[id] or 0) + 1 833 calTask[id] = (calTask[id] or 0) + 1
829 end 834 end
  835 + elseif cfg.type == 44 then --玩家拥有拾荒者总星级达到xxx
  836 + local count = 0
  837 + for _, hero in pairs(self.heros) do
  838 + count = count + hero:getProperty("wakeL")
  839 + end
  840 + if (calTask[id] or 0) < count then
  841 + calTask[id] = count
  842 + end
830 end 843 end
831 end 844 end
832 end 845 end