yyl
2026-03-26 f4a702e212d1853735f8dae399da69d23bfa510e
Main/Utility/OperationLogCollect.cs
@@ -3,197 +3,82 @@
using UnityEngine;
using System;
using LitJson;
using Cysharp.Threading.Tasks;
public class OperationLogCollect : Singleton<OperationLogCollect>
{
//     const string url = "http://xssgcenter.secondworld.net.cn:11000/event_receiver?";
//     public void RecordLauchEvent(int _step)
//     {
//         return;
// #if !UNITY_EDITOR
//         if (config.versionAuthority == VersionAuthority.Release)
//         {
//             var tables = new Dictionary<string, string>();
//             tables["OperatorID"] = config.appId;
//             tables["RegionName"] = "data";
//             tables["EventID"] = 9001.ToString();
//             tables["ProductID"] = config.gameId;
//             tables["Device"] = SystemInfo.deviceName;
//             tables["DeviceFlag"] = ynmbxxjUtil.Instance.Device.uniqueID;
//             tables["IP"] = DeviceUtility.GetIp();
//             tables["DeviceFlag"] = DeviceUtility.GetDeviceUniquenessIdentify();
//             tables["Flag"] = "1001";
//             tables["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//             tables["Step"] = _step.ToString();
//             HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
//         }
// #endif
//     }
//     public void RecordEvent(int _step, uint coin = 0)
//     {
//         return;
// #if !UNITY_EDITOR
//         if (config.versionAuthority == VersionAuthority.Release)
//         {
//             var tables = new Dictionary<string, string>();
//             tables["OperatorID"] = config.appId;
//             tables["RegionName"] = "data";
//             tables["AccountID"] = ynmbxxjUtil.Instance.FreePlatformInfo == null ? "" : ynmbxxjUtil.Instance.FreePlatformInfo.account;
//             tables["EventID"] = 9001.ToString();
//             tables["ProductID"] = config.gameId;
//             tables["Device"] = SystemInfo.deviceName;
//             tables["IP"] = DeviceUtility.GetIp();
//             tables["DeviceFlag"] = ynmbxxjUtil.Instance.Device.uniqueID;
//             tables["Flag"] = config.clientPackageFlag;
//             tables["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//             tables["Step"] = _step.ToString();
//             if (coin != 0)
//             {
//                 tables["Level"] = coin.ToString();
//             }
//             string _content = StringUtility.Concat(url, HttpRequest.HashtablaToString(tables));
//             HttpRequest.Instance.RequestHttpGet(_content, HttpRequest.defaultHttpContentType);
//         }
// #endif
//     }
//     bool recordedDeviceDetail = false;
//     public void RecordDeviceDetails()
//     {
//         return;
// #if !UNITY_EDITOR
//         if (config.versionAuthority != VersionAuthority.Release)
//         {
//             return;
//         }
//         if (!recordedDeviceDetail)
//         {
//             var tables = new Dictionary<string, string>();
//             tables["OperatorID"] = config.appId;
//             tables["RegionName"] = StringUtility.Concat("s" + ServerListCenter.Instance.currentServer.region_flag);
//             tables["EventID"] = 1102.ToString();
//             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;
//             tables["SessionID"] = "";
//             var device = new Dictionary<string, string>();
//             device["IMEI"] = DeviceUtility.GetDeviceUniquenessIdentify();
//             device["DeviceFlag"] = ynmbxxjUtil.Instance.Device.uniqueID;
// #if UNITY_ANDROID
//             device["IMEI2"] = ynmbxxjUtil.Instance.Device.uniqueID;
// #endif
//             device["Brand"] = DeviceUtility.GetDeviceName();
//             device["MI5"] = DeviceUtility.GetDeviceModel();
//             tables["Device"] = JsonMapper.ToJson(device);
//             var runtime = new Dictionary<string, string>();
//             runtime["os_version"] = DeviceUtility.GetDeviceOSLevel();
//             tables["Runtime"] = JsonMapper.ToJson(runtime);
//             tables["Version"] = StringUtility.Concat(config.version, "_", config.buildIndex);
//             HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
//         }
//         recordedDeviceDetail = true;
// #endif
//     }
    const string bugReportUrl = "http://gamecenter.secondworld.net.cn:11000/center/eventreport.php?";
    const string bugReportUrl = "http://xssgcenter.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 config = VersionConfig.config;
        DeviceUtility.GetIp().ContinueWith(ip =>
        {
            var gameId = config.gameId;
        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 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;
        tables["Title"] = _title;
        tables["Content"] = _content;
        tables["ClientInfo"] = contentPrefix;
            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();
        HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
    }
    public void BugReportSys( string _content)
    //10000 战场报错, 10001 封包错误, 10002 界面操作
    public void BugReportSys(string _content, string sid = "10000")
    {
#if !UNITY_EDITOR
        try
        {
            DeviceUtility.GetIp().ContinueWith(ip =>
            var tables = new Dictionary<string, string>();
            tables["OperatorID"] = VersionConfig.Get().appId;
            tables["RegionName"] = "data";
            tables["RegionID"] = sid;
            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))
            {
                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;
                _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 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();
            HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
        }
        catch (System.Exception ex)
        {
@@ -203,21 +88,20 @@
    }
    const string chatReportUrl = "http://gamecenter.secondworld.net.cn:11000/center/eventreport.php?";
    public async void ChatReport(string content, string channelName, string toPlayer, int chatType)
    const string chatReportUrl = "http://xssgcenter.secondworld.net.cn:11000/center/eventreport.php?";
    public void ChatReport(string content, string channelName, string toPlayer, int chatType)
    {
#if !UNITY_EDITOR
        bool isFairy = chatType == 3;
        var tables = new Dictionary<string, string>();
        var config = VersionConfig.config;
        tables["ProductID"] = config.gameId;
        tables["OperatorID"] = config.appId;
        tables["ProductID"] = VersionConfig.Get().gameId;
        tables["OperatorID"] = VersionConfig.Get().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"] = await DeviceUtility.GetIp();
        tables["IP"] = DeviceUtility.GetIp();
        tables["ChatChannel"] = channelName;
        var sdkLoginResult = LoginManager.Instance.sdkLoginResult;
        tables["AccountID"] = sdkLoginResult == null ? LoginManager.Instance.accountBuf : sdkLoginResult.account;