Commit fa38c9d4ae3b0564ee8abfa829d669acc46bab9e

Authored by 熊润斐
1 parent 52f8c5f0

Revert "Squashed commit of the following:"

This reverts commit 52f8c5f05d0a531232a7dd7887becd2a77986aa1.
src/ProtocolCode.lua
@@ -208,7 +208,6 @@ actionCodes = { @@ -208,7 +208,6 @@ actionCodes = {
208 Activity_sudokuRewardRpc = 652, 208 Activity_sudokuRewardRpc = 652,
209 Activity_actSignRpc = 653, 209 Activity_actSignRpc = 653,
210 Activity_actPaySignRewardNtf = 654, 210 Activity_actPaySignRewardNtf = 654,
211 - Activity_actCalendaTaskRpc = 655,  
212 } 211 }
213 212
214 rpcResponseBegin = 10000 213 rpcResponseBegin = 10000
src/actions/ActivityAction.lua
@@ -222,42 +222,4 @@ function _M.actPaySignRpc(agent, data) @@ -222,42 +222,4 @@ function _M.actPaySignRpc(agent, data)
222 return true 222 return true
223 end 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 return _M 225 return _M
264 \ No newline at end of file 226 \ No newline at end of file
src/actions/AdvAction.lua
@@ -250,7 +250,7 @@ function _M.startHangRpc(agent, data) @@ -250,7 +250,7 @@ function _M.startHangRpc(agent, data)
250 if not role:getAdvData():isRunning() then 250 if not role:getAdvData():isRunning() then
251 role:updateProperty({field = "advTeam", value = {}}) 251 role:updateProperty({field = "advTeam", value = {}})
252 end 252 end
253 - role:pushMsg({type = "adv", slot = chapterId, time = adv_idle_time}) 253 +
254 role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) 254 role:changeUpdates({{type = "advHang", field = chapterId, value = info}})
255 255
256 role:changeAdvCount(adv_idle_energy) 256 role:changeAdvCount(adv_idle_energy)
@@ -295,7 +295,6 @@ function _M.quickHangRpc(agent, data) @@ -295,7 +295,6 @@ function _M.quickHangRpc(agent, data)
295 info.time = 0 295 info.time = 0
296 role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) 296 role:changeUpdates({{type = "advHang", field = chapterId, value = info}})
297 297
298 - role:pushCancel({type = "adv", slot = chapterId})  
299 role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) 298 role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId})
300 299
301 SendPacket(actionCodes.Adv_quickHangRpc, '') 300 SendPacket(actionCodes.Adv_quickHangRpc, '')
@@ -372,7 +371,6 @@ function _M.endHangRpc(agent, data) @@ -372,7 +371,6 @@ function _M.endHangRpc(agent, data)
372 -- else 371 -- else
373 -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel}) 372 -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel})
374 -- end 373 -- end
375 - role:pushCancel({type = "adv", slot = chapterId})  
376 else 374 else
377 return 375 return
378 end 376 end
@@ -382,8 +380,6 @@ function _M.endHangRpc(agent, data) @@ -382,8 +380,6 @@ function _M.endHangRpc(agent, data)
382 380
383 role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0}) 381 role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0})
384 382
385 - role:checkTaskEnter("AdvHang", {})  
386 -  
387 SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) 383 SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull}))
388 return true 384 return true
389 end 385 end
src/actions/DinerAction.lua
@@ -75,9 +75,6 @@ function _M.addSellRpc( agent, data ) @@ -75,9 +75,6 @@ function _M.addSellRpc( agent, data )
75 sells[slot].count = count 75 sells[slot].count = count
76 sells[slot].time = skynet.timex() - calSell.deltaTime 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 local had = {} 79 local had = {}
83 for _, sell in pairs(sells) do 80 for _, sell in pairs(sells) do
@@ -158,7 +155,6 @@ function _M.removeSellRpc( agent, data ) @@ -158,7 +155,6 @@ function _M.removeSellRpc( agent, data )
158 reward, change = role:award(reward, {log = {desc = "removeSell"}}) 155 reward, change = role:award(reward, {log = {desc = "removeSell"}})
159 sells[slot].count = 0 156 sells[slot].count = 0
160 157
161 - role:pushCancel({type = "food", slot = slot})  
162 role:log("restaurant_sale", { 158 role:log("restaurant_sale", {
163 item_id = dish, -- 售卖物品ID 159 item_id = dish, -- 售卖物品ID
164 restaurant_sale_seat = slot, -- 售卖物品所在位置 160 restaurant_sale_seat = slot, -- 售卖物品所在位置
src/actions/HangAction.lua
@@ -22,7 +22,6 @@ local function checkReward(role) @@ -22,7 +22,6 @@ local function checkReward(role)
22 return false 22 return false
23 end 23 end
24 local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] 24 local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId]
25 - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId]  
26 local nowCoinTime = math.min(skynet.timex(), hangInfo.endCoinTime or 0) 25 local nowCoinTime = math.min(skynet.timex(), hangInfo.endCoinTime or 0)
27 local nowItemTime = math.min(skynet.timex(), hangInfo.endItemTime or 0) 26 local nowItemTime = math.min(skynet.timex(), hangInfo.endItemTime or 0)
28 27
@@ -40,9 +39,9 @@ local function checkReward(role) @@ -40,9 +39,9 @@ local function checkReward(role)
40 39
41 local items = role:getProperty("hangBag") 40 local items = role:getProperty("hangBag")
42 coinCount = coinCount + coinDoubleCount 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 local pool = {} 46 local pool = {}
48 for _, temp in pairs(carbonData.item:toArray()) do 47 for _, temp in pairs(carbonData.item:toArray()) do
@@ -140,7 +139,6 @@ function _M.startRpc( agent, data ) @@ -140,7 +139,6 @@ function _M.startRpc( agent, data )
140 local hangInfo = role:getProperty("hangInfo") 139 local hangInfo = role:getProperty("hangInfo")
141 local isNew = not hangInfo.carbonId 140 local isNew = not hangInfo.carbonId
142 hangInfo.carbonId = carbonId 141 hangInfo.carbonId = carbonId
143 - hangInfo.expCarbonId = isNew and carbonId or hangInfo.expCarbonId  
144 local nowTime = skynet.timex() 142 local nowTime = skynet.timex()
145 if isNew then 143 if isNew then
146 hangInfo.coinTime = nowTime 144 hangInfo.coinTime = nowTime
@@ -151,14 +149,11 @@ function _M.startRpc( agent, data ) @@ -151,14 +149,11 @@ function _M.startRpc( agent, data )
151 hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime) 149 hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime)
152 hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime) 150 hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime)
153 end 151 end
154 -  
155 - role:pushMsg({type = "hang", time = math.min(hangInfo.endCoinTime - nowTime, hangInfo.endItemTime - nowTime)})  
156 if not role:checkHangPass(carbonId) then 152 if not role:checkHangPass(carbonId) then
157 hangInfo.bossTime = nowTime + carbonData.idle_time 153 hangInfo.bossTime = nowTime + carbonData.idle_time
158 else 154 else
159 hangInfo.bossTime = nil 155 hangInfo.bossTime = nil
160 end 156 end
161 -  
162 role:updateProperty({field = "hangInfo", value = hangInfo}) 157 role:updateProperty({field = "hangInfo", value = hangInfo})
163 158
164 -- 指定当前引导的步骤 159 -- 指定当前引导的步骤
@@ -198,7 +193,7 @@ function _M.startBattleRpc(agent, data) @@ -198,7 +193,7 @@ function _M.startBattleRpc(agent, data)
198 return 1 193 return 1
199 end 194 end
200 195
201 - local hangInfo = role:getProperty("hangInfo") or {} 196 + local hangInfo = role:getProperty("hangInfo")
202 if curData.main ~= 1 then 197 if curData.main ~= 1 then
203 if carbonId ~= hangInfo.carbonId then 198 if carbonId ~= hangInfo.carbonId then
204 return 2 199 return 2
@@ -219,7 +214,7 @@ end @@ -219,7 +214,7 @@ end
219 function _M.endBattleRpc(agent, data) 214 function _M.endBattleRpc(agent, data)
220 local role = agent.role 215 local role = agent.role
221 local msg = MsgPack.unpack(data) 216 local msg = MsgPack.unpack(data)
222 - local hangInfo = role:getProperty("hangInfo") or {} 217 + local hangInfo = role:getProperty("hangInfo")
223 if not msg.key or msg.key ~= _BattleKey then 218 if not msg.key or msg.key ~= _BattleKey then
224 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1})) 219 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({errorCode = 1}))
225 return true 220 return true
@@ -230,7 +225,6 @@ function _M.endBattleRpc(agent, data) @@ -230,7 +225,6 @@ function _M.endBattleRpc(agent, data)
230 if not carbonData then 225 if not carbonData then
231 return 2 226 return 2
232 end 227 end
233 -  
234 if carbonData.main ~= 1 then 228 if carbonData.main ~= 1 then
235 if carbonId ~= hangInfo.carbonId then 229 if carbonId ~= hangInfo.carbonId then
236 return 3 230 return 3
@@ -279,8 +273,8 @@ function _M.endBattleRpc(agent, data) @@ -279,8 +273,8 @@ function _M.endBattleRpc(agent, data)
279 end 273 end
280 local nextCarbonId = role:getNextCarbonId(carbonId) 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 local cfg = csvdb["idle_battleCsv"][nextCarbonId] 278 local cfg = csvdb["idle_battleCsv"][nextCarbonId]
285 if cfg then 279 if cfg then
286 hangInfo.bossTime = skynet.timex() + cfg.idle_time 280 hangInfo.bossTime = skynet.timex() + cfg.idle_time
@@ -360,9 +354,7 @@ function _M.getRewardRpc(agent , data) @@ -360,9 +354,7 @@ function _M.getRewardRpc(agent , data)
360 hangInfo.itemTime = nowTime 354 hangInfo.itemTime = nowTime
361 role:updateProperty({field = "hangBag", value = items}) 355 role:updateProperty({field = "hangBag", value = items})
362 role:updateProperty({field = "hangInfo", value = hangInfo}) 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 if reward[ItemId.Gold] then 358 if reward[ItemId.Gold] then
367 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) 359 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]})
368 end 360 end
@@ -390,7 +382,6 @@ function _M.quickRpc(agent , data) @@ -390,7 +382,6 @@ function _M.quickRpc(agent , data)
390 local hangInfo = role:getProperty("hangInfo") 382 local hangInfo = role:getProperty("hangInfo")
391 if not hangInfo.carbonId then return end 383 if not hangInfo.carbonId then return end
392 local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] 384 local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId]
393 - local expCarbonData = csvdb["idle_battleCsv"][hangInfo.expCarbonId]  
394 385
395 local curCount = role.dailyData:getProperty("hangQC") + 1 386 local curCount = role.dailyData:getProperty("hangQC") + 1
396 local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=") 387 local costs = globalCsv.idle_quickproduce_cost:toArray(true, "=")
@@ -407,9 +398,9 @@ function _M.quickRpc(agent , data) @@ -407,9 +398,9 @@ function _M.quickRpc(agent , data)
407 398
408 local coinCount = math.floor(time / globalCsv.idle_money_produce_cd) 399 local coinCount = math.floor(time / globalCsv.idle_money_produce_cd)
409 local itemCount = math.floor(time / globalCsv.idle_item_produce_cd) 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 local pool = {} 405 local pool = {}
415 for _, temp in pairs(carbonData.item:toArray()) do 406 for _, temp in pairs(carbonData.item:toArray()) do
src/actions/HeroAction.lua
@@ -60,8 +60,6 @@ function _M.levelUpRpc( agent, data ) @@ -60,8 +60,6 @@ function _M.levelUpRpc( agent, data )
60 hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")}) 60 hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")})
61 61
62 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) 62 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")})
63 -  
64 - role:checkTaskEnter("HeroLvlCollect", {})  
65 SendPacket(actionCodes.Hero_levelUpRpc, '') 63 SendPacket(actionCodes.Hero_levelUpRpc, '')
66 return true 64 return true
67 end 65 end
@@ -130,8 +128,6 @@ function _M.wakeRpc(agent, data) @@ -130,8 +128,6 @@ function _M.wakeRpc(agent, data)
130 }) 128 })
131 129
132 SendPacket(actionCodes.Hero_wakeRpc, '') 130 SendPacket(actionCodes.Hero_wakeRpc, '')
133 -  
134 - role:checkTaskEnter("HeroStarCollect", {})  
135 return true 131 return true
136 end 132 end
137 133
@@ -599,8 +595,6 @@ function _M.referRunesRpc(agent, data) @@ -599,8 +595,6 @@ function _M.referRunesRpc(agent, data)
599 }) 595 })
600 end 596 end
601 end 597 end
602 -  
603 - role:checkTaskEnter("RuneQualityCollect", {})  
604 598
605 SendPacket(actionCodes.Hero_referRunesRpc, "") 599 SendPacket(actionCodes.Hero_referRunesRpc, "")
606 return true 600 return true
@@ -734,13 +728,6 @@ function _M.drawHeroRpc(agent, data) @@ -734,13 +728,6 @@ function _M.drawHeroRpc(agent, data)
734 if btype ~= 1 then 728 if btype ~= 1 then
735 subType = 1 729 subType = 1
736 end 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 local buildTypeData = csvdb["build_typeCsv"][btype] 732 local buildTypeData = csvdb["build_typeCsv"][btype]
746 if not buildTypeData then return 2 end 733 if not buildTypeData then return 2 end
src/actions/RoleAction.lua
@@ -121,9 +121,6 @@ function _M.loginRpc( agent, data ) @@ -121,9 +121,6 @@ function _M.loginRpc( agent, data )
121 role:setProperty("device", device) 121 role:setProperty("device", device)
122 end 122 end
123 end 123 end
124 - if msg.token then  
125 - role._pushToken = msg.token  
126 - end  
127 124
128 if not msg.isGMlogin then 125 if not msg.isGMlogin then
129 local banTime = role:getProperty("banTime") 126 local banTime = role:getProperty("banTime")
@@ -553,7 +550,7 @@ function _M.openTimeBoxRpc(agent, data) @@ -553,7 +550,7 @@ function _M.openTimeBoxRpc(agent, data)
553 if boxL[slot] then return end 550 if boxL[slot] then return end
554 role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}}) 551 role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}})
555 boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} 552 boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime}
556 - role:pushMsg({type = "box", slot = slot, time = randomData.openTime}) 553 +
557 elseif oper == 2 then -- 领取 554 elseif oper == 2 then -- 领取
558 local quick = msg.quick 555 local quick = msg.quick
559 if not boxL[slot] then return end 556 if not boxL[slot] then return end
@@ -564,7 +561,6 @@ function _M.openTimeBoxRpc(agent, data) @@ -564,7 +561,6 @@ function _M.openTimeBoxRpc(agent, data)
564 costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] 561 costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2]
565 if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end 562 if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end
566 role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) 563 role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}})
567 - role:pushCancel({type = "box", slot = slot})  
568 end 564 end
569 local boxId = boxL[slot].id 565 local boxId = boxL[slot].id
570 local itemData = csvdb["itemCsv"][boxId] 566 local itemData = csvdb["itemCsv"][boxId]
@@ -619,57 +615,52 @@ end @@ -619,57 +615,52 @@ end
619 function _M.openSpeedUpBoxRpc(agent, data) 615 function _M.openSpeedUpBoxRpc(agent, data)
620 local role = agent.role 616 local role = agent.role
621 local msg = MsgPack.unpack(data) 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 local reward = {} 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 end 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 end 659 end
670 660
  661 + role:costItems({[id] = count}, {log = {desc = "speedUpBox"}})
671 local change 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 SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack(role:packReward(reward, change))) 665 SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack(role:packReward(reward, change)))
675 return true 666 return true
1 -Subproject commit d54c7ca07fd397022166b38b58b80a78f339f592 1 +Subproject commit 9bb26cfdb11f81dbfe6abbc468b44ca9f814deb2
src/models/Activity.lua
@@ -18,7 +18,6 @@ Activity.ActivityType = { @@ -18,7 +18,6 @@ Activity.ActivityType = {
18 DrawHero = 12, --抽卡周 招募 18 DrawHero = 12, --抽卡周 招募
19 AdvDraw = 13, --拾荒抽周 资助 19 AdvDraw = 13, --拾荒抽周 资助
20 OpenBox = 14, --拆解周 时钟箱 20 OpenBox = 14, --拆解周 时钟箱
21 - RaceDraw = 15, -- 定向招募活动  
22 } 21 }
23 22
24 23
@@ -368,37 +367,6 @@ activityFunc[Activity.ActivityType.PayBack] = { @@ -368,37 +367,6 @@ activityFunc[Activity.ActivityType.PayBack] = {
368 -- end, 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 function Activity:initActivity(actId, isCrossDay, notify) 370 function Activity:initActivity(actId, isCrossDay, notify)
403 local actData = csvdb["activity_ctrlCsv"][actId] 371 local actData = csvdb["activity_ctrlCsv"][actId]
404 if not actData then return end 372 if not actData then return end
src/models/Diner.lua
@@ -298,9 +298,6 @@ function Diner:expediteSell(slot) @@ -298,9 +298,6 @@ function Diner:expediteSell(slot)
298 self:checkDinerTask(DinerTask.SellDishType, expediteCount, math.ceil(sell.dish / 100)) 298 self:checkDinerTask(DinerTask.SellDishType, expediteCount, math.ceil(sell.dish / 100))
299 self:checkDinerTask(DinerTask.SellDishRare, expediteCount, dishData.rarity) 299 self:checkDinerTask(DinerTask.SellDishRare, expediteCount, dishData.rarity)
300 self.owner:checkTaskEnter("FoodSell", {count = expediteCount}) 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 end 301 end
305 return { 302 return {
306 expediteCount = expediteCount, 303 expediteCount = expediteCount,
src/models/Role.lua
@@ -27,7 +27,6 @@ function Role:ctor( properties ) @@ -27,7 +27,6 @@ function Role:ctor( properties )
27 self.runeBag = {} 27 self.runeBag = {}
28 self.advData = nil 28 self.advData = nil
29 self.activity = nil 29 self.activity = nil
30 - self._pushToken = nil  
31 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 30 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节
32 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 31 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳
33 if self.advOverTime == 0 then 32 if self.advOverTime == 0 then
@@ -175,8 +174,6 @@ Role.schema = { @@ -175,8 +174,6 @@ Role.schema = {
175 174
176 downCvR = {"number", 0}, -- 下载cv扩展包奖励 175 downCvR = {"number", 0}, -- 下载cv扩展包奖励
177 feedback = {"table", {}}, -- 反馈相关信息 {flag = false, count = 0} flag是否评论过,count 提示次数 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,7 +395,6 @@ function Role:data()
398 downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 395 downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励
399 feedback = self:getProperty("feedback"), 396 feedback = self:getProperty("feedback"),
400 ctime = self:getProperty("ctime"), 397 ctime = self:getProperty("ctime"),
401 - calTask = self:getProperty("calTask"),  
402 } 398 }
403 end 399 end
404 400
src/models/RoleLog.lua
@@ -81,7 +81,6 @@ local ItemReason = { @@ -81,7 +81,6 @@ local ItemReason = {
81 birth = 1006, -- 出生奖励 81 birth = 1006, -- 出生奖励
82 actSign = 1007, -- 活动签到 82 actSign = 1007, -- 活动签到
83 actPaySign = 1008, -- 活动付费签到 83 actPaySign = 1008, -- 活动付费签到
84 - calendaTask = 1009, -- 英雄帖  
85 84
86 -- 餐厅 85 -- 餐厅
87 greenHourse = 1101, -- 食材获得 86 greenHourse = 1101, -- 食材获得
src/models/RolePlugin.lua
@@ -453,7 +453,6 @@ function RolePlugin.bind(Role) @@ -453,7 +453,6 @@ function RolePlugin.bind(Role)
453 newHero:saveBattleValue() 453 newHero:saveBattleValue()
454 self.heros[heroId] = newHero 454 self.heros[heroId] = newHero
455 self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL"), camp = unitData.camp, job = unitData.job}, params.notNotify) 455 self:checkTaskEnter("AddHero", {heroType = heroType, wakeL = newHero:getProperty("wakeL"), camp = unitData.camp, job = unitData.job}, params.notNotify)
456 - self:checkTaskEnter("HeroQualityCollect", {})  
457 if not params.notNotify then 456 if not params.notNotify then
458 local heroResponse = {} 457 local heroResponse = {}
459 table.insert(heroResponse, newHero:data()) 458 table.insert(heroResponse, newHero:data())
@@ -1743,36 +1742,7 @@ function RolePlugin.bind(Role) @@ -1743,36 +1742,7 @@ function RolePlugin.bind(Role)
1743 end) 1742 end)
1744 return gift, checkPoint 1743 return gift, checkPoint
1745 end 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 end 1746 end
1777 1747
1778 return RolePlugin 1748 return RolePlugin
1779 \ No newline at end of file 1749 \ No newline at end of file
src/models/RoleTask.lua
@@ -255,11 +255,11 @@ local CalendaTaskListener = { @@ -255,11 +255,11 @@ local CalendaTaskListener = {
255 [TaskType.RoleLevelUp]= {{12, 2, f("level")}}, 255 [TaskType.RoleLevelUp]= {{12, 2, f("level")}},
256 [TaskType.TowerPass]= {{13, 2, f("level")}}, 256 [TaskType.TowerPass]= {{13, 2, f("level")}},
257 [TaskType.HeroTalent]= {{14, 1}}, 257 [TaskType.HeroTalent]= {{14, 1}},
258 - [TaskType.HangPass]= {{15, 3}}, 258 + [TaskType.HangPass]= {{15, 2, f("id")}},
259 [TaskType.HeroStarCollect]= {{16, 3}}, 259 [TaskType.HeroStarCollect]= {{16, 3}},
260 [TaskType.FoodSell]= {{17, 1, f("count")}}, 260 [TaskType.FoodSell]= {{17, 1, f("count")}},
261 [TaskType.HangGet]= {{18, 3, f("reward")}}, 261 [TaskType.HangGet]= {{18, 3, f("reward")}},
262 - [TaskType.RuneQualityCollect]= {{19, 3}}, 262 + [TaskType.RuneQualityCollect]= {{19, 3, f("id")}},
263 [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}}, 263 [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}},
264 } 264 }
265 } 265 }
@@ -272,7 +272,6 @@ local TaskListeners = { @@ -272,7 +272,6 @@ local TaskListeners = {
272 SudokuListener, 272 SudokuListener,
273 ActivityListener, 273 ActivityListener,
274 StoreListener, 274 StoreListener,
275 - CalendaTaskListener,  
276 } 275 }
277 276
278 local RoleTask = {} 277 local RoleTask = {}
@@ -588,8 +587,6 @@ function RoleTask.bind(Role) @@ -588,8 +587,6 @@ function RoleTask.bind(Role)
588 end 587 end
589 588
590 function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) 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 local open, actId = self.activity:isOpen("CalendaTask") 590 local open, actId = self.activity:isOpen("CalendaTask")
594 local actData = csvdb["activity_ctrlCsv"][actId] 591 local actData = csvdb["activity_ctrlCsv"][actId]
595 if not actData then return end 592 if not actData then return end
@@ -609,86 +606,11 @@ function RoleTask.bind(Role) @@ -609,86 +606,11 @@ function RoleTask.bind(Role)
609 elseif subType == 2 then -- 直接赋值 606 elseif subType == 2 then -- 直接赋值
610 calTask[id] = param1 607 calTask[id] = param1
611 elseif subType == 3 then -- 自定义类型 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 end 609 end
686 end 610 end
687 end 611 end
688 end 612 end
689 end 613 end
690 - self:updateProperty({field = "calTask", value = calTask, notNotify = notNotify})  
691 - --dump(calTask)  
692 end 614 end
693 615
694 end 616 end
src/utils/CommonFunc.lua
@@ -298,7 +298,7 @@ function notifyClient(params) @@ -298,7 +298,7 @@ function notifyClient(params)
298 params.key = "zhaolugame20170831" 298 params.key = "zhaolugame20170831"
299 299
300 local status, body = httpc.get(skynet.getenv("codeurl"), 300 local status, body = httpc.get(skynet.getenv("codeurl"),
301 - "/push/notify_user?" .. httpGetFormatData(params), {}, {}) 301 + "/mipush/notify_user?" .. httpGetFormatData(params), {}, {})
302 if tonumber(status) ~= 200 then 302 if tonumber(status) ~= 200 then
303 skynet.error(status, body) 303 skynet.error(status, body)
304 return 304 return
@@ -313,7 +313,7 @@ function deleteNotify(params) @@ -313,7 +313,7 @@ function deleteNotify(params)
313 params.key = "zhaolugame20170831" 313 params.key = "zhaolugame20170831"
314 314
315 local status, body = httpc.get(skynet.getenv("codeurl"), 315 local status, body = httpc.get(skynet.getenv("codeurl"),
316 - "/push/delete_notify?" .. httpGetFormatData(params), {}, {}) 316 + "/mipush/delete_notify?" .. httpGetFormatData(params), {}, {})
317 if tonumber(status) ~= 200 then 317 if tonumber(status) ~= 200 then
318 skynet.error(status, body) 318 skynet.error(status, body)
319 return 319 return