فهرست منبع

Merge branch 'master' of http://git.gfggame.com:3000/gfg/client

zhaoyang 3 سال پیش
والد
کامیت
2d64381808

+ 31 - 28
GameClient/Assets/Editor/Xasset/Builds/BuildTask.cs

@@ -234,24 +234,24 @@ namespace VEngine.Editor.Builds
         /// <summary>
         /// 创建加密的AssetBundle
         /// </summary>
-        public static void CreateEncryptAssets(string bundlePackagePath, string encryptAssetPath, AssetBundleManifest manifest, string secretKey)
-        {
-            if (!Directory.Exists(encryptAssetPath))
-            {
-                Directory.CreateDirectory(encryptAssetPath);
-            }
-            string[] assetBundles = manifest.GetAllAssetBundles();
-            foreach (string assetBundle in assetBundles)
-            {
-                string bundlePath = Path.Combine(bundlePackagePath, assetBundle);
-                byte[] encryptBytes = EncryptHelper.CreateEncryptData(bundlePath, secretKey);
-                using (FileStream fs = new FileStream(Path.Combine(encryptAssetPath, assetBundle), FileMode.OpenOrCreate))
-                {
-                    fs.SetLength(0);
-                    fs.Write(encryptBytes, 0, encryptBytes.Length);
-                }
-            }
-        }
+        //public static void CreateEncryptAssets(string bundlePackagePath, string encryptAssetPath, AssetBundleManifest manifest, string secretKey)
+        //{
+        //    if (!Directory.Exists(encryptAssetPath))
+        //    {
+        //        Directory.CreateDirectory(encryptAssetPath);
+        //    }
+        //    string[] assetBundles = manifest.GetAllAssetBundles();
+        //    foreach (string assetBundle in assetBundles)
+        //    {
+        //        string bundlePath = Path.Combine(bundlePackagePath, assetBundle);
+        //        byte[] encryptBytes = EncryptHelper.CreateEncryptData(bundlePath, secretKey);
+        //        using (FileStream fs = new FileStream(Path.Combine(encryptAssetPath, assetBundle), FileMode.OpenOrCreate))
+        //        {
+        //            fs.SetLength(0);
+        //            fs.Write(encryptBytes, 0, encryptBytes.Length);
+        //        }
+        //    }
+        //}
 
         /// <summary>
         /// 创建加密的AssetBundle
@@ -324,6 +324,7 @@ namespace VEngine.Editor.Builds
             var newFiles = new List<string>();
             var newSize = 0L;
             foreach (var bundle in bundles)
+            {
                 if (!getBundles.TryGetValue(bundle.name, out var value) ||
                     value.nameWithAppendHash != bundle.nameWithAppendHash)
                 {
@@ -333,17 +334,19 @@ namespace VEngine.Editor.Builds
                         string buildPath = Settings.PlatformBuildPath;
                         CreateEncryptAsset(Settings.UnityBuildPath, buildPath, bundle.nameWithAppendHash, GFGGame.LauncherConfig.resKey);
                     }
-                    var file = Settings.GetBuildPath(bundle.nameWithAppendHash);
-                    if (File.Exists(file))
-                        using (var stream = File.OpenRead(file))
-                        {
-                            bundle.size = stream.Length;
-                            bundle.crc = Utility.ComputeCRC32(stream);
-                        }
-                    else
-                        Debug.LogErrorFormat("File not found: {0}", file);
-                    newSize += bundle.size;
                 }
+                var file = Settings.GetBuildPath(bundle.nameWithAppendHash);
+                if (File.Exists(file))
+                    using (var stream = File.OpenRead(file))
+                    {
+                        bundle.size = stream.Length;
+                        bundle.crc = Utility.ComputeCRC32(stream);
+                    }
+                else
+                    Debug.LogErrorFormat("File not found: {0}", file);
+                newSize += bundle.size;
+            }
+                
 
             manifest.bundles = bundles;
             var newFilesSize = Utility.FormatBytes(newSize);

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -35,6 +35,7 @@ namespace GFGGame
         public static void GetGameCfg()
         {
             var url = LauncherConfig.cfgUrl.Replace("{cfgName}", GameGlobal.cfgName);
+            url = url + "?t=" + TimeHelper.ClientNow();
             HttpTool.Instance.Get(url, (string data) =>
             {
                 //初始化游戏配置

+ 11 - 12
GameClient/Assets/Game/HotUpdate/Controller/LogController.cs

@@ -75,20 +75,19 @@ namespace GFGGame
                     }
                     break;
                 default:
-                    if (msgDic[_all].Count == _maxCount)
-                    {
-                        msgDic[_all].RemoveAt(0);
-                    }
-                    if (msgDic[_log].Count == _maxCount)
-                    {
-                        msgDic[_log].RemoveAt(0);
-                    }
-                    msg = string.Format("log@{2}\n{0}\n{1}", condition, stackTrace, time);
-                    msgDic[_all].Add(msg);
-                    msgDic[_log].Add(msg);
                     if (LauncherConfig.onDebug >= 2)
                     {
-                        ViewManager.Show(ViewName.LOG_VIEW);
+                        if (msgDic[_all].Count == _maxCount)
+                        {
+                            msgDic[_all].RemoveAt(0);
+                        }
+                        if (msgDic[_log].Count == _maxCount)
+                        {
+                            msgDic[_log].RemoveAt(0);
+                        }
+                        msg = string.Format("log@{2}\n{0}\n{1}", condition, stackTrace, time);
+                        msgDic[_all].Add(msg);
+                        msgDic[_log].Add(msg);
                     }
                     break;
             }

+ 6 - 2
GameClient/Assets/Game/HotUpdate/Controller/LogServerHelper.cs

@@ -20,7 +20,9 @@ namespace GFGGame
             logData.sAccount = SystemInfo.deviceUniqueIdentifier;
             logData.iEvent = node;
             var logStr = zoneScene.GetComponent<LogSplicingComponent>().LogObjectToStr(logData);
-            LogSProxy.SendLog(logStr);
+            //LogSProxy.SendLog(logStr);
+            var body = $"_{logStr}";
+            HttpTool.Instance.Post(LauncherConfig.logApiUrl, body);
         }
         /// <summary>
         /// 发送玩法参与度
@@ -40,7 +42,9 @@ namespace GFGGame
             logData.iEvent = ievent;
             logData.type = type;
             var logStr = zoneScene.GetComponent<LogSplicingComponent>().LogObjectToStr(logData);
-            LogSProxy.SendLog(logStr);
+            //LogSProxy.SendLog(logStr);
+            var body = $"_{logStr}";
+            HttpTool.Instance.Post(LauncherConfig.logApiUrl, body);
         }
     }
 }

+ 2 - 0
GameClient/Assets/Game/Launcher/GameLauncher.cs

@@ -3,6 +3,7 @@ using GFGGame;
 using ET;
 using System.Threading;
 using GFGGame.Launcher;
+using System;
 
 public class GameLauncher : MonoBehaviour
 {
@@ -45,6 +46,7 @@ public class GameLauncher : MonoBehaviour
     {
         LauncherView.Instance.SetDesc("正在初始化..");
         var url = LauncherConfig.cfgUrl.Replace("{cfgName}", LauncherConfig.cfgName);
+        url = url + "?t=" +  TimeHelper.ClientNow();
         HttpTool.Instance.Get(url, (string json) =>
         {
             LauncherConfig.InitPlatform(json);

+ 1 - 1
GameClient/Assets/Game/Launcher/Net/Http/HttpTool.cs

@@ -117,7 +117,7 @@ namespace GFGGame
             string paramCallback = null;
             if (webRequest.result == UnityWebRequest.Result.ProtocolError || webRequest.result == UnityWebRequest.Result.ConnectionError)
             {
-                ET.Log.Error(webRequest.error + "\n" + webRequest.downloadHandler.text + "\nby " + tag);
+                ET.Log.Warning(webRequest.error + "\n" + webRequest.downloadHandler.text + "\nby " + tag);
                 retryFunc?.Invoke();
             }
             else

+ 1 - 1
GameClient/Assets/ResIn/Txt/privacyPolicy.txt

@@ -2,7 +2,7 @@
 
 概要
 
-欢迎您选择游戏!除《游戏许可及服务协议》外,我们还将通过《游戏隐私政策》(“本指引”)向您进一步细化说明您在使用游戏时我们收集、使用、存储和共享个人信息的情况,以及您所享有的相关权利等事宜,本指引是《游戏隐身政策》的组成部分,其中要点如下:
+深圳市梦玩网络科技有限公司(以下简称“我们”)!除《游戏许可及服务协议》外,我们还将通过《游戏隐私政策》(“本指引”)向您进一步细化说明您在使用游戏时我们收集、使用、存储和共享个人信息的情况,以及您所享有的相关权利等事宜,本指引是《游戏隐身政策》的组成部分,其中要点如下:
 
 •为了向您提供游戏娱乐以及与此相关的玩家互动、消费等服务,我们需要收集您的游戏历史、设备信息、登录日志等信息。