hch
2026-01-10 5bd8817873bcc16713bd9e691b798f319ce9de0b
0312 接入聊天监控但注释掉不会发等后台接入
2个文件已修改
23 ■■■■ 已修改文件
Main/System/Chat/ChatManager.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/OperationLogCollect.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Chat/ChatManager.cs
@@ -328,6 +328,21 @@
        pack.Content = content;
        pack.Len = (ushort)GetUTF8InfoLen(content);
        GameNetSystem.Instance.SendInfo(pack);
        ChatReport(channelType, content);
    }
    void ChatReport(int chatType, string content, string toPlayer="")
    {
        try
        {
            var channelName = Language.Get($"ChatTab{chatType}");
            OperationLogCollect.Instance.ChatReport(content, channelName, toPlayer, chatType);
        }
        catch (Exception e)
        {
            Debug.LogError(e.StackTrace + e.Message);
        }
    }
    public readonly int maxTalkCount = 1000;  //聊天数量上限
Main/Utility/OperationLogCollect.cs
@@ -191,18 +191,18 @@
    public void ChatReport(string content, string channelName, string toPlayer, int chatType)
    {
// #if !UNITY_EDITOR
//         bool isFairy = false; //chatType == ChatInfoType.Fairy;
//         bool isFairy = chatType == 3;
//         var tables = new Dictionary<string, string>();
//         tables["ProductID"] = VersionConfig.Get().gameId;
//         tables["OperatorID"] = VersionConfig.Get().appId;
//         tables["OperatorName"] = string.Empty;
//         tables["RegionName"] = StringUtility.Concat("s", ServerListCenter.Instance.currentServer.region_flag);
//         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["ChatChannel"] = channelName;
//         var sdkLoginResult = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult;
//         var sdkLoginResult = LoginManager.Instance.sdkLoginResult;
//         tables["AccountID"] = sdkLoginResult == null ? string.Empty : sdkLoginResult.account;
//         tables["RoleID"] = StringUtility.Concat(isFairy ? UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.FamilyName) : string.Empty,
//            isFairy ? "-" : string.Empty, UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName));
@@ -210,7 +210,7 @@
//         tables["Level"] = PlayerDatas.Instance.baseData.LV.ToString();
//         tables["VIPLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
//         tables["Content"] = WWW.EscapeURL(UIHelper.TrimContentToServer(content));
//         tables["DeviceFlag"] = ynmbxxjUtil.Instance.Device == null ? string.Empty : ynmbxxjUtil.Instance.Device.uniqueID;
//         tables["DeviceFlag"] = SDKUtils.Instance.Device == null ? string.Empty : SDKUtils.Instance.Device.uniqueID;
//         HttpRequest.Instance.RequestHttpGet(StringUtility.Concat(chatReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
// #endif