--[[ 这里存储游戏的基本信息,区域,版本号等 ]] local GameAppInfo = {} --为了保证服务器部署的BattleCheck的版本判断永远返回true,这里默认取一个较大的版本号 local curMarketVersionNum = 999999 function GameAppInfo.InitGameInfo(isBattleCheckMain) if isBattleCheckMain then --因为在兼容各个大区的包以及战斗服,因此对于大区的取值放在一个lua变量中 GameAppInfo.Global_PackageType = BattleCheckPackageType GameAppInfo.Global_ProductId = BattleCheckProductId or "52" else -- AppInfo.ReloadConfig() --因为在兼容各个大区的包以及战斗服,因此对于大区的取值放在一个lua变量中 GameAppInfo.Global_PackageType = AppInfo.packageType GameAppInfo.Global_ProductId = AppInfo.productId local verStr = string.gsub(AppInfo.marketVersion, "%.", "") curMarketVersionNum = tonumber(verStr) end end function GameAppInfo.ResetProductId(productId) GameAppInfo.Global_ProductId = productId AppInfo.productId = productId end --是否是海外包,这里的海外是指出了日本,韩国,越南 function GameAppInfo.IsOverseaPackage() return GameAppInfo.Global_PackageType == "hmt" end --是否是国内包,中国大陆 function GameAppInfo.IsChinesePackage() return GameAppInfo.Global_PackageType == "cn" or GameAppInfo.Global_PackageType == "gs" end --是否是日本包 function GameAppInfo.IsJapanesePackage() return GameAppInfo.Global_PackageType == "jp" end --是否是越南包 function GameAppInfo.IsVietnamPackage() return GameAppInfo.Global_PackageType == "vn" end --主播包 function GameAppInfo.IsGameStreamerPackage() return GameAppInfo.Global_PackageType == "gs" end --市场包 function GameAppInfo.IsMarketPackage() return DEF.USE_PC_CHEAT end --是否显示越南18+Logo function GameAppInfo.IsShowVietnam18Logo() --没获取到公告信息之前 IsReviewService 值不准,解决热更界面默认18+logo一直关闭的显隐问题。 if not MDL.Login.IsGetAnnouncementCfg then return false end -- 提审服关闭 18+ logo,因为越南发行在后台填写的政策是12+ -- 正式服打开 18+ logo,因为越南的版署要求游戏必须有18+ if MDL.Login.IsReviewService then return false else return true end end --是否是正式包 function GameAppInfo.IsOfficalPackage() return AppInfo.isOfficial end function GameAppInfo.IsOpenRegion() --谷歌推荐包不开启切换大区 if DEF and DEF.IS_GOOGLE_RECOMMEND then return false end return GameAppInfo.IsOfficalPackage() and GameAppInfo.IsOverseaPackage() end function GameAppInfo.IsAndroidPackage() if not UNITY_EDITOR then return UNITY_ANDROID end return false end function GameAppInfo.IsiOSPackage() if not UNITY_EDITOR then return UNITY_IOS end return false end function GameAppInfo.IsPCPackage() if not UNITY_EDITOR then return UNITY_STANDALONE == "WIN" end return false end function GameAppInfo.IsPCPackageWithSdk() return GameAppInfo.IsPCPackage() and AppInfo.EnableSDK() end function GameAppInfo.IsMacPackage() if not UNITY_EDITOR then return UNITY_STANDALONE == "OSX" end return false end function GameAppInfo.IsPCOrMacPackage() return GameAppInfo.IsPCPackage() or GameAppInfo.IsMacPackage() end function GameAppInfo.IsMacPackageWithSdk() return GameAppInfo.IsMacPackage() and AppInfo.EnableSDK() end function GameAppInfo.GetPlatform() if not UNITY_EDITOR then if UNITY_IOS then return "iOS" elseif UNITY_ANDROID then return "Android" elseif UNITY_STANDALONE and UNITY_STANDALONE == "WIN" then return "Win" elseif UNITY_STANDALONE and UNITY_STANDALONE == "OSX" then return "Mac" else return "" end else return "" end end function GameAppInfo.IsShowQQ() return SDKUtil.ChannelID == LuaConst.SDKChannelId.Hero_Android or SDKUtil.ChannelID == LuaConst.SDKChannelId.Hero_iOS end --是否为海外亚服(港澳台) function GameAppInfo.IsOverseaHMT() return GameAppInfo.IsOverseaPackage() and GameAppInfo.Global_ProductId == "61" end --是否为海外美服 function GameAppInfo.IsOverseaAmerica() return GameAppInfo.IsOverseaPackage() and GameAppInfo.Global_ProductId == "62" end --是否为海外欧服 function GameAppInfo.IsOverseaEurope() return GameAppInfo.IsOverseaPackage() and GameAppInfo.Global_ProductId == "63" end function GameAppInfo.IsVersionGreaterThan14100() return true end function GameAppInfo.IsVersionGreaterThan15000() return true end --大于1.5.000版本 function GameAppInfo.IsVersionGreaterThan15000AndNotEqual() return curMarketVersionNum > 15000 end function GameAppInfo.IsVersionGreaterThan16000() return true end function GameAppInfo.IsVersionGreaterThan17000() return true end function GameAppInfo.IsVersionGreaterThan18000() return true end function GameAppInfo.IsVersionGreaterThan19000() return true end function GameAppInfo.IsVersionGreaterThan110000() return true end function GameAppInfo.IsVersionGreaterThan111000() --[[if not UNITY_EDITOR then return curMarketVersionNum >= 111000 else return true end]]-- return true end function GameAppInfo.IsVersionGreaterThan112000() --[[if not UNITY_EDITOR then return curMarketVersionNum >= 112000 else return true end]]-- return true end function GameAppInfo.IsVersionGreaterThan113000() return true end function GameAppInfo.IsVersionGreaterThan113100() return true end function GameAppInfo.IsVersionGreaterThan113400() return true end function GameAppInfo.IsVersionGreaterThan114000() return true end function GameAppInfo.IsVersionGreaterThan115000() return true end function GameAppInfo.IsVersionGreaterThan116000() return true end function GameAppInfo.IsVersionGreaterThan116600() return true end function GameAppInfo.IsVersionGreaterThan117000() return true end function GameAppInfo.IsVersionGreaterThan118000() return true end function GameAppInfo.IsVersionGreaterThan119000() return true end function GameAppInfo.IsVersionGreaterThan119601() return true end function GameAppInfo.IsVersionEqual120000() return true end function GameAppInfo.IsVersionGreaterThan120601() return true end function GameAppInfo.IsVersionGreaterThan121000() return true end function GameAppInfo.IsVersionGreaterThan122000() return true end function GameAppInfo.EditorOpenGME() --return UNITY_EDITOR and true return false end return GameAppInfo