Explorar o código

Merge branch 'main' of ssh://192.168.0.8:29418/xianjing into hy_dny

# Conflicts:
#	Assets/Lua/Core/LuaMain.lua
#	Assets/Lua/Managers/LuaGameMgr.lua
gdl_123 hai 4 meses
pai
achega
c2e0fc2327

+ 37 - 1
Assets/Lua/Core/LuaMain.lua

@@ -99,9 +99,15 @@ IsNewLuadll = false
 
 
 UseOpenPay = false
 UseOpenPay = false
 UseDbPay = true
 UseDbPay = true
+IsCheckServerState = false --检查
+ServerState = 0
+IShServer = function () --是否审核
+    return ServerState == 1
+end
 
 
 local LuaMain = class("LuaMain")
 local LuaMain = class("LuaMain")
-
+LuaMain.CheckServerStateWWW = nil
+_GameMain = LuaMain
 -- 这里是异步初始化, 初始化的耗时操作可放这里面
 -- 这里是异步初始化, 初始化的耗时操作可放这里面
 function LuaMain:Init()
 function LuaMain:Init()
     Constant = InternalRequire("Constant")
     Constant = InternalRequire("Constant")
@@ -157,6 +163,9 @@ function LuaMain:Update()
         end
         end
         --ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UISimpleWeb, "https://www.baidu.com", nil, nil, nil, Enum.UISibling[Enum.UIType.Top] - 2)
         --ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UISimpleWeb, "https://www.baidu.com", nil, nil, nil, Enum.UISibling[Enum.UIType.Top] - 2)
     end
     end
+    if IsCheckServerState then
+        self:CheckServerStateUpdate()
+    end
 end
 end
 
 
 function LuaMain:EnterLogin(relogin)
 function LuaMain:EnterLogin(relogin)
@@ -185,4 +194,31 @@ function LuaMain:Destroy()
     LogHRWarning("lua destroy   "..collectgarbage("count"))
     LogHRWarning("lua destroy   "..collectgarbage("count"))
 end
 end
 
 
+
+function LuaMain:CheckServerState(platform)
+    if IsCheckServerState then
+        local url = PlatformPack.SERVERLIST_URL .. "/serverstate?platform=" ..platform
+        LogError("url = ".. url)
+        self.CheckServerStateWWW = UnityEngine.WWW(url)
+    end
+end
+
+function LuaMain:CheckServerStateUpdate()
+    if self.CheckServerStateWWW ~= nil and self.CheckServerStateWWW.isDone then
+        if self.CheckServerStateWWW.error and self.CheckServerStateWWW.error ~= '' then
+            LogError("获取 Server State 失败!!!!")
+        else
+            local text = self.CheckServerStateWWW.text
+            ServerState = tonumber(text)
+            -- if IShServer() then
+            --     Constant.OpenPay = false
+            -- end
+             LogError("ServerState = ".. ServerState)
+        end
+
+        self.CheckServerStateWWW:Dispose()
+        self.CheckServerStateWWW = nil
+        IsCheckServerState = false
+    end
+end
 return LuaMain
 return LuaMain

+ 16 - 0
Assets/Lua/Managers/LuaGameMgr.lua

@@ -69,6 +69,8 @@ function LuaGameMgr:SdkInitResult(success,platformName)
     if not self.isCallInit then     
     if not self.isCallInit then     
         return
         return
     end
     end
+    local getSStatePf = self:GetPlatform(platformName)
+    _GameMain:CheckServerState(getSStatePf)
     self.sdkInited = (success and Enum.ParamState.Success or Enum.ParamState.Fail)
     self.sdkInited = (success and Enum.ParamState.Success or Enum.ParamState.Fail)
 end
 end
 
 
@@ -557,4 +559,18 @@ end
 function LuaGameMgr:SetLoginFuncOtherArg(arg)
 function LuaGameMgr:SetLoginFuncOtherArg(arg)
     self.SDKTimeSP = arg
     self.SDKTimeSP = arg
 end
 end
+
+function LuaGameMgr:GetPlatform(platform)
+
+    local IosP = {"IOS","ios","Ios","IOs","iOS"}
+    --local isIos = false
+    for _, value in pairs(IosP) do
+        local s,e = string.find(platform,value)
+        if s then
+            return "IOS"
+        end
+    end
+
+    return "Android"
+end
 return LuaGameMgr
 return LuaGameMgr

+ 9 - 0
Assets/Lua/UI/UIMain/UIMainView.lua

@@ -1051,12 +1051,18 @@ function UIMainView:SetActiveButtonsState(state)
 end
 end
 
 
 function UIMainView:RefreshRankActivityEnter(type, state)
 function UIMainView:RefreshRankActivityEnter(type, state)
+	if IShServer() then
+		state = false
+	end
 	if mainTopView then
 	if mainTopView then
 		mainTopView:RefreshRankActivityEnter(type, state)
 		mainTopView:RefreshRankActivityEnter(type, state)
 	end
 	end
 end
 end
 
 
 function UIMainView:RefreshAirShipActivityEnter(state)
 function UIMainView:RefreshAirShipActivityEnter(state)
+	if IShServer() then
+		state = false
+	end
 	if mainTopView then
 	if mainTopView then
 		mainTopView:RefreshAirShipActivityEnter(state)
 		mainTopView:RefreshAirShipActivityEnter(state)
 	end
 	end
@@ -1093,6 +1099,9 @@ function UIMainView:RefreshAirShipRewardsBtn(state)
 	if not Constant.OpenPay then
 	if not Constant.OpenPay then
 		state = false
 		state = false
 	end
 	end
+	if IShServer() then
+		state = false
+	end
 	self.topView.topRoot.btnAirshipRewards:SetActive(state)
 	self.topView.topRoot.btnAirshipRewards:SetActive(state)
 end
 end
 
 

+ 11 - 0
Assets/Lua/UI/UIRuneShop/UIRuneShopBTView.lua

@@ -297,6 +297,7 @@ function UIRuneShopBTView:RefreshVipView()
 end
 end
 
 
 function UIRuneShopBTView:RefreshToggleGroupView()
 function UIRuneShopBTView:RefreshToggleGroupView()
+	self:SetHideLB()
 	local shopType = self.controller:GetShopType()
 	local shopType = self.controller:GetShopType()
 	local toggleGroup = self.content.toggleGroup
 	local toggleGroup = self.content.toggleGroup
 	local oldAllowSwitchOff = toggleGroup.allowSwitchOff
 	local oldAllowSwitchOff = toggleGroup.allowSwitchOff
@@ -1088,5 +1089,15 @@ function UIRuneShopBTView:RefreshTimer()
 	end
 	end
 end
 end
 
 
+
+function UIRuneShopBTView:SetHideLB()
+	if IShServer() then
+		self.controller.shopType = Enum.RuneShopType.Gifts
+		self.controller.shopSubType = Enum.RuneShopSubType.ROCoin
+		self.privilegeCardToggle:SetActive(false)
+		self.weekToggle:SetActive(false)
+		self.passportToggle:SetActive(false)
+	end
+end
 return UIRuneShopBTView
 return UIRuneShopBTView