From 1ab047b5fdd933c38ba0519ec2e83a44512ea8d7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 17:46:11 +0800
Subject: [PATCH] webgl代码合并 1

---
 Main/Utility/OperationLogCollect.cs |  156 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 86 insertions(+), 70 deletions(-)

diff --git a/Main/Utility/OperationLogCollect.cs b/Main/Utility/OperationLogCollect.cs
index f80ac79..d260794 100644
--- a/Main/Utility/OperationLogCollect.cs
+++ b/Main/Utility/OperationLogCollect.cs
@@ -3,6 +3,7 @@
 using UnityEngine;
 using System;
 using LitJson;
+using Cysharp.Threading.Tasks;
 
 
 public class OperationLogCollect : Singleton<OperationLogCollect>
@@ -14,13 +15,13 @@
 //     {
 //         return;
 // #if !UNITY_EDITOR
-//         if (VersionConfig.Get().versionAuthority == VersionAuthority.Release)
+//         if (config.versionAuthority == VersionAuthority.Release)
 //         {
 //             var tables = new Dictionary<string, string>();
-//             tables["OperatorID"] = VersionConfig.Get().appId;
+//             tables["OperatorID"] = config.appId;
 //             tables["RegionName"] = "data";
 //             tables["EventID"] = 9001.ToString();
-//             tables["ProductID"] = VersionConfig.Get().gameId;
+//             tables["ProductID"] = config.gameId;
 //             tables["Device"] = SystemInfo.deviceName;
 //             tables["DeviceFlag"] = ynmbxxjUtil.Instance.Device.uniqueID;
 //             tables["IP"] = DeviceUtility.GetIp();
@@ -38,18 +39,18 @@
 //     {
 //         return;
 // #if !UNITY_EDITOR
-//         if (VersionConfig.Get().versionAuthority == VersionAuthority.Release)
+//         if (config.versionAuthority == VersionAuthority.Release)
 //         {
 //             var tables = new Dictionary<string, string>();
-//             tables["OperatorID"] = VersionConfig.Get().appId;
+//             tables["OperatorID"] = config.appId;
 //             tables["RegionName"] = "data";
 //             tables["AccountID"] = ynmbxxjUtil.Instance.FreePlatformInfo == null ? "" : ynmbxxjUtil.Instance.FreePlatformInfo.account;
 //             tables["EventID"] = 9001.ToString();
-//             tables["ProductID"] = VersionConfig.Get().gameId;
+//             tables["ProductID"] = config.gameId;
 //             tables["Device"] = SystemInfo.deviceName;
 //             tables["IP"] = DeviceUtility.GetIp();
 //             tables["DeviceFlag"] = ynmbxxjUtil.Instance.Device.uniqueID;
-//             tables["Flag"] = VersionConfig.Get().clientPackageFlag;
+//             tables["Flag"] = config.clientPackageFlag;
 //             tables["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 //             tables["Step"] = _step.ToString();
 
@@ -69,7 +70,7 @@
 //     {
 //         return;
 // #if !UNITY_EDITOR
-//         if (VersionConfig.Get().versionAuthority != VersionAuthority.Release)
+//         if (config.versionAuthority != VersionAuthority.Release)
 //         {
 //             return;
 //         }
@@ -77,10 +78,10 @@
 //         if (!recordedDeviceDetail)
 //         {
 //             var tables = new Dictionary<string, string>();
-//             tables["OperatorID"] = VersionConfig.Get().appId;
+//             tables["OperatorID"] = config.appId;
 //             tables["RegionName"] = StringUtility.Concat("s" + ServerListCenter.Instance.currentServer.region_flag);
 //             tables["EventID"] = 1102.ToString();
-//             tables["ProductID"] = VersionConfig.Get().gameId;
+//             tables["ProductID"] = config.gameId;
 //             tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 //             tables["IP"] = DeviceUtility.GetIp();
 //             tables["AccountID"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
@@ -99,7 +100,7 @@
 //             var runtime = new Dictionary<string, string>();
 //             runtime["os_version"] = DeviceUtility.GetDeviceOSLevel();
 //             tables["Runtime"] = JsonMapper.ToJson(runtime);
-//             tables["Version"] = StringUtility.Concat(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
+//             tables["Version"] = StringUtility.Concat(config.version, "_", config.buildIndex);
 
 //             HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
 //         }
@@ -109,36 +110,45 @@
 //     }
 
 
-    const string bugReportUrl = "http://xssgcenter.secondworld.net.cn:11000/center/eventreport.php?";
+    const string bugReportUrl = "http://gamecenter.secondworld.net.cn:11000/center/eventreport.php?";
 
     public void BugReport(string _title, string _content)
     {
-        var tables = new Dictionary<string, string>();
-        tables["OperatorID"] = VersionConfig.Get().appId;
-        tables["RegionName"] = "data";
-        tables["RegionID"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
-        tables["EventID"] = 9002.ToString();
-        tables["ProductID"] = VersionConfig.Get().gameId;
-        tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-        tables["IP"] = DeviceUtility.GetIp();
-        tables["AccountID"] = LoginManager.Instance.sdkLoginResult.account;
-        tables["Level"] = PlayerDatas.Instance.baseData.LV.ToString();
-        tables["RoleID"] = PlayerDatas.Instance.baseData.PlayerName;
-        tables["VIPLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
-        tables["DeviceFlag"] = SDKUtils.Instance.Device.uniqueID;
 
-        var contentPrefix = StringUtility.Concat("IMEI:", DeviceUtility.GetDeviceUniquenessIdentify(), ";");
-        contentPrefix = StringUtility.Concat(contentPrefix, "Version:", StringUtility.Concat(VersionConfig.Get().version, "_", 
-            VersionConfig.Get().buildIndex.ToString(), "-", LoginManager.Instance.hotVersion), Language.Id, ";");
-        contentPrefix = StringUtility.Concat(contentPrefix, "Brand:", DeviceUtility.GetDeviceName(), ";");
-        contentPrefix = StringUtility.Concat(contentPrefix, "MI5:", DeviceUtility.GetDeviceModel(), ";");
-        contentPrefix = StringUtility.Concat(contentPrefix, "os_version:", DeviceUtility.GetDeviceOSLevel(), ";");
+        var config = VersionConfig.config;
+        DeviceUtility.GetIp().ContinueWith(ip =>
+        {
+            var gameId = config.gameId;
 
-        tables["Title"] = _title;
-        tables["Content"] = _content;
-        tables["ClientInfo"] = contentPrefix;
+            var tables = new Dictionary<string, string>();
+            tables["OperatorID"] = config.appId;
+            tables["RegionName"] = "data";
+            tables["RegionID"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
+            tables["EventID"] = 9002.ToString();
+            tables["ProductID"] = config.gameId;
+            tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            tables["IP"] = ip;
+            tables["AccountID"] = LoginManager.Instance.sdkLoginResult.account;
+            tables["Level"] = PlayerDatas.Instance.baseData.LV.ToString();
+            tables["RoleID"] = PlayerDatas.Instance.baseData.PlayerName;
+            tables["VIPLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
+            tables["DeviceFlag"] = SDKUtils.Instance.Device.uniqueID;
 
-        HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
+            var contentPrefix = StringUtility.Concat("IMEI:", DeviceUtility.GetDeviceUniquenessIdentify(), ";");
+            contentPrefix = StringUtility.Concat(contentPrefix, "Version:", StringUtility.Concat(config.version, "_", 
+                config.buildIndex.ToString(), "-", LoginManager.Instance.hotVersion), Language.Id, ";");
+            contentPrefix = StringUtility.Concat(contentPrefix, "Brand:", DeviceUtility.GetDeviceName(), ";");
+            contentPrefix = StringUtility.Concat(contentPrefix, "MI5:", DeviceUtility.GetDeviceModel(), ";");
+            contentPrefix = StringUtility.Concat(contentPrefix, "os_version:", DeviceUtility.GetDeviceOSLevel(), ";");
+
+            tables["Title"] = _title;
+            tables["Content"] = _content;
+            tables["ClientInfo"] = contentPrefix;
+
+            HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
+
+        }).Forget();
+
 
     }
 
@@ -147,38 +157,43 @@
 #if !UNITY_EDITOR
         try
         {
-            var tables = new Dictionary<string, string>();
-            tables["OperatorID"] = VersionConfig.Get().appId;
-            tables["RegionName"] = "data";
-            tables["RegionID"] = "10000";
-            tables["EventID"] = 9002.ToString();
-            tables["ProductID"] = VersionConfig.Get().gameId;
-            tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-            tables["IP"] = DeviceUtility.GetIp();
-            tables["AccountID"] = "system";
-            tables["Level"] = "1";
-            tables["RoleID"] = "system";
-            tables["VIPLevel"] = "1";
-            tables["DeviceFlag"] = SDKUtils.Instance.Device.uniqueID;
-
-            var contentPrefix = StringUtility.Concat("IMEI:", DeviceUtility.GetDeviceUniquenessIdentify(), ";");
-            contentPrefix = StringUtility.Concat(contentPrefix, "Version:", StringUtility.Concat(VersionConfig.Get().version, "_",
-                VersionConfig.Get().buildIndex.ToString(), "-", LoginManager.Instance.hotVersion), Language.Id, ";");
-            contentPrefix = StringUtility.Concat(contentPrefix, "Brand:", DeviceUtility.GetDeviceName(), ";");
-            contentPrefix = StringUtility.Concat(contentPrefix, "MI5:", DeviceUtility.GetDeviceModel(), ";");
-            contentPrefix = StringUtility.Concat(contentPrefix, "os_version:", DeviceUtility.GetDeviceOSLevel(), ";");
-
-            tables["Title"] = "system";
-            _content = _content.Replace("0000", "");
-            if (ConfigManager.Instance.isLoadFinished && DTC0102_tagCDBPlayer.playerIdBuf != 0 && LoginManager.Instance.sdkLoginResult != null && !string.IsNullOrEmpty(LoginManager.Instance.sdkLoginResult.account))
+            DeviceUtility.GetIp().ContinueWith(ip =>
             {
-                _content = StringUtility.Concat(LoginManager.Instance.sdkLoginResult.account, "@", ServerListCenter.Instance.currentServer.region_flag.ToString(), " ", _content);
-            }
-            
-            tables["Content"] = _content.Substring(0, Math.Min(800, _content.Length));
-            tables["ClientInfo"] = contentPrefix;
+                var config = VersionConfig.config;
+                var tables = new Dictionary<string, string>();
+                tables["OperatorID"] = config.appId;
+                tables["RegionName"] = "data";
+                tables["RegionID"] = "10000";
+                tables["EventID"] = 9002.ToString();
+                tables["ProductID"] = config.gameId;
+                tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                tables["IP"] = ip;
+                tables["AccountID"] = "system";
+                tables["Level"] = "1";
+                tables["RoleID"] = "system";
+                tables["VIPLevel"] = "1";
+                tables["DeviceFlag"] = SDKUtils.Instance.Device.uniqueID;
 
-            HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
+                var contentPrefix = StringUtility.Concat("IMEI:", DeviceUtility.GetDeviceUniquenessIdentify(), ";");
+                contentPrefix = StringUtility.Concat(contentPrefix, "Version:", StringUtility.Concat(config.version, "_",
+                    config.buildIndex.ToString(), "-", LoginManager.Instance.hotVersion), Language.Id, ";");
+                contentPrefix = StringUtility.Concat(contentPrefix, "Brand:", DeviceUtility.GetDeviceName(), ";");
+                contentPrefix = StringUtility.Concat(contentPrefix, "MI5:", DeviceUtility.GetDeviceModel(), ";");
+                contentPrefix = StringUtility.Concat(contentPrefix, "os_version:", DeviceUtility.GetDeviceOSLevel(), ";");
+
+                tables["Title"] = "system";
+                _content = _content.Replace("0000", "");
+                if (ConfigManager.Instance.isLoadFinished && DTC0102_tagCDBPlayer.playerIdBuf != 0 && LoginManager.Instance.sdkLoginResult != null && !string.IsNullOrEmpty(LoginManager.Instance.sdkLoginResult.account))
+                {
+                    _content = StringUtility.Concat(LoginManager.Instance.sdkLoginResult.account, "@", ServerListCenter.Instance.currentServer.region_flag.ToString(), " ", _content);
+                }
+                
+                tables["Content"] = _content.Substring(0, Math.Min(800, _content.Length));
+                tables["ClientInfo"] = contentPrefix;
+
+                HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
+            }).Forget();
+
         }
         catch (System.Exception ex)
         {
@@ -188,20 +203,21 @@
     }
 
 
-    const string chatReportUrl = "http://xssgcenter.secondworld.net.cn:11000/center/eventreport.php?";
-    public void ChatReport(string content, string channelName, string toPlayer, int chatType)
+    const string chatReportUrl = "http://gamecenter.secondworld.net.cn:11000/center/eventreport.php?";
+    public async void ChatReport(string content, string channelName, string toPlayer, int chatType)
     {
 #if !UNITY_EDITOR
         bool isFairy = chatType == 3;
         var tables = new Dictionary<string, string>();
-        tables["ProductID"] = VersionConfig.Get().gameId;
-        tables["OperatorID"] = VersionConfig.Get().appId;
+        var config = VersionConfig.config;
+        tables["ProductID"] = config.gameId;
+        tables["OperatorID"] = config.appId;
         tables["OperatorName"] = string.Empty;
         tables["RegionName"] = StringUtility.Concat("s", ServerListCenter.Instance.currentServer.region_flag.ToString());
         tables["RegionID"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
         tables["EventID"] = 9003.ToString();
         tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
-        tables["IP"] = DeviceUtility.GetIp();
+        tables["IP"] = await DeviceUtility.GetIp();
         tables["ChatChannel"] = channelName;
         var sdkLoginResult = LoginManager.Instance.sdkLoginResult;
         tables["AccountID"] = sdkLoginResult == null ? LoginManager.Instance.accountBuf : sdkLoginResult.account;

--
Gitblit v1.8.0