Przeglądaj źródła

Merge branch 'Thailand' of https://gitee.com/wangwenfan/congkong into Thailand

zhanwencai 1 rok temu
rodzic
commit
bae49bf2b1

+ 42 - 59
script/module/mozhu/MoZhuMiddleLogic.lua

@@ -10,74 +10,57 @@ local CombatDefine = require("combat.CombatDefine")
 local Msg = require("core.Msg")
 local MiddleManager = require("middle.MiddleManager")
 
+function sendReward(mozhuData)
+    local unionList = {}
+    for rank, unionUuid in ipairs(mozhuData.unionRank) do
+        unionList[unionUuid] = rank
+    end
+    MoZhuLogic.actOverRank({
+        type = 2,
+        list = unionList
+    })
+    local roleList = {}
+    for rank, uuid in ipairs(mozhuData.roleRank) do
+        roleList[uuid] = rank
+    end
+    MoZhuLogic.actOverRank({
+        type = 1,
+        list = roleList
+    })
+end
+
 function onHour(hour)
 
     if _G.is_middle ~= true then 
         -- 目前没有跨服,暂时注释
         --return 
     end
-    local mozhuDB = MoZhuDB.getMoZhu()
-	if not mozhuDB.time then
-        MoZhuDB.initMoZhu()
-        mozhuDB = MoZhuDB.getMoZhu()
-    end
-    
     local nowWeek = Util.getWeekDay()
-    if not Util.isSameDay(mozhuDB.time) then
+    -- mozhu 暂未开放
+    if not MoZhuLogic.MOZHU_OPEN_DAY[nowWeek] then
+        --是否需要重置mozhu数据
+        return
+    end
+    local mozhuData = MoZhuDB.getMoZhu()
+	if not next(mozhuData) or Util.isSameDay(mozhuData.time) then
         MoZhuDB.initMoZhu()
-        --[[   发奖修改为 22点发
-        if MoZhuLogic.isOpen() then
-            MoZhuDB.initMoZhu()
-        else
-            local lastWeek = nowWeek - 1
-            lastWeek = lastWeek ~= 0 and lastWeek or 7
-
-            if MoZhuLogic.MOZHU_OPEN_DAY[lastWeek] then
-                -- 发放上一日 排名奖励
-                actOverUnion()
-                actOverRole()
-                MoZhuDB.initMoZhu()
-            else
-                MoZhuDB.initMoZhu()
-            end
-        end
-        ]]
-        
+        mozhuData = MoZhuDB.getMoZhu()
     end
-
-    if MoZhuLogic.MOZHU_OPEN_DAY[nowWeek] then
-        local _, endTime = MoZhuLogic.getActTime()
-        local lastGetTime = mozhuDB.lastGetTime or 0
-        local now = os.time()
-        if now >= endTime and not Util.isSameDay(lastGetTime) then
-            -- 延后处理 随机十秒
-            local r = math.random(10)
-            require("core.Timer").addLater(r,function()
-                mozhuDB.lastGetTime = now
-                local unionList = {}
-                for rank, unionUuid in ipairs(mozhuDB.unionRank) do
-                    unionList[unionUuid] = rank
-                end
-                MoZhuLogic.actOverRank({
-                    type = 2,
-                    list = unionList
-                })
-                local roleList = {}
-                for rank, uuid in ipairs(mozhuDB.roleRank) do
-                    roleList[uuid] = rank
-                end
-                MoZhuLogic.actOverRank({
-                    type = 1,
-                    list = roleList
-                })
-                MoZhuDB.saveMoZhu()
-            end)
-            
-            -- 发放上一日 排名奖励
-            --actOverUnion()
-            --actOverRole()
-            
-        end
+    -- 是否发奖励
+    local start,finish = MoZhuLogic.getActTime()
+    local nowTime = os.time()
+    if nowTime > finish and nowTime < (start + 86400) and not MoZhuDB.isReward then
+        MoZhuDB.isReward = nowTime
+        -- 延后处理 随机十秒
+        local r = math.random(10)
+        require("core.Timer").addLater(r,function()
+            sendReward(mozhuData)
+            MoZhuDB.saveMoZhu()
+        end)
+        -- 发放上一日 排名奖励
+        --actOverUnion()
+        --actOverRole()
+        MoZhuDB.saveMoZhu()
     end
 end
 

+ 12 - 0
script/module/shop/WarOrder.lua

@@ -138,6 +138,18 @@ end
 ------------------------------------------------------
 -- 对外暴露接口
 ------------------------------------------------------
+
+function isDot(human)
+    local isDot = false
+    for orderType in pairs(orderNameMap) do 
+        if checkRed(human,orderType) == 1 then 
+            isDot = true
+            break
+        end
+    end
+    return isDot
+end
+
 function warOrderInfo(human,orderType)
     local orderName = orderNameMap[orderType]
     local cfg = OrderExcel[orderName]

+ 1 - 2
script/module/zhuanpan/ZhuanpanLogic.lua

@@ -613,8 +613,7 @@ function getLuck(human, msg)
             end 	
 	    end
 	end
-	
-	
+
 	query(human, msg.type)
 end