Commit bb5d94bd92685465a465cdcf89279b49a1ba1a28

Authored by liuzujun
2 parents 460afa6e 072db127

Merge branch 'develop' of 120.26.43.151:wasteland/server into develop

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 - 253 + role:pushMsg({type = "adv", slot = chapterId, time = adv_idle_time})
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,6 +295,7 @@ function _M.quickHangRpc(agent, data) @@ -295,6 +295,7 @@ 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})
298 role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) 299 role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId})
299 300
300 SendPacket(actionCodes.Adv_quickHangRpc, '') 301 SendPacket(actionCodes.Adv_quickHangRpc, '')
@@ -371,6 +372,7 @@ function _M.endHangRpc(agent, data) @@ -371,6 +372,7 @@ function _M.endHangRpc(agent, data)
371 -- else 372 -- else
372 -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel}) 373 -- role:updateProperty({field = "advC", delta = -chapterData.limitlevel})
373 -- end 374 -- end
  375 + role:pushCancel({type = "adv", slot = chapterId})
374 else 376 else
375 return 377 return
376 end 378 end
src/actions/DinerAction.lua
@@ -75,6 +75,9 @@ function _M.addSellRpc( agent, data ) @@ -75,6 +75,9 @@ 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 +
78 -- 检查解锁的顾客 81 -- 检查解锁的顾客
79 local had = {} 82 local had = {}
80 for _, sell in pairs(sells) do 83 for _, sell in pairs(sells) do
@@ -155,6 +158,7 @@ function _M.removeSellRpc( agent, data ) @@ -155,6 +158,7 @@ function _M.removeSellRpc( agent, data )
155 reward, change = role:award(reward, {log = {desc = "removeSell"}}) 158 reward, change = role:award(reward, {log = {desc = "removeSell"}})
156 sells[slot].count = 0 159 sells[slot].count = 0
157 160
  161 + role:pushCancel({type = "food", slot = slot})
158 role:log("restaurant_sale", { 162 role:log("restaurant_sale", {
159 item_id = dish, -- 售卖物品ID 163 item_id = dish, -- 售卖物品ID
160 restaurant_sale_seat = slot, -- 售卖物品所在位置 164 restaurant_sale_seat = slot, -- 售卖物品所在位置
src/actions/HangAction.lua
@@ -152,11 +152,14 @@ function _M.startRpc( agent, data ) @@ -152,11 +152,14 @@ function _M.startRpc( agent, data )
152 hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime) 152 hangInfo.coinTime = math.min(nowTime, hangInfo.endCoinTime)
153 hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime) 153 hangInfo.itemTime = math.min(nowTime, hangInfo.endItemTime)
154 end 154 end
  155 +
  156 + role:pushMsg({type = "hang", time = math.min(hangInfo.endCoinTime - nowTime, hangInfo.endItemTime - nowTime)})
155 if not role:checkHangPass(carbonId) then 157 if not role:checkHangPass(carbonId) then
156 hangInfo.bossTime = nowTime + carbonData.idle_time 158 hangInfo.bossTime = nowTime + carbonData.idle_time
157 else 159 else
158 hangInfo.bossTime = nil 160 hangInfo.bossTime = nil
159 end 161 end
  162 +
160 role:updateProperty({field = "hangInfo", value = hangInfo}) 163 role:updateProperty({field = "hangInfo", value = hangInfo})
161 164
162 -- 指定当前引导的步骤 165 -- 指定当前引导的步骤
@@ -358,6 +361,8 @@ function _M.getRewardRpc(agent , data) @@ -358,6 +361,8 @@ function _M.getRewardRpc(agent , data)
358 hangInfo.itemTime = nowTime 361 hangInfo.itemTime = nowTime
359 role:updateProperty({field = "hangBag", value = items}) 362 role:updateProperty({field = "hangBag", value = items})
360 role:updateProperty({field = "hangInfo", value = hangInfo}) 363 role:updateProperty({field = "hangInfo", value = hangInfo})
  364 + role:pushMsg({type = "hang", time = globalCsv.idle_producetime_max})
  365 +
361 role:checkTaskEnter("HangGet", {reward = reward}) 366 role:checkTaskEnter("HangGet", {reward = reward})
362 if reward[ItemId.Gold] then 367 if reward[ItemId.Gold] then
363 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) 368 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]})
src/actions/RoleAction.lua
@@ -121,6 +121,9 @@ function _M.loginRpc( agent, data ) @@ -121,6 +121,9 @@ 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
124 127
125 if not msg.isGMlogin then 128 if not msg.isGMlogin then
126 local banTime = role:getProperty("banTime") 129 local banTime = role:getProperty("banTime")
@@ -550,7 +553,7 @@ function _M.openTimeBoxRpc(agent, data) @@ -550,7 +553,7 @@ function _M.openTimeBoxRpc(agent, data)
550 if boxL[slot] then return end 553 if boxL[slot] then return end
551 role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}}) 554 role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}})
552 boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} 555 boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime}
553 - 556 + role:pushMsg({type = "box", slot = slot, time = randomData.openTime})
554 elseif oper == 2 then -- 领取 557 elseif oper == 2 then -- 领取
555 local quick = msg.quick 558 local quick = msg.quick
556 if not boxL[slot] then return end 559 if not boxL[slot] then return end
@@ -561,6 +564,7 @@ function _M.openTimeBoxRpc(agent, data) @@ -561,6 +564,7 @@ function _M.openTimeBoxRpc(agent, data)
561 costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] 564 costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2]
562 if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end 565 if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end
563 role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) 566 role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}})
  567 + role:pushCancel({type = "box", slot = slot})
564 end 568 end
565 local boxId = boxL[slot].id 569 local boxId = boxL[slot].id
566 local itemData = csvdb["itemCsv"][boxId] 570 local itemData = csvdb["itemCsv"][boxId]
src/models/Diner.lua
@@ -298,6 +298,9 @@ function Diner:expediteSell(slot) @@ -298,6 +298,9 @@ 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})
301 end 304 end
302 return { 305 return {
303 expediteCount = expediteCount, 306 expediteCount = expediteCount,
src/models/Role.lua
@@ -27,6 +27,7 @@ function Role:ctor( properties ) @@ -27,6 +27,7 @@ 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
30 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 31 self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节
31 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 32 self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳
32 if self.advOverTime == 0 then 33 if self.advOverTime == 0 then
src/models/RolePlugin.lua
@@ -1743,7 +1743,36 @@ function RolePlugin.bind(Role) @@ -1743,7 +1743,36 @@ function RolePlugin.bind(Role)
1743 end) 1743 end)
1744 return gift, checkPoint 1744 return gift, checkPoint
1745 end 1745 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
1746 1761
  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
1747 end 1776 end
1748 1777
1749 return RolePlugin 1778 return RolePlugin
1750 \ No newline at end of file 1779 \ No newline at end of file
src/utils/CommonFunc.lua
@@ -310,7 +310,7 @@ function notifyClient(params) @@ -310,7 +310,7 @@ function notifyClient(params)
310 params.key = "zhaolugame20170831" 310 params.key = "zhaolugame20170831"
311 311
312 local status, body = httpc.get(skynet.getenv("codeurl"), 312 local status, body = httpc.get(skynet.getenv("codeurl"),
313 - "/mipush/notify_user?" .. httpGetFormatData(params), {}, {}) 313 + "/push/notify_user?" .. httpGetFormatData(params), {}, {})
314 if tonumber(status) ~= 200 then 314 if tonumber(status) ~= 200 then
315 skynet.error(status, body) 315 skynet.error(status, body)
316 return 316 return
@@ -325,7 +325,7 @@ function deleteNotify(params) @@ -325,7 +325,7 @@ function deleteNotify(params)
325 params.key = "zhaolugame20170831" 325 params.key = "zhaolugame20170831"
326 326
327 local status, body = httpc.get(skynet.getenv("codeurl"), 327 local status, body = httpc.get(skynet.getenv("codeurl"),
328 - "/mipush/delete_notify?" .. httpGetFormatData(params), {}, {}) 328 + "/push/delete_notify?" .. httpGetFormatData(params), {}, {})
329 if tonumber(status) ~= 200 then 329 if tonumber(status) ~= 200 then
330 skynet.error(status, body) 330 skynet.error(status, body)
331 return 331 return