guodong 1 gadu atpakaļ
vecāks
revīzija
c556d357a9

+ 8 - 0
GameClient/Assets/Game/HotUpdate/GameConfig.cs

@@ -8,6 +8,14 @@ namespace GFGGame
     public class GameConfig
     {
 
+        public static string SOUND_KEY = "sound";
+        public static string MUSIC_KEY = "music";
+        public static string VOICE_KEY = "voice";
+
+        public static string SOUND_VOLUMN_KEY = "sound_volumn";
+        public static string MUSIC_VOLUMN_KEY = "music_volumn";
+        public static string VOICE_VOLUMN_KEY = "voice_volumn";
+
         public static string LoginAddress;
         public static string PlatformName;
         public static string logApiReportUrl;

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Sound/MusicManager.cs

@@ -38,7 +38,7 @@ namespace GFGGame
                     {
                         Stop();
                     }
-                    LocalCache.SetBool(LauncherConfig.MUSIC_KEY, _isOn);
+                    LocalCache.SetBool(GameConfig.MUSIC_KEY, _isOn);
                 }
             }
         }
@@ -48,8 +48,8 @@ namespace GFGGame
         {
             player = this.gameObject.AddComponent<AudioSource>();
             player.loop = true;
-            isOn = LocalCache.GetBool(LauncherConfig.MUSIC_KEY, true);
-            settingVolumn = LocalCache.GetFloat(LauncherConfig.MUSIC_VOLUMN_KEY, 1.0f);
+            isOn = LocalCache.GetBool(GameConfig.MUSIC_KEY, true);
+            settingVolumn = LocalCache.GetFloat(GameConfig.MUSIC_VOLUMN_KEY, 1.0f);
             player.volume = settingVolumn;
         }
 

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Sound/SoundManager.cs

@@ -35,7 +35,7 @@ namespace GFGGame
                         GRoot.inst.soundVolume = 0;
                         Stop();
                     }
-                    LocalCache.SetBool(LauncherConfig.SOUND_KEY, _isOn);
+                    LocalCache.SetBool(GameConfig.SOUND_KEY, _isOn);
                 }
             }
         }
@@ -43,8 +43,8 @@ namespace GFGGame
         private void Awake()
         {
             player = this.gameObject.AddComponent<AudioSource>();
-            isOn = LocalCache.GetBool(LauncherConfig.SOUND_KEY, true);
-            player.volume = LocalCache.GetFloat(LauncherConfig.SOUND_VOLUMN_KEY, 1.0f);
+            isOn = LocalCache.GetBool(GameConfig.SOUND_KEY, true);
+            player.volume = LocalCache.GetFloat(GameConfig.SOUND_VOLUMN_KEY, 1.0f);
         }
 
         private void Start()

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Sound/VoiceManager.cs

@@ -35,7 +35,7 @@ namespace GFGGame
                         //player.volume = 0;
                         Stop();
                     }
-                    LocalCache.SetBool(LauncherConfig.VOICE_KEY, _isOn);
+                    LocalCache.SetBool(GameConfig.VOICE_KEY, _isOn);
                 }
             }
         }
@@ -46,8 +46,8 @@ namespace GFGGame
             player.priority = 256;
             //设置这个声音会大一些
             player.spatialBlend = 1f;
-            isOn = LocalCache.GetBool(LauncherConfig.VOICE_KEY, true);
-            player.volume = LocalCache.GetFloat(LauncherConfig.VOICE_VOLUMN_KEY, 1.0f);
+            isOn = LocalCache.GetBool(GameConfig.VOICE_KEY, true);
+            player.volume = LocalCache.GetFloat(GameConfig.VOICE_VOLUMN_KEY, 1.0f);
         }
 
         public void LoadRes(string path)

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/SettingView.cs

@@ -147,7 +147,7 @@ namespace GFGGame
             UI_Slider2.ProxyEnd();
 
             VoiceManager.Instance.SetVolumn(volumn);
-            LocalCache.SetFloat(LauncherConfig.VOICE_VOLUMN_KEY, volumn);
+            LocalCache.SetFloat(GameConfig.VOICE_VOLUMN_KEY, volumn);
         }
 
         private void OnChangeMusicVolumn()
@@ -158,7 +158,7 @@ namespace GFGGame
             UI_Slider2.ProxyEnd();
             MusicManager.Instance.SetSettingVolumn(volumn);
             MusicManager.Instance.SetVolume(volumn);
-            LocalCache.SetFloat(LauncherConfig.MUSIC_VOLUMN_KEY, volumn);
+            LocalCache.SetFloat(GameConfig.MUSIC_VOLUMN_KEY, volumn);
         }
 
         private void OnChangeSoundVolumn()
@@ -169,7 +169,7 @@ namespace GFGGame
             UI_Slider2.ProxyEnd();
 
             SoundManager.Instance.SetVolumn(volumn);
-            LocalCache.SetFloat(LauncherConfig.SOUND_VOLUMN_KEY, volumn);
+            LocalCache.SetFloat(GameConfig.SOUND_VOLUMN_KEY, volumn);
         }
 
         private void OnClickBtnChangeMainBg()

+ 13 - 9
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -13,21 +13,12 @@ namespace GFGGame
         public const string DllDirAOT = "Assets/ResIn/Dll/AOT/";
         public const int HTTP_GET_TIME_OUT = 3;
         public const int HTTP_POST_TIME_OUT = 15;
-        public static string SOUND_KEY = "sound";
-        public static string MUSIC_KEY = "music";
-        public static string VOICE_KEY = "voice";
-
-        public static string SOUND_VOLUMN_KEY = "sound_volumn";
-        public static string MUSIC_VOLUMN_KEY = "music_volumn";
-        public static string VOICE_VOLUMN_KEY = "voice_volumn";
 
         public const string SQL_FILE_NAME = "excelConfig.sqlite.bytes";
 
         public const string LAST_LOGIN_IS_AGREE_KEY = "LAST_LOGIN_IS_AGREE_KEY_6";//上次登录是否同意隐私政策
 
         public static string CDN_ROOT;
-        public static string loginApiUrl;
-        public static string gameApiUrl;
         public static string launcherRootUrl;
         public static string cfgUrl;
         //平台id
@@ -39,9 +30,15 @@ namespace GFGGame
         public static string apkVersion;
         //0 正常,1 维护中,2 提审中
         public static int serverStatus;
+        //0 关闭所有log界面,1 开启后台log界面, 2 开启弹窗log界面
         public static int onDebug;
+        //AB资源版本
         public static string manifest_v;
+        //隐私政策文件地址模版
         public static string privacy_v;
+        public static string statusPrompt;
+        public static string updateAppPrompt;
+        public static string updateResPrompt;
 
         public static void InitScriptCompilation()
         {
@@ -82,6 +79,9 @@ namespace GFGGame
             LauncherConfig.onDebug = int.Parse(result.onDebug);
             LauncherConfig.manifest_v = result.manifest_v;
             LauncherConfig.privacy_v = result.privacy_v;
+            LauncherConfig.statusPrompt = result.statusPrompt;
+            LauncherConfig.updateAppPrompt = result.updateAppPrompt;
+            LauncherConfig.updateResPrompt = result.updateResPrompt;
         }
 
         private struct Result
@@ -93,6 +93,10 @@ namespace GFGGame
             public string onDebug;
             public string manifest_v;
             public string privacy_v;
+            public string statusPrompt;
+            public string updateAppPrompt;
+            public string updateResPrompt;
+            public string promptSizeMB;
         }
 
     }

+ 8 - 11
GameClient/Assets/Game/Launcher/LauncherController.cs

@@ -43,7 +43,11 @@ namespace GFGGame
 
             if (LauncherConfig.serverStatus == 1)
             {
-                Alert.Show("游戏正在维护中,请稍后再试。")
+                if(string.IsNullOrEmpty(LauncherConfig.statusPrompt))
+                {
+                    LauncherConfig.statusPrompt = "游戏正在维护中,请稍后再试。";
+                }
+                Alert.Show(LauncherConfig.statusPrompt)
                     .SetLeftButton(true, "知道了", (data) =>
                     {
 
@@ -76,18 +80,11 @@ namespace GFGGame
 
         private static void DownloadApk()
         {
-            string message = "需要安装新的安装包,请联系研发获取。";
-#if PT_IOS
-            if(LauncherConfig.serverStatus == 2)
+            if(string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
             {
-                message = "有新的版本,请前往TestFlight更新。";
+                LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
             }
-            else
-            {
-                message = "有新的版本,请前往AppStore更新。";
-            }
-#endif
-            Alert.Show(message)
+            Alert.Show(LauncherConfig.updateAppPrompt)
                     .SetLeftButton(true, "知道了", (data) =>
                     {
 

+ 19 - 9
GameClient/Assets/Game/Launcher/Version/VersionController.cs

@@ -135,13 +135,24 @@ namespace GFGGame
                 long totalDownloadBytes = downloaderOperation.TotalDownloadBytes;
                 float sizeMB = totalDownloadBytes / 1048576f;
                 sizeMB = Mathf.Clamp(sizeMB, 0.1f, float.MaxValue);
-                string totalSizeMB = sizeMB.ToString("f1");
-                string message = $"游戏有新的内容,{packageName}需要更新{totalSizeMB}MB大小的内容";
-                Alert.Show(message)
-                    .SetLeftButton(true, "更新", (data) =>
+                if(sizeMB > 10)
+                {
+                    string totalSizeMB = sizeMB.ToString("f1");
+                    if(string.IsNullOrEmpty(LauncherConfig.updateResPrompt))
                     {
-                        StartCoroutine(BeginDownload(downloaderOperation, packageName));
-                    });
+                        LauncherConfig.updateResPrompt = $"游戏有新的内容,需要更新{0}MB大小的资源";
+                    }
+                    string message = string.Format(LauncherConfig.updateResPrompt, totalSizeMB);
+                    Alert.Show(message)
+                        .SetLeftButton(true, "更新", (data) =>
+                        {
+                            StartCoroutine(BeginDownload(downloaderOperation, packageName));
+                        });
+                }
+                else
+                {
+                    StartCoroutine(BeginDownload(downloaderOperation, packageName));
+                }
             }
         }
 
@@ -183,8 +194,7 @@ namespace GFGGame
         /// </summary>
         private string GetHostServerURL(string packageName)
         {
-            //string hostServerIP = "http://10.108.64.127";
-            string hostServerIP = LauncherConfig.CDN_ROOT;
+            //LauncherConfig.CDN_ROOT = "http://10.108.64.127";
 
             string platform = "PC";
 #if UNITY_EDITOR
@@ -202,7 +212,7 @@ namespace GFGGame
 		else if (Application.platform == RuntimePlatform.WebGLPlayer)
                 platform = "WebGL";
 #endif
-            return $"{hostServerIP}/{platform}/{packageName}/HostPlay";
+            return $"{LauncherConfig.CDN_ROOT}/{platform}/{packageName}/HostPlay";
         }
         /// <summary>
         /// 远端资源地址查询服务类