From fa38c9d4ae3b0564ee8abfa829d669acc46bab9e Mon Sep 17 00:00:00 2001 From: 熊润斐 <597414876@qq.com> Date: Mon, 12 Oct 2020 20:44:38 +0800 Subject: [PATCH] Revert "Squashed commit of the following:" --- src/ProtocolCode.lua | 1 - src/actions/ActivityAction.lua | 38 -------------------------------------- src/actions/AdvAction.lua | 6 +----- src/actions/DinerAction.lua | 4 ---- src/actions/HangAction.lua | 31 +++++++++++-------------------- src/actions/HeroAction.lua | 13 ------------- src/actions/RoleAction.lua | 91 +++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- src/csvdata | 2 +- src/models/Activity.lua | 32 -------------------------------- src/models/Diner.lua | 3 --- src/models/Role.lua | 4 ---- src/models/RoleLog.lua | 1 - src/models/RolePlugin.lua | 30 ------------------------------ src/models/RoleTask.lua | 82 ++-------------------------------------------------------------------------------- src/utils/CommonFunc.lua | 4 ++-- 15 files changed, 58 insertions(+), 284 deletions(-) diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index aeb0675..f7d3b6e 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -208,7 +208,6 @@ actionCodes = { Activity_sudokuRewardRpc = 652, Activity_actSignRpc = 653, Activity_actPaySignRewardNtf = 654, - Activity_actCalendaTaskRpc = 655, } rpcResponseBegin = 10000 diff --git a/src/actions/ActivityAction.lua b/src/actions/ActivityAction.lua index 2f1cd23..ea8eb58 100644 --- a/src/actions/ActivityAction.lua +++ b/src/actions/ActivityAction.lua @@ -222,42 +222,4 @@ function _M.actPaySignRpc(agent, data) return true end -function _M.actCalendaTaskRpc(agent, data) - local role = agent.role - local msg = MsgPack.unpack(data) - local taskId = msg.id - local calTask = role:getProperty("calTask") or {} - local record = calTask["r"] or {} - local flag = record[taskId] or 0 - if flag == 1 then return 1 end - local open, actId = role.activity:isOpen("CalendaTask") - local actData = csvdb["activity_ctrlCsv"][actId] - if not open then return 2 end - if not actData then return 3 end - - local taskList = csvdb["activity_taskCsv"][actData.condition] - if not taskList then return 4 end - local taskCfg = taskList[taskId] - if not taskCfg then return 5 end - if taskCfg.key ~= actData.condition then return 6 end - - if (calTask[taskId] or 0) < taskCfg.condition1 then return 7 end - - record[taskId] = 1 - calTask["r"] = record - - role:updateProperty({field = "calTask", value = calTask}) - - local reward, change = role:award(taskCfg.reward, {log = {desc = "calendaTask"}}) - - role:log("activity", { - activity_id = taskId, -- 活动ID(或活动指定任务的ID) - activity_type = role.activity.ActivityType.CalendaTask, -- 活动类型,见活动类型枚举表 - activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} - }) - - SendPacket(actionCodes.Activity_actCalendaTaskRpc, MsgPack.pack(role:packReward(reward, change))) - return true -end - return _M \ No newline at end of file diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index 5308b88..b349007 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -250,7 +250,7 @@ function _M.startHangRpc(agent, data) if not role:getAdvData():isRunning() then role:updateProperty({field = "advTeam", value = {}}) end - role:pushMsg({type = "adv", slot = chapterId, time = adv_idle_time}) + role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) role:changeAdvCount(adv_idle_energy) @@ -295,7 +295,6 @@ function _M.quickHangRpc(agent, data) info.time = 0 role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) - role:pushCancel({type = "adv", slot = chapterId}) role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) SendPacket(actionCodes.Adv_quickHangRpc, '') @@ -372,7 +371,6 @@ function _M.endHangRpc(agent, data) -- else -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel}) -- end - role:pushCancel({type = "adv", slot = chapterId}) else return end @@ -382,8 +380,6 @@ function _M.endHangRpc(agent, data) role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0}) - role:checkTaskEnter("AdvHang", {}) - SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) return true end diff --git a/src/actions/DinerAction.lua b/src/actions/DinerAction.lua index f10bf53..646298d 100644 --- a/src/actions/DinerAction.lua +++ b/src/actions/DinerAction.lua @@ -75,9 +75,6 @@ function _M.addSellRpc( agent, data ) sells[slot].count = count sells[slot].time = skynet.timex() - calSell.deltaTime - local needTime = sells[slot].count * dishData.sell_time + sells[slot].time - skynet.timex() - role:pushMsg({type = "food", slot = slot, time = needTime}) - -- 检查解锁的顾客 local had = {} for _, sell in pairs(sells) do @@ -158,7 +155,6 @@ function _M.removeSellRpc( agent, data ) reward, change = role:award(reward, {log = {desc = "removeSell"}}) sells[slot].count = 0 - role:pushCancel({type = "food", slot = slot}) role:log("restaurant_sale", { item_id = dish, -- 售卖物品ID restaurant_sale_seat = slot, -- 售卖物品所在位置 diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 4351089..12c1ed9 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -22,7 +22,6 @@ local function checkReward(role) return false end local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] local nowCoinTime = math.min(skynet.timex(), hangInfo.endCoinTime or 0) local nowItemTime = math.min(skynet.timex(), hangInfo.endItemTime or 0) @@ -40,9 +39,9 @@ local function checkReward(role) local items = role:getProperty("hangBag") coinCount = coinCount + coinDoubleCount - items[ItemId.Gold] = math.floor((items[ItemId.Gold] or 0) + coinCount * expCarbonData.money) - items[ItemId.Exp] = math.floor((items[ItemId.Exp] or 0) + coinCount * expCarbonData.exp) - items[ItemId.PlayerExp] = math.floor((items[ItemId.PlayerExp] or 0) + coinCount * expCarbonData.playerExp) + items[ItemId.Gold] = math.floor((items[ItemId.Gold] or 0) + coinCount * carbonData.money) + items[ItemId.Exp] = math.floor((items[ItemId.Exp] or 0) + coinCount * carbonData.exp) + items[ItemId.PlayerExp] = math.floor((items[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) local pool = {} for _, temp in pairs(carbonData.item:toArray()) do @@ -140,7 +139,6 @@ function _M.startRpc( agent, data ) local hangInfo = role:getProperty("hangInfo") local isNew = not hangInfo.carbonId hangInfo.carbonId = carbonId - hangInfo.expCarbonId = isNew and carbonId or hangInfo.expCarbonId local nowTime = skynet.timex() if isNew then hangInfo.coinTime = nowTime @@ -151,14 +149,11 @@ function _M.startRpc( agent, data ) hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime) hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime) end - - role:pushMsg({type = "hang", time = math.min(hangInfo.endCoinTime - nowTime, hangInfo.endItemTime - nowTime)}) if not role:checkHangPass(carbonId) then hangInfo.bossTime = nowTime + carbonData.idle_time else hangInfo.bossTime = nil end - role:updateProperty({field = "hangInfo", value = hangInfo}) -- 指定当前引导的步骤 @@ -198,7 +193,7 @@ function _M.startBattleRpc(agent, data) return 1 end - local hangInfo = role:getProperty("hangInfo") or {} + local hangInfo = role:getProperty("hangInfo") if curData.main ~= 1 then if carbonId ~= hangInfo.carbonId then return 2 @@ -219,7 +214,7 @@ end function _M.endBattleRpc(agent, data) local role = agent.role local msg = MsgPack.unpack(data) - local hangInfo = role:getProperty("hangInfo") or {} + local hangInfo = role:getProperty("hangInfo") if not msg.key or msg.key ~= _BattleKey then SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1})) return true @@ -230,7 +225,6 @@ function _M.endBattleRpc(agent, data) if not carbonData then return 2 end - if carbonData.main ~= 1 then if carbonId ~= hangInfo.carbonId then return 3 @@ -279,8 +273,8 @@ function _M.endBattleRpc(agent, data) end local nextCarbonId = role:getNextCarbonId(carbonId) -- 设置挂机关卡 - if isWin and (hangInfo.carbonId or 0) < nextCarbonId then - hangInfo.expCarbonId = nextCarbonId + if isWin and hangInfo.carbonId < nextCarbonId then + hangInfo.carbonId = nextCarbonId local cfg = csvdb["idle_battleCsv"][nextCarbonId] if cfg then hangInfo.bossTime = skynet.timex() + cfg.idle_time @@ -360,9 +354,7 @@ function _M.getRewardRpc(agent , data) hangInfo.itemTime = nowTime role:updateProperty({field = "hangBag", value = items}) role:updateProperty({field = "hangInfo", value = hangInfo}) - role:pushMsg({type = "hang", time = globalCsv.idle_producetime_max}) - - role:checkTaskEnter("HangGet", {reward = reward}) + role:checkTaskEnter("HangGet") if reward[ItemId.Gold] then role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) end @@ -390,7 +382,6 @@ function _M.quickRpc(agent , data) local hangInfo = role:getProperty("hangInfo") if not hangInfo.carbonId then return end local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] local curCount = role.dailyData:getProperty("hangQC") + 1 local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=") @@ -407,9 +398,9 @@ function _M.quickRpc(agent , data) local coinCount = math.floor(time / globalCsv.idle_money_produce_cd) local itemCount = math.floor(time / globalCsv.idle_item_produce_cd) - reward[ItemId.Gold] = math.floor((reward[ItemId.Gold] or 0) + coinCount * expCarbonData.money) - reward[ItemId.Exp] = math.floor((reward[ItemId.Exp] or 0) + coinCount * expCarbonData.exp) - reward[ItemId.PlayerExp] = math.floor((reward[ItemId.PlayerExp] or 0) + coinCount * expCarbonData.playerExp) + reward[ItemId.Gold] = math.floor((reward[ItemId.Gold] or 0) + coinCount * carbonData.money) + reward[ItemId.Exp] = math.floor((reward[ItemId.Exp] or 0) + coinCount * carbonData.exp) + reward[ItemId.PlayerExp] = math.floor((reward[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) local pool = {} for _, temp in pairs(carbonData.item:toArray()) do diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index eab507d..1807342 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -60,8 +60,6 @@ function _M.levelUpRpc( agent, data ) hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")}) role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) - - role:checkTaskEnter("HeroLvlCollect", {}) SendPacket(actionCodes.Hero_levelUpRpc, '') return true end @@ -130,8 +128,6 @@ function _M.wakeRpc(agent, data) }) SendPacket(actionCodes.Hero_wakeRpc, '') - - role:checkTaskEnter("HeroStarCollect", {}) return true end @@ -599,8 +595,6 @@ function _M.referRunesRpc(agent, data) }) end end - - role:checkTaskEnter("RuneQualityCollect", {}) SendPacket(actionCodes.Hero_referRunesRpc, "") return true @@ -734,13 +728,6 @@ function _M.drawHeroRpc(agent, data) if btype ~= 1 then subType = 1 end - - if btype == 1 then - -- 判断定向卡池活动开启 - if not role.activity:isOpen("RaceDraw") then - return - end - end local buildTypeData = csvdb["build_typeCsv"][btype] if not buildTypeData then return 2 end diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index c6d011c..c0a4500 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -121,9 +121,6 @@ function _M.loginRpc( agent, data ) role:setProperty("device", device) end end - if msg.token then - role._pushToken = msg.token - end if not msg.isGMlogin then local banTime = role:getProperty("banTime") @@ -553,7 +550,7 @@ function _M.openTimeBoxRpc(agent, data) if boxL[slot] then return end role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}}) boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} - role:pushMsg({type = "box", slot = slot, time = randomData.openTime}) + elseif oper == 2 then -- 领取 local quick = msg.quick if not boxL[slot] then return end @@ -564,7 +561,6 @@ function _M.openTimeBoxRpc(agent, data) costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) - role:pushCancel({type = "box", slot = slot}) end local boxId = boxL[slot].id local itemData = csvdb["itemCsv"][boxId] @@ -619,57 +615,52 @@ end function _M.openSpeedUpBoxRpc(agent, data) local role = agent.role local msg = MsgPack.unpack(data) - local itemInfo = msg.itemInfo + + local id = msg.id + local count = msg.count + local itemData = csvdb["itemCsv"][id] + if not itemData or itemData.type ~= ItemType.SpeedBox then return end + + if math.illegalNum(count, 1, role:getItemCount(id)) then return end + local useType, hour = table.unpack(itemData.use_effect:toArray(true, "=")) + local time = hour * 60 * 60 local reward = {} - for i = 1, #itemInfo do - local pair = itemInfo[i] - local id = pair[1] - local count = pair[2] - local itemData = csvdb["itemCsv"][id] - if not itemData or itemData.type ~= ItemType.SpeedBox then return end - - if math.illegalNum(count, 1, role:getItemCount(id)) then return 1 end - local useType, hour = table.unpack(itemData.use_effect:toArray(true, "=")) - local time = hour * 60 * 60 - - if useType == 1 then -- 挂机齿轮 - local hangInfo = role:getProperty("hangInfo") - if not hangInfo.expCarbonId then - return 2 - end - local carbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] - reward[ItemId.Gold] = (reward[ItemId.Gold] or 0) + math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.money * count - elseif useType == 2 then -- 挂机经验 - local hangInfo = role:getProperty("hangInfo") - if not hangInfo.expCarbonId then - return 3 - end - local carbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] - reward[ItemId.Exp] = (reward[ItemId.Exp] or 0) + math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.exp * count - elseif useType == 3 then -- 食材商人收入 - local buildType = 6 - local level = role.dinerData:getProperty("buildL"):getv(buildType, 1) - local buildingData = csvdb["diner_buildingCsv"][buildType][level] - if not buildingData then - return 4 - end - local gfood = role.dinerData:getProperty("gfood") - if not next(gfood) then return 5 end - for k , v in pairs(gfood) do - local itemId = v.id - local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * buildingData.speed / 100 - reward[itemId] = (reward[itemId] or 0) + math.floor(time / speed) * count - end - else - return 6 + if useType == 1 then -- 挂机齿轮 + local hangInfo = role:getProperty("hangInfo") + if not hangInfo.carbonId then + return end - - role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) + local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] + reward[ItemId.Gold] = math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.money * count + elseif useType == 2 then -- 挂机经验 + local hangInfo = role:getProperty("hangInfo") + if not hangInfo.carbonId then + return + end + local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] + reward[ItemId.Exp] = math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.exp * count + elseif useType == 3 then -- 食材商人收入 + local buildType = 6 + local level = role.dinerData:getProperty("buildL"):getv(buildType, 1) + local buildingData = csvdb["diner_buildingCsv"][buildType][level] + if not buildingData then + return 1 + end + local gfood = role.dinerData:getProperty("gfood") + if not next(gfood) then return end + for k , v in pairs(gfood) do + local itemId = v.id + local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * buildingData.speed / 100 + reward[itemId] = math.floor(time / speed) * count + end + else + return end + role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) local change - reward, change = role:award(reward, {log = {desc = "speedUpBox"}}) + reward, change = role:award(reward, {log = {desc = "speedUpBox"}, int1 = id, int2 = count}) SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack(role:packReward(reward, change))) return true diff --git a/src/csvdata b/src/csvdata index d54c7ca..9bb26cf 160000 --- a/src/csvdata +++ b/src/csvdata @@ -1 +1 @@ -Subproject commit d54c7ca07fd397022166b38b58b80a78f339f592 +Subproject commit 9bb26cfdb11f81dbfe6abbc468b44ca9f814deb2 diff --git a/src/models/Activity.lua b/src/models/Activity.lua index 6630e3d..a6f9b99 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -18,7 +18,6 @@ Activity.ActivityType = { DrawHero = 12, --抽卡周 招募 AdvDraw = 13, --拾荒抽周 资助 OpenBox = 14, --拆解周 时钟箱 - RaceDraw = 15, -- 定向招募活动 } @@ -368,37 +367,6 @@ activityFunc[Activity.ActivityType.PayBack] = { -- end, } --- 英雄帖 -activityFunc[Activity.ActivityType.CalendaTask] = { - ["init"] = function(self, actType, isCrossDay, notify) - local calTask = self.owner:getProperty("CalTask") - calTask = {} - local role = self.owner - local buildL = role.dinerData:getProperty("buildL") - local curLevel = buildL:getv(1, 1) - role:checkTaskEnter("DinerLevelUp", {level = curLevel}) - - role:checkTaskEnter("HeroLvlCollect", {}) - role:checkTaskEnter("HeroQualityCollect", {}) - - local curPopular = role.dinerData:getProperty("popular") - role:checkTaskEnter("DinerPopular", {count = curPopular}) - - local rLevel = role:getProperty("level") - role:checkTaskEnter("RoleLevelUp", {level = rLevel}) - - local towerInfo = role:getProperty("towerInfo") - role:checkTaskEnter("TowerPass", {level = towerInfo.l}) - --"PvpWin" - role:checkTaskEnter("HangPass", {}) - role:checkTaskEnter("HeroStarCollect", {}) - role:checkTaskEnter("RuneQualityCollect", {}) - - end, - -- ["close"] = function(self, actType, notify) - -- end, -} - function Activity:initActivity(actId, isCrossDay, notify) local actData = csvdb["activity_ctrlCsv"][actId] if not actData then return end diff --git a/src/models/Diner.lua b/src/models/Diner.lua index 9e744e5..57cb7b1 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -298,9 +298,6 @@ function Diner:expediteSell(slot) self:checkDinerTask(DinerTask.SellDishType, expediteCount, math.ceil(sell.dish / 100)) self:checkDinerTask(DinerTask.SellDishRare, expediteCount, dishData.rarity) self.owner:checkTaskEnter("FoodSell", {count = expediteCount}) - - local needTime = sells[slot].count * dishData.sell_time + sells[slot].time - skynet.timex() - self.owner:pushMsg({type = "food", slot = slot, time = needTime}) end return { expediteCount = expediteCount, diff --git a/src/models/Role.lua b/src/models/Role.lua index 5354052..a7bc281 100644 --- a/src/models/Role.lua +++ b/src/models/Role.lua @@ -27,7 +27,6 @@ function Role:ctor( properties ) self.runeBag = {} self.advData = nil self.activity = nil - self._pushToken = nil self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 if self.advOverTime == 0 then @@ -175,8 +174,6 @@ Role.schema = { downCvR = {"number", 0}, -- 下载cv扩展包奖励 feedback = {"table", {}}, -- 反馈相关信息 {flag = false, count = 0} flag是否评论过,count 提示次数 - - calTask = {"table", {}}, -- 英雄令活动 日历任务活动 } @@ -398,7 +395,6 @@ function Role:data() downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 feedback = self:getProperty("feedback"), ctime = self:getProperty("ctime"), - calTask = self:getProperty("calTask"), } end diff --git a/src/models/RoleLog.lua b/src/models/RoleLog.lua index 4216ce6..8ea8f74 100644 --- a/src/models/RoleLog.lua +++ b/src/models/RoleLog.lua @@ -81,7 +81,6 @@ local ItemReason = { birth = 1006, -- 出生奖励 actSign = 1007, -- 活动签到 actPaySign = 1008, -- 活动付费签到 - calendaTask = 1009, -- 英雄帖 -- 餐厅 greenHourse = 1101, -- 食材获得 diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index accd842..271a9b0 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -453,7 +453,6 @@ function RolePlugin.bind(Role) newHero:saveBattleValue() self.heros[heroId] = newHero self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL"), camp = unitData.camp, job = unitData.job}, params.notNotify) - self:checkTaskEnter("HeroQualityCollect", {}) if not params.notNotify then local heroResponse = {} table.insert(heroResponse, newHero:data()) @@ -1743,36 +1742,7 @@ function RolePlugin.bind(Role) end) return gift, checkPoint end - --[[ - "hang" : "挂机资源满", - "box" : "箱子拆解完毕", - "food" : "食物出售完毕", - "adv" : "代理拾荒完毕", - --]] - function Role:pushMsg(params) - if not self._pushToken or self._pushToken == "" then return end - if params.time <= 0 then - self:pushCancel(params) - return - end - local content = string.format("push:%d:%s:%s:%s", self:getProperty("id"), params.type, params.slot or 1, self._pushToken) - notifyClient({content = content, time = math.floor(params.time)}) - end - function Role:pushCancel(params) - if not self._pushToken or self._pushToken == "" then return end - local content = string.format("push:%d:%s:%s:%s", self:getProperty("id"), params.type, params.slot or 1, self._pushToken) - deleteNotify({content = content}) - end - - function Role:pushCancelAll(ptype) - if not self._pushToken or self._pushToken == "" then return end - local pattern = string.format("push:%d:*", self:getProperty("id")) - if ptype then - pattern = string.format("push:%d:%s:*", self:getProperty("id"), ptype) - end - deleteNotify({pattern = pattern}) - end end return RolePlugin \ No newline at end of file diff --git a/src/models/RoleTask.lua b/src/models/RoleTask.lua index bf28102..697b903 100644 --- a/src/models/RoleTask.lua +++ b/src/models/RoleTask.lua @@ -255,11 +255,11 @@ local CalendaTaskListener = { [TaskType.RoleLevelUp]= {{12, 2, f("level")}}, [TaskType.TowerPass]= {{13, 2, f("level")}}, [TaskType.HeroTalent]= {{14, 1}}, - [TaskType.HangPass]= {{15, 3}}, + [TaskType.HangPass]= {{15, 2, f("id")}}, [TaskType.HeroStarCollect]= {{16, 3}}, [TaskType.FoodSell]= {{17, 1, f("count")}}, [TaskType.HangGet]= {{18, 3, f("reward")}}, - [TaskType.RuneQualityCollect]= {{19, 3}}, + [TaskType.RuneQualityCollect]= {{19, 3, f("id")}}, [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}}, } } @@ -272,7 +272,6 @@ local TaskListeners = { SudokuListener, ActivityListener, StoreListener, - CalendaTaskListener, } local RoleTask = {} @@ -588,8 +587,6 @@ function RoleTask.bind(Role) end function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) - --print("check calenda taskl", mainType, subType, param1, param2) - if not self.activity then return end local open, actId = self.activity:isOpen("CalendaTask") local actData = csvdb["activity_ctrlCsv"][actId] if not actData then return end @@ -609,86 +606,11 @@ function RoleTask.bind(Role) elseif subType == 2 then -- 直接赋值 calTask[id] = param1 elseif subType == 3 then -- 自定义类型 - if cfg.type == 7 then -- 英雄品质收集进度 - local count = 0 - for _, hero in pairs(self.heros) do - local unitData = csvdb["unitCsv"][hero:getProperty("type")] - if unitData then - if cfg.condition2 <= unitData.rare then - count = count + 1 - end - end - end - if (calTask[id] or 0) < count then - calTask[id] = count - end - elseif cfg.type == 5 then -- 英雄等级收集进度 - local count = 0 - for _, hero in pairs(self.heros) do - if cfg.condition2 <= hero:getProperty("level") then - count = count + 1 - end - end - if calTask[id] < count then - calTask[id] = count - end - elseif cfg.type == 16 then -- 英雄星级收集进度 - local count = 0 - for _, hero in pairs(self.heros) do - if cfg.condition2 <= hero:getProperty("wakeL") then - count = count + 1 - end - end - if calTask[id] < count then - calTask[id] = count - end - elseif cfg.type == 18 then -- 挂机累计收获id,y个 - for rid, v in pairs(param1) do - if cfg.condition2 == rid then - calTask[id] = (calTask[id] or 0) + v - end - end - elseif cfg.type == 19 then -- x名英雄装备y品质以上符文套装 - local count = 0 - for _, hero in pairs(self.heros) do - local rcount = 0 - for _,uid in pairs(hero:getRunes()) do - if uid > 0 then - local runeData = self.runeBag[uid] - if runeData then - local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")] - - if csvData and cfg.condition2 <= csvData.rarity then - rcount = rcount + 1 - end - end - end - end - if rcount == 6 then - count = count + 1 - end - end - calTask[id] = count - elseif cfg.type == 20 then -- 开启x品质时钟箱子 - if cfg.condition2 <= (param2 or 0) then - calTask[id] = (calTask[id] or 0) + param2 - end - elseif cfg.type == 15 then -- 通关关卡 - if (calTask[id] or 0) == 0 then - local hangPass = self:getProperty("hangPass") - local diff = math.floor(cfg.condition2 / 10000) - if (hangPass[diff] or 0) >= cfg.condition1 then - calTask[id] = 1 - end - end - end end end end end end - self:updateProperty({field = "calTask", value = calTask, notNotify = notNotify}) - --dump(calTask) end end diff --git a/src/utils/CommonFunc.lua b/src/utils/CommonFunc.lua index a769389..b7e2798 100644 --- a/src/utils/CommonFunc.lua +++ b/src/utils/CommonFunc.lua @@ -298,7 +298,7 @@ function notifyClient(params) params.key = "zhaolugame20170831" local status, body = httpc.get(skynet.getenv("codeurl"), - "/push/notify_user?" .. httpGetFormatData(params), {}, {}) + "/mipush/notify_user?" .. httpGetFormatData(params), {}, {}) if tonumber(status) ~= 200 then skynet.error(status, body) return @@ -313,7 +313,7 @@ function deleteNotify(params) params.key = "zhaolugame20170831" local status, body = httpc.get(skynet.getenv("codeurl"), - "/push/delete_notify?" .. httpGetFormatData(params), {}, {}) + "/mipush/delete_notify?" .. httpGetFormatData(params), {}, {}) if tonumber(status) ~= 200 then skynet.error(status, body) return -- libgit2 0.21.2