Commit fa38c9d4ae3b0564ee8abfa829d669acc46bab9e
1 parent
52f8c5f0
Revert "Squashed commit of the following:"
This reverts commit 52f8c5f05d0a531232a7dd7887becd2a77986aa1.
Showing
15 changed files
with
58 additions
and
284 deletions
Show diff stats
src/ProtocolCode.lua
src/actions/ActivityAction.lua
| ... | ... | @@ -222,42 +222,4 @@ function _M.actPaySignRpc(agent, data) |
| 222 | 222 | return true |
| 223 | 223 | end |
| 224 | 224 | |
| 225 | -function _M.actCalendaTaskRpc(agent, data) | |
| 226 | - local role = agent.role | |
| 227 | - local msg = MsgPack.unpack(data) | |
| 228 | - local taskId = msg.id | |
| 229 | - local calTask = role:getProperty("calTask") or {} | |
| 230 | - local record = calTask["r"] or {} | |
| 231 | - local flag = record[taskId] or 0 | |
| 232 | - if flag == 1 then return 1 end | |
| 233 | - local open, actId = role.activity:isOpen("CalendaTask") | |
| 234 | - local actData = csvdb["activity_ctrlCsv"][actId] | |
| 235 | - if not open then return 2 end | |
| 236 | - if not actData then return 3 end | |
| 237 | - | |
| 238 | - local taskList = csvdb["activity_taskCsv"][actData.condition] | |
| 239 | - if not taskList then return 4 end | |
| 240 | - local taskCfg = taskList[taskId] | |
| 241 | - if not taskCfg then return 5 end | |
| 242 | - if taskCfg.key ~= actData.condition then return 6 end | |
| 243 | - | |
| 244 | - if (calTask[taskId] or 0) < taskCfg.condition1 then return 7 end | |
| 245 | - | |
| 246 | - record[taskId] = 1 | |
| 247 | - calTask["r"] = record | |
| 248 | - | |
| 249 | - role:updateProperty({field = "calTask", value = calTask}) | |
| 250 | - | |
| 251 | - local reward, change = role:award(taskCfg.reward, {log = {desc = "calendaTask"}}) | |
| 252 | - | |
| 253 | - role:log("activity", { | |
| 254 | - activity_id = taskId, -- 活动ID(或活动指定任务的ID) | |
| 255 | - activity_type = role.activity.ActivityType.CalendaTask, -- 活动类型,见活动类型枚举表 | |
| 256 | - activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | |
| 257 | - }) | |
| 258 | - | |
| 259 | - SendPacket(actionCodes.Activity_actCalendaTaskRpc, MsgPack.pack(role:packReward(reward, change))) | |
| 260 | - return true | |
| 261 | -end | |
| 262 | - | |
| 263 | 225 | return _M |
| 264 | 226 | \ No newline at end of file | ... | ... |
src/actions/AdvAction.lua
| ... | ... | @@ -250,7 +250,7 @@ function _M.startHangRpc(agent, data) |
| 250 | 250 | if not role:getAdvData():isRunning() then |
| 251 | 251 | role:updateProperty({field = "advTeam", value = {}}) |
| 252 | 252 | end |
| 253 | - role:pushMsg({type = "adv", slot = chapterId, time = adv_idle_time}) | |
| 253 | + | |
| 254 | 254 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
| 255 | 255 | |
| 256 | 256 | role:changeAdvCount(adv_idle_energy) |
| ... | ... | @@ -295,7 +295,6 @@ function _M.quickHangRpc(agent, data) |
| 295 | 295 | info.time = 0 |
| 296 | 296 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
| 297 | 297 | |
| 298 | - role:pushCancel({type = "adv", slot = chapterId}) | |
| 299 | 298 | role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) |
| 300 | 299 | |
| 301 | 300 | SendPacket(actionCodes.Adv_quickHangRpc, '') |
| ... | ... | @@ -372,7 +371,6 @@ function _M.endHangRpc(agent, data) |
| 372 | 371 | -- else |
| 373 | 372 | -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel}) |
| 374 | 373 | -- end |
| 375 | - role:pushCancel({type = "adv", slot = chapterId}) | |
| 376 | 374 | else |
| 377 | 375 | return |
| 378 | 376 | end |
| ... | ... | @@ -382,8 +380,6 @@ function _M.endHangRpc(agent, data) |
| 382 | 380 | |
| 383 | 381 | role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0}) |
| 384 | 382 | |
| 385 | - role:checkTaskEnter("AdvHang", {}) | |
| 386 | - | |
| 387 | 383 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) |
| 388 | 384 | return true |
| 389 | 385 | end | ... | ... |
src/actions/DinerAction.lua
| ... | ... | @@ -75,9 +75,6 @@ function _M.addSellRpc( agent, data ) |
| 75 | 75 | sells[slot].count = count |
| 76 | 76 | sells[slot].time = skynet.timex() - calSell.deltaTime |
| 77 | 77 | |
| 78 | - local needTime = sells[slot].count * dishData.sell_time + sells[slot].time - skynet.timex() | |
| 79 | - role:pushMsg({type = "food", slot = slot, time = needTime}) | |
| 80 | - | |
| 81 | 78 | -- 检查解锁的顾客 |
| 82 | 79 | local had = {} |
| 83 | 80 | for _, sell in pairs(sells) do |
| ... | ... | @@ -158,7 +155,6 @@ function _M.removeSellRpc( agent, data ) |
| 158 | 155 | reward, change = role:award(reward, {log = {desc = "removeSell"}}) |
| 159 | 156 | sells[slot].count = 0 |
| 160 | 157 | |
| 161 | - role:pushCancel({type = "food", slot = slot}) | |
| 162 | 158 | role:log("restaurant_sale", { |
| 163 | 159 | item_id = dish, -- 售卖物品ID |
| 164 | 160 | restaurant_sale_seat = slot, -- 售卖物品所在位置 | ... | ... |
src/actions/HangAction.lua
| ... | ... | @@ -22,7 +22,6 @@ local function checkReward(role) |
| 22 | 22 | return false |
| 23 | 23 | end |
| 24 | 24 | local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] |
| 25 | - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] | |
| 26 | 25 | local nowCoinTime = math.min(skynet.timex(), hangInfo.endCoinTime or 0) |
| 27 | 26 | local nowItemTime = math.min(skynet.timex(), hangInfo.endItemTime or 0) |
| 28 | 27 | |
| ... | ... | @@ -40,9 +39,9 @@ local function checkReward(role) |
| 40 | 39 | |
| 41 | 40 | local items = role:getProperty("hangBag") |
| 42 | 41 | coinCount = coinCount + coinDoubleCount |
| 43 | - items[ItemId.Gold] = math.floor((items[ItemId.Gold] or 0) + coinCount * expCarbonData.money) | |
| 44 | - items[ItemId.Exp] = math.floor((items[ItemId.Exp] or 0) + coinCount * expCarbonData.exp) | |
| 45 | - items[ItemId.PlayerExp] = math.floor((items[ItemId.PlayerExp] or 0) + coinCount * expCarbonData.playerExp) | |
| 42 | + items[ItemId.Gold] = math.floor((items[ItemId.Gold] or 0) + coinCount * carbonData.money) | |
| 43 | + items[ItemId.Exp] = math.floor((items[ItemId.Exp] or 0) + coinCount * carbonData.exp) | |
| 44 | + items[ItemId.PlayerExp] = math.floor((items[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) | |
| 46 | 45 | |
| 47 | 46 | local pool = {} |
| 48 | 47 | for _, temp in pairs(carbonData.item:toArray()) do |
| ... | ... | @@ -140,7 +139,6 @@ function _M.startRpc( agent, data ) |
| 140 | 139 | local hangInfo = role:getProperty("hangInfo") |
| 141 | 140 | local isNew = not hangInfo.carbonId |
| 142 | 141 | hangInfo.carbonId = carbonId |
| 143 | - hangInfo.expCarbonId = isNew and carbonId or hangInfo.expCarbonId | |
| 144 | 142 | local nowTime = skynet.timex() |
| 145 | 143 | if isNew then |
| 146 | 144 | hangInfo.coinTime = nowTime |
| ... | ... | @@ -151,14 +149,11 @@ function _M.startRpc( agent, data ) |
| 151 | 149 | hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime) |
| 152 | 150 | hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime) |
| 153 | 151 | end |
| 154 | - | |
| 155 | - role:pushMsg({type = "hang", time = math.min(hangInfo.endCoinTime - nowTime, hangInfo.endItemTime - nowTime)}) | |
| 156 | 152 | if not role:checkHangPass(carbonId) then |
| 157 | 153 | hangInfo.bossTime = nowTime + carbonData.idle_time |
| 158 | 154 | else |
| 159 | 155 | hangInfo.bossTime = nil |
| 160 | 156 | end |
| 161 | - | |
| 162 | 157 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
| 163 | 158 | |
| 164 | 159 | -- 指定当前引导的步骤 |
| ... | ... | @@ -198,7 +193,7 @@ function _M.startBattleRpc(agent, data) |
| 198 | 193 | return 1 |
| 199 | 194 | end |
| 200 | 195 | |
| 201 | - local hangInfo = role:getProperty("hangInfo") or {} | |
| 196 | + local hangInfo = role:getProperty("hangInfo") | |
| 202 | 197 | if curData.main ~= 1 then |
| 203 | 198 | if carbonId ~= hangInfo.carbonId then |
| 204 | 199 | return 2 |
| ... | ... | @@ -219,7 +214,7 @@ end |
| 219 | 214 | function _M.endBattleRpc(agent, data) |
| 220 | 215 | local role = agent.role |
| 221 | 216 | local msg = MsgPack.unpack(data) |
| 222 | - local hangInfo = role:getProperty("hangInfo") or {} | |
| 217 | + local hangInfo = role:getProperty("hangInfo") | |
| 223 | 218 | if not msg.key or msg.key ~= _BattleKey then |
| 224 | 219 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1})) |
| 225 | 220 | return true |
| ... | ... | @@ -230,7 +225,6 @@ function _M.endBattleRpc(agent, data) |
| 230 | 225 | if not carbonData then |
| 231 | 226 | return 2 |
| 232 | 227 | end |
| 233 | - | |
| 234 | 228 | if carbonData.main ~= 1 then |
| 235 | 229 | if carbonId ~= hangInfo.carbonId then |
| 236 | 230 | return 3 |
| ... | ... | @@ -279,8 +273,8 @@ function _M.endBattleRpc(agent, data) |
| 279 | 273 | end |
| 280 | 274 | local nextCarbonId = role:getNextCarbonId(carbonId) |
| 281 | 275 | -- 设置挂机关卡 |
| 282 | - if isWin and (hangInfo.carbonId or 0) < nextCarbonId then | |
| 283 | - hangInfo.expCarbonId = nextCarbonId | |
| 276 | + if isWin and hangInfo.carbonId < nextCarbonId then | |
| 277 | + hangInfo.carbonId = nextCarbonId | |
| 284 | 278 | local cfg = csvdb["idle_battleCsv"][nextCarbonId] |
| 285 | 279 | if cfg then |
| 286 | 280 | hangInfo.bossTime = skynet.timex() + cfg.idle_time |
| ... | ... | @@ -360,9 +354,7 @@ function _M.getRewardRpc(agent , data) |
| 360 | 354 | hangInfo.itemTime = nowTime |
| 361 | 355 | role:updateProperty({field = "hangBag", value = items}) |
| 362 | 356 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
| 363 | - role:pushMsg({type = "hang", time = globalCsv.idle_producetime_max}) | |
| 364 | - | |
| 365 | - role:checkTaskEnter("HangGet", {reward = reward}) | |
| 357 | + role:checkTaskEnter("HangGet") | |
| 366 | 358 | if reward[ItemId.Gold] then |
| 367 | 359 | role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) |
| 368 | 360 | end |
| ... | ... | @@ -390,7 +382,6 @@ function _M.quickRpc(agent , data) |
| 390 | 382 | local hangInfo = role:getProperty("hangInfo") |
| 391 | 383 | if not hangInfo.carbonId then return end |
| 392 | 384 | local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] |
| 393 | - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] | |
| 394 | 385 | |
| 395 | 386 | local curCount = role.dailyData:getProperty("hangQC") + 1 |
| 396 | 387 | local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=") |
| ... | ... | @@ -407,9 +398,9 @@ function _M.quickRpc(agent , data) |
| 407 | 398 | |
| 408 | 399 | local coinCount = math.floor(time / globalCsv.idle_money_produce_cd) |
| 409 | 400 | local itemCount = math.floor(time / globalCsv.idle_item_produce_cd) |
| 410 | - reward[ItemId.Gold] = math.floor((reward[ItemId.Gold] or 0) + coinCount * expCarbonData.money) | |
| 411 | - reward[ItemId.Exp] = math.floor((reward[ItemId.Exp] or 0) + coinCount * expCarbonData.exp) | |
| 412 | - reward[ItemId.PlayerExp] = math.floor((reward[ItemId.PlayerExp] or 0) + coinCount * expCarbonData.playerExp) | |
| 401 | + reward[ItemId.Gold] = math.floor((reward[ItemId.Gold] or 0) + coinCount * carbonData.money) | |
| 402 | + reward[ItemId.Exp] = math.floor((reward[ItemId.Exp] or 0) + coinCount * carbonData.exp) | |
| 403 | + reward[ItemId.PlayerExp] = math.floor((reward[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) | |
| 413 | 404 | |
| 414 | 405 | local pool = {} |
| 415 | 406 | for _, temp in pairs(carbonData.item:toArray()) do | ... | ... |
src/actions/HeroAction.lua
| ... | ... | @@ -60,8 +60,6 @@ function _M.levelUpRpc( agent, data ) |
| 60 | 60 | hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")}) |
| 61 | 61 | |
| 62 | 62 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
| 63 | - | |
| 64 | - role:checkTaskEnter("HeroLvlCollect", {}) | |
| 65 | 63 | SendPacket(actionCodes.Hero_levelUpRpc, '') |
| 66 | 64 | return true |
| 67 | 65 | end |
| ... | ... | @@ -130,8 +128,6 @@ function _M.wakeRpc(agent, data) |
| 130 | 128 | }) |
| 131 | 129 | |
| 132 | 130 | SendPacket(actionCodes.Hero_wakeRpc, '') |
| 133 | - | |
| 134 | - role:checkTaskEnter("HeroStarCollect", {}) | |
| 135 | 131 | return true |
| 136 | 132 | end |
| 137 | 133 | |
| ... | ... | @@ -599,8 +595,6 @@ function _M.referRunesRpc(agent, data) |
| 599 | 595 | }) |
| 600 | 596 | end |
| 601 | 597 | end |
| 602 | - | |
| 603 | - role:checkTaskEnter("RuneQualityCollect", {}) | |
| 604 | 598 | |
| 605 | 599 | SendPacket(actionCodes.Hero_referRunesRpc, "") |
| 606 | 600 | return true |
| ... | ... | @@ -734,13 +728,6 @@ function _M.drawHeroRpc(agent, data) |
| 734 | 728 | if btype ~= 1 then |
| 735 | 729 | subType = 1 |
| 736 | 730 | end |
| 737 | - | |
| 738 | - if btype == 1 then | |
| 739 | - -- 判断定向卡池活动开启 | |
| 740 | - if not role.activity:isOpen("RaceDraw") then | |
| 741 | - return | |
| 742 | - end | |
| 743 | - end | |
| 744 | 731 | |
| 745 | 732 | local buildTypeData = csvdb["build_typeCsv"][btype] |
| 746 | 733 | if not buildTypeData then return 2 end | ... | ... |
src/actions/RoleAction.lua
| ... | ... | @@ -121,9 +121,6 @@ function _M.loginRpc( agent, data ) |
| 121 | 121 | role:setProperty("device", device) |
| 122 | 122 | end |
| 123 | 123 | end |
| 124 | - if msg.token then | |
| 125 | - role._pushToken = msg.token | |
| 126 | - end | |
| 127 | 124 | |
| 128 | 125 | if not msg.isGMlogin then |
| 129 | 126 | local banTime = role:getProperty("banTime") |
| ... | ... | @@ -553,7 +550,7 @@ function _M.openTimeBoxRpc(agent, data) |
| 553 | 550 | if boxL[slot] then return end |
| 554 | 551 | role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}}) |
| 555 | 552 | boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} |
| 556 | - role:pushMsg({type = "box", slot = slot, time = randomData.openTime}) | |
| 553 | + | |
| 557 | 554 | elseif oper == 2 then -- 领取 |
| 558 | 555 | local quick = msg.quick |
| 559 | 556 | if not boxL[slot] then return end |
| ... | ... | @@ -564,7 +561,6 @@ function _M.openTimeBoxRpc(agent, data) |
| 564 | 561 | costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] |
| 565 | 562 | if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end |
| 566 | 563 | role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) |
| 567 | - role:pushCancel({type = "box", slot = slot}) | |
| 568 | 564 | end |
| 569 | 565 | local boxId = boxL[slot].id |
| 570 | 566 | local itemData = csvdb["itemCsv"][boxId] |
| ... | ... | @@ -619,57 +615,52 @@ end |
| 619 | 615 | function _M.openSpeedUpBoxRpc(agent, data) |
| 620 | 616 | local role = agent.role |
| 621 | 617 | local msg = MsgPack.unpack(data) |
| 622 | - local itemInfo = msg.itemInfo | |
| 618 | + | |
| 619 | + local id = msg.id | |
| 620 | + local count = msg.count | |
| 621 | + local itemData = csvdb["itemCsv"][id] | |
| 622 | + if not itemData or itemData.type ~= ItemType.SpeedBox then return end | |
| 623 | + | |
| 624 | + if math.illegalNum(count, 1, role:getItemCount(id)) then return end | |
| 625 | + local useType, hour = table.unpack(itemData.use_effect:toArray(true, "=")) | |
| 626 | + local time = hour * 60 * 60 | |
| 623 | 627 | |
| 624 | 628 | local reward = {} |
| 625 | - for i = 1, #itemInfo do | |
| 626 | - local pair = itemInfo[i] | |
| 627 | - local id = pair[1] | |
| 628 | - local count = pair[2] | |
| 629 | - local itemData = csvdb["itemCsv"][id] | |
| 630 | - if not itemData or itemData.type ~= ItemType.SpeedBox then return end | |
| 631 | - | |
| 632 | - if math.illegalNum(count, 1, role:getItemCount(id)) then return 1 end | |
| 633 | - local useType, hour = table.unpack(itemData.use_effect:toArray(true, "=")) | |
| 634 | - local time = hour * 60 * 60 | |
| 635 | - | |
| 636 | - if useType == 1 then -- 挂机齿轮 | |
| 637 | - local hangInfo = role:getProperty("hangInfo") | |
| 638 | - if not hangInfo.expCarbonId then | |
| 639 | - return 2 | |
| 640 | - end | |
| 641 | - local carbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] | |
| 642 | - reward[ItemId.Gold] = (reward[ItemId.Gold] or 0) + math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.money * count | |
| 643 | - elseif useType == 2 then -- 挂机经验 | |
| 644 | - local hangInfo = role:getProperty("hangInfo") | |
| 645 | - if not hangInfo.expCarbonId then | |
| 646 | - return 3 | |
| 647 | - end | |
| 648 | - local carbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId] | |
| 649 | - reward[ItemId.Exp] = (reward[ItemId.Exp] or 0) + math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.exp * count | |
| 650 | - elseif useType == 3 then -- 食材商人收入 | |
| 651 | - local buildType = 6 | |
| 652 | - local level = role.dinerData:getProperty("buildL"):getv(buildType, 1) | |
| 653 | - local buildingData = csvdb["diner_buildingCsv"][buildType][level] | |
| 654 | - if not buildingData then | |
| 655 | - return 4 | |
| 656 | - end | |
| 657 | - local gfood = role.dinerData:getProperty("gfood") | |
| 658 | - if not next(gfood) then return 5 end | |
| 659 | - for k , v in pairs(gfood) do | |
| 660 | - local itemId = v.id | |
| 661 | - local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * buildingData.speed / 100 | |
| 662 | - reward[itemId] = (reward[itemId] or 0) + math.floor(time / speed) * count | |
| 663 | - end | |
| 664 | - else | |
| 665 | - return 6 | |
| 629 | + if useType == 1 then -- 挂机齿轮 | |
| 630 | + local hangInfo = role:getProperty("hangInfo") | |
| 631 | + if not hangInfo.carbonId then | |
| 632 | + return | |
| 666 | 633 | end |
| 667 | - | |
| 668 | - role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) | |
| 634 | + local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] | |
| 635 | + reward[ItemId.Gold] = math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.money * count | |
| 636 | + elseif useType == 2 then -- 挂机经验 | |
| 637 | + local hangInfo = role:getProperty("hangInfo") | |
| 638 | + if not hangInfo.carbonId then | |
| 639 | + return | |
| 640 | + end | |
| 641 | + local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] | |
| 642 | + reward[ItemId.Exp] = math.floor(time / globalCsv.idle_money_produce_cd) * carbonData.exp * count | |
| 643 | + elseif useType == 3 then -- 食材商人收入 | |
| 644 | + local buildType = 6 | |
| 645 | + local level = role.dinerData:getProperty("buildL"):getv(buildType, 1) | |
| 646 | + local buildingData = csvdb["diner_buildingCsv"][buildType][level] | |
| 647 | + if not buildingData then | |
| 648 | + return 1 | |
| 649 | + end | |
| 650 | + local gfood = role.dinerData:getProperty("gfood") | |
| 651 | + if not next(gfood) then return end | |
| 652 | + for k , v in pairs(gfood) do | |
| 653 | + local itemId = v.id | |
| 654 | + local speed = globalCsv.diner_get_food_speed[csvdb["itemCsv"][itemId].quality] * buildingData.speed / 100 | |
| 655 | + reward[itemId] = math.floor(time / speed) * count | |
| 656 | + end | |
| 657 | + else | |
| 658 | + return | |
| 669 | 659 | end |
| 670 | 660 | |
| 661 | + role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) | |
| 671 | 662 | local change |
| 672 | - reward, change = role:award(reward, {log = {desc = "speedUpBox"}}) | |
| 663 | + reward, change = role:award(reward, {log = {desc = "speedUpBox"}, int1 = id, int2 = count}) | |
| 673 | 664 | |
| 674 | 665 | SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack(role:packReward(reward, change))) |
| 675 | 666 | return true | ... | ... |
src/models/Activity.lua
| ... | ... | @@ -18,7 +18,6 @@ Activity.ActivityType = { |
| 18 | 18 | DrawHero = 12, --抽卡周 招募 |
| 19 | 19 | AdvDraw = 13, --拾荒抽周 资助 |
| 20 | 20 | OpenBox = 14, --拆解周 时钟箱 |
| 21 | - RaceDraw = 15, -- 定向招募活动 | |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | 23 | |
| ... | ... | @@ -368,37 +367,6 @@ activityFunc[Activity.ActivityType.PayBack] = { |
| 368 | 367 | -- end, |
| 369 | 368 | } |
| 370 | 369 | |
| 371 | --- 英雄帖 | |
| 372 | -activityFunc[Activity.ActivityType.CalendaTask] = { | |
| 373 | - ["init"] = function(self, actType, isCrossDay, notify) | |
| 374 | - local calTask = self.owner:getProperty("CalTask") | |
| 375 | - calTask = {} | |
| 376 | - local role = self.owner | |
| 377 | - local buildL = role.dinerData:getProperty("buildL") | |
| 378 | - local curLevel = buildL:getv(1, 1) | |
| 379 | - role:checkTaskEnter("DinerLevelUp", {level = curLevel}) | |
| 380 | - | |
| 381 | - role:checkTaskEnter("HeroLvlCollect", {}) | |
| 382 | - role:checkTaskEnter("HeroQualityCollect", {}) | |
| 383 | - | |
| 384 | - local curPopular = role.dinerData:getProperty("popular") | |
| 385 | - role:checkTaskEnter("DinerPopular", {count = curPopular}) | |
| 386 | - | |
| 387 | - local rLevel = role:getProperty("level") | |
| 388 | - role:checkTaskEnter("RoleLevelUp", {level = rLevel}) | |
| 389 | - | |
| 390 | - local towerInfo = role:getProperty("towerInfo") | |
| 391 | - role:checkTaskEnter("TowerPass", {level = towerInfo.l}) | |
| 392 | - --"PvpWin" | |
| 393 | - role:checkTaskEnter("HangPass", {}) | |
| 394 | - role:checkTaskEnter("HeroStarCollect", {}) | |
| 395 | - role:checkTaskEnter("RuneQualityCollect", {}) | |
| 396 | - | |
| 397 | - end, | |
| 398 | - -- ["close"] = function(self, actType, notify) | |
| 399 | - -- end, | |
| 400 | -} | |
| 401 | - | |
| 402 | 370 | function Activity:initActivity(actId, isCrossDay, notify) |
| 403 | 371 | local actData = csvdb["activity_ctrlCsv"][actId] |
| 404 | 372 | if not actData then return end | ... | ... |
src/models/Diner.lua
| ... | ... | @@ -298,9 +298,6 @@ function Diner:expediteSell(slot) |
| 298 | 298 | self:checkDinerTask(DinerTask.SellDishType, expediteCount, math.ceil(sell.dish / 100)) |
| 299 | 299 | self:checkDinerTask(DinerTask.SellDishRare, expediteCount, dishData.rarity) |
| 300 | 300 | self.owner:checkTaskEnter("FoodSell", {count = expediteCount}) |
| 301 | - | |
| 302 | - local needTime = sells[slot].count * dishData.sell_time + sells[slot].time - skynet.timex() | |
| 303 | - self.owner:pushMsg({type = "food", slot = slot, time = needTime}) | |
| 304 | 301 | end |
| 305 | 302 | return { |
| 306 | 303 | expediteCount = expediteCount, | ... | ... |
src/models/Role.lua
| ... | ... | @@ -27,7 +27,6 @@ function Role:ctor( properties ) |
| 27 | 27 | self.runeBag = {} |
| 28 | 28 | self.advData = nil |
| 29 | 29 | self.activity = nil |
| 30 | - self._pushToken = nil | |
| 31 | 30 | self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 |
| 32 | 31 | self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 |
| 33 | 32 | if self.advOverTime == 0 then |
| ... | ... | @@ -175,8 +174,6 @@ Role.schema = { |
| 175 | 174 | |
| 176 | 175 | downCvR = {"number", 0}, -- 下载cv扩展包奖励 |
| 177 | 176 | feedback = {"table", {}}, -- 反馈相关信息 {flag = false, count = 0} flag是否评论过,count 提示次数 |
| 178 | - | |
| 179 | - calTask = {"table", {}}, -- 英雄令活动 日历任务活动 | |
| 180 | 177 | } |
| 181 | 178 | |
| 182 | 179 | |
| ... | ... | @@ -398,7 +395,6 @@ function Role:data() |
| 398 | 395 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 |
| 399 | 396 | feedback = self:getProperty("feedback"), |
| 400 | 397 | ctime = self:getProperty("ctime"), |
| 401 | - calTask = self:getProperty("calTask"), | |
| 402 | 398 | } |
| 403 | 399 | end |
| 404 | 400 | ... | ... |
src/models/RoleLog.lua
src/models/RolePlugin.lua
| ... | ... | @@ -453,7 +453,6 @@ function RolePlugin.bind(Role) |
| 453 | 453 | newHero:saveBattleValue() |
| 454 | 454 | self.heros[heroId] = newHero |
| 455 | 455 | self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL"), camp = unitData.camp, job = unitData.job}, params.notNotify) |
| 456 | - self:checkTaskEnter("HeroQualityCollect", {}) | |
| 457 | 456 | if not params.notNotify then |
| 458 | 457 | local heroResponse = {} |
| 459 | 458 | table.insert(heroResponse, newHero:data()) |
| ... | ... | @@ -1743,36 +1742,7 @@ function RolePlugin.bind(Role) |
| 1743 | 1742 | end) |
| 1744 | 1743 | return gift, checkPoint |
| 1745 | 1744 | end |
| 1746 | - --[[ | |
| 1747 | - "hang" : "挂机资源满", | |
| 1748 | - "box" : "箱子拆解完毕", | |
| 1749 | - "food" : "食物出售完毕", | |
| 1750 | - "adv" : "代理拾荒完毕", | |
| 1751 | - --]] | |
| 1752 | - function Role:pushMsg(params) | |
| 1753 | - if not self._pushToken or self._pushToken == "" then return end | |
| 1754 | - if params.time <= 0 then | |
| 1755 | - self:pushCancel(params) | |
| 1756 | - return | |
| 1757 | - end | |
| 1758 | - local content = string.format("push:%d:%s:%s:%s", self:getProperty("id"), params.type, params.slot or 1, self._pushToken) | |
| 1759 | - notifyClient({content = content, time = math.floor(params.time)}) | |
| 1760 | - end | |
| 1761 | 1745 | |
| 1762 | - function Role:pushCancel(params) | |
| 1763 | - if not self._pushToken or self._pushToken == "" then return end | |
| 1764 | - local content = string.format("push:%d:%s:%s:%s", self:getProperty("id"), params.type, params.slot or 1, self._pushToken) | |
| 1765 | - deleteNotify({content = content}) | |
| 1766 | - end | |
| 1767 | - | |
| 1768 | - function Role:pushCancelAll(ptype) | |
| 1769 | - if not self._pushToken or self._pushToken == "" then return end | |
| 1770 | - local pattern = string.format("push:%d:*", self:getProperty("id")) | |
| 1771 | - if ptype then | |
| 1772 | - pattern = string.format("push:%d:%s:*", self:getProperty("id"), ptype) | |
| 1773 | - end | |
| 1774 | - deleteNotify({pattern = pattern}) | |
| 1775 | - end | |
| 1776 | 1746 | end |
| 1777 | 1747 | |
| 1778 | 1748 | return RolePlugin |
| 1779 | 1749 | \ No newline at end of file | ... | ... |
src/models/RoleTask.lua
| ... | ... | @@ -255,11 +255,11 @@ local CalendaTaskListener = { |
| 255 | 255 | [TaskType.RoleLevelUp]= {{12, 2, f("level")}}, |
| 256 | 256 | [TaskType.TowerPass]= {{13, 2, f("level")}}, |
| 257 | 257 | [TaskType.HeroTalent]= {{14, 1}}, |
| 258 | - [TaskType.HangPass]= {{15, 3}}, | |
| 258 | + [TaskType.HangPass]= {{15, 2, f("id")}}, | |
| 259 | 259 | [TaskType.HeroStarCollect]= {{16, 3}}, |
| 260 | 260 | [TaskType.FoodSell]= {{17, 1, f("count")}}, |
| 261 | 261 | [TaskType.HangGet]= {{18, 3, f("reward")}}, |
| 262 | - [TaskType.RuneQualityCollect]= {{19, 3}}, | |
| 262 | + [TaskType.RuneQualityCollect]= {{19, 3, f("id")}}, | |
| 263 | 263 | [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}}, |
| 264 | 264 | } |
| 265 | 265 | } |
| ... | ... | @@ -272,7 +272,6 @@ local TaskListeners = { |
| 272 | 272 | SudokuListener, |
| 273 | 273 | ActivityListener, |
| 274 | 274 | StoreListener, |
| 275 | - CalendaTaskListener, | |
| 276 | 275 | } |
| 277 | 276 | |
| 278 | 277 | local RoleTask = {} |
| ... | ... | @@ -588,8 +587,6 @@ function RoleTask.bind(Role) |
| 588 | 587 | end |
| 589 | 588 | |
| 590 | 589 | function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) |
| 591 | - --print("check calenda taskl", mainType, subType, param1, param2) | |
| 592 | - if not self.activity then return end | |
| 593 | 590 | local open, actId = self.activity:isOpen("CalendaTask") |
| 594 | 591 | local actData = csvdb["activity_ctrlCsv"][actId] |
| 595 | 592 | if not actData then return end |
| ... | ... | @@ -609,86 +606,11 @@ function RoleTask.bind(Role) |
| 609 | 606 | elseif subType == 2 then -- 直接赋值 |
| 610 | 607 | calTask[id] = param1 |
| 611 | 608 | elseif subType == 3 then -- 自定义类型 |
| 612 | - if cfg.type == 7 then -- 英雄品质收集进度 | |
| 613 | - local count = 0 | |
| 614 | - for _, hero in pairs(self.heros) do | |
| 615 | - local unitData = csvdb["unitCsv"][hero:getProperty("type")] | |
| 616 | - if unitData then | |
| 617 | - if cfg.condition2 <= unitData.rare then | |
| 618 | - count = count + 1 | |
| 619 | - end | |
| 620 | - end | |
| 621 | - end | |
| 622 | - if (calTask[id] or 0) < count then | |
| 623 | - calTask[id] = count | |
| 624 | - end | |
| 625 | - elseif cfg.type == 5 then -- 英雄等级收集进度 | |
| 626 | - local count = 0 | |
| 627 | - for _, hero in pairs(self.heros) do | |
| 628 | - if cfg.condition2 <= hero:getProperty("level") then | |
| 629 | - count = count + 1 | |
| 630 | - end | |
| 631 | - end | |
| 632 | - if calTask[id] < count then | |
| 633 | - calTask[id] = count | |
| 634 | - end | |
| 635 | - elseif cfg.type == 16 then -- 英雄星级收集进度 | |
| 636 | - local count = 0 | |
| 637 | - for _, hero in pairs(self.heros) do | |
| 638 | - if cfg.condition2 <= hero:getProperty("wakeL") then | |
| 639 | - count = count + 1 | |
| 640 | - end | |
| 641 | - end | |
| 642 | - if calTask[id] < count then | |
| 643 | - calTask[id] = count | |
| 644 | - end | |
| 645 | - elseif cfg.type == 18 then -- 挂机累计收获id,y个 | |
| 646 | - for rid, v in pairs(param1) do | |
| 647 | - if cfg.condition2 == rid then | |
| 648 | - calTask[id] = (calTask[id] or 0) + v | |
| 649 | - end | |
| 650 | - end | |
| 651 | - elseif cfg.type == 19 then -- x名英雄装备y品质以上符文套装 | |
| 652 | - local count = 0 | |
| 653 | - for _, hero in pairs(self.heros) do | |
| 654 | - local rcount = 0 | |
| 655 | - for _,uid in pairs(hero:getRunes()) do | |
| 656 | - if uid > 0 then | |
| 657 | - local runeData = self.runeBag[uid] | |
| 658 | - if runeData then | |
| 659 | - local csvData = csvdb["runeCsv"][runeData:getProperty("type")][runeData:getProperty("id")] | |
| 660 | - | |
| 661 | - if csvData and cfg.condition2 <= csvData.rarity then | |
| 662 | - rcount = rcount + 1 | |
| 663 | - end | |
| 664 | - end | |
| 665 | - end | |
| 666 | - end | |
| 667 | - if rcount == 6 then | |
| 668 | - count = count + 1 | |
| 669 | - end | |
| 670 | - end | |
| 671 | - calTask[id] = count | |
| 672 | - elseif cfg.type == 20 then -- 开启x品质时钟箱子 | |
| 673 | - if cfg.condition2 <= (param2 or 0) then | |
| 674 | - calTask[id] = (calTask[id] or 0) + param2 | |
| 675 | - end | |
| 676 | - elseif cfg.type == 15 then -- 通关关卡 | |
| 677 | - if (calTask[id] or 0) == 0 then | |
| 678 | - local hangPass = self:getProperty("hangPass") | |
| 679 | - local diff = math.floor(cfg.condition2 / 10000) | |
| 680 | - if (hangPass[diff] or 0) >= cfg.condition1 then | |
| 681 | - calTask[id] = 1 | |
| 682 | - end | |
| 683 | - end | |
| 684 | - end | |
| 685 | 609 | end |
| 686 | 610 | end |
| 687 | 611 | end |
| 688 | 612 | end |
| 689 | 613 | end |
| 690 | - self:updateProperty({field = "calTask", value = calTask, notNotify = notNotify}) | |
| 691 | - --dump(calTask) | |
| 692 | 614 | end |
| 693 | 615 | |
| 694 | 616 | end | ... | ... |
src/utils/CommonFunc.lua
| ... | ... | @@ -298,7 +298,7 @@ function notifyClient(params) |
| 298 | 298 | params.key = "zhaolugame20170831" |
| 299 | 299 | |
| 300 | 300 | local status, body = httpc.get(skynet.getenv("codeurl"), |
| 301 | - "/push/notify_user?" .. httpGetFormatData(params), {}, {}) | |
| 301 | + "/mipush/notify_user?" .. httpGetFormatData(params), {}, {}) | |
| 302 | 302 | if tonumber(status) ~= 200 then |
| 303 | 303 | skynet.error(status, body) |
| 304 | 304 | return |
| ... | ... | @@ -313,7 +313,7 @@ function deleteNotify(params) |
| 313 | 313 | params.key = "zhaolugame20170831" |
| 314 | 314 | |
| 315 | 315 | local status, body = httpc.get(skynet.getenv("codeurl"), |
| 316 | - "/push/delete_notify?" .. httpGetFormatData(params), {}, {}) | |
| 316 | + "/mipush/delete_notify?" .. httpGetFormatData(params), {}, {}) | |
| 317 | 317 | if tonumber(status) ~= 200 then |
| 318 | 318 | skynet.error(status, body) |
| 319 | 319 | return | ... | ... |