From 7baa60bfcb48013404bdda4f3466b5feeaef69d4 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 24 二月 2025 01:29:13 +0800
Subject: [PATCH] 0312 脏字检查 不检查表情

---
 System/Chat/ChatSendComponent.cs |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/System/Chat/ChatSendComponent.cs b/System/Chat/ChatSendComponent.cs
index 8f52692..fdca6d8 100644
--- a/System/Chat/ChatSendComponent.cs
+++ b/System/Chat/ChatSendComponent.cs
@@ -154,7 +154,19 @@
             }
             m_OnChating = true;
             string msg = m_ChatInput.text;
-            ChatCtrl.Inst.SendChatInfo(ChatCtrl.Inst.presentChatType, msg, info);
+
+            string tmpMsg = ImgAnalysis.ReplaceFace(msg, out int faceCount);
+            if (DirtyWordConfig.IsDirtWord(tmpMsg))
+            {
+                tmpMsg = DirtyWordConfig.IsDirtWord(tmpMsg, '*');
+                tmpMsg = tmpMsg.Replace("*", "");
+                m_ChatInput.text = tmpMsg;
+                SysNotifyMgr.Instance.ShowTip("DirtyWordWarn");
+                m_OnChating = false;
+                return;
+            }
+
+            ChatCtrl.Inst.SendChatInfo(ChatCtrl.Inst.presentChatType, msg, info, false);
             StartCoroutine(Co_CoolDowmChat());
 
             ModelCenter.Instance.GetModel<FirstTimeRechargeModel>().AskFirstRechargeMore(msg);
@@ -219,7 +231,7 @@
                 CheckMaliceChat(msg);
             }
             m_OnChating = true;
-            ChatCtrl.Inst.SendChatInfo(ChatCtrl.Inst.presentChatType, msg, info);
+            ChatCtrl.Inst.SendChatInfo(ChatCtrl.Inst.presentChatType, msg, info, false);
             StartCoroutine(Co_CoolDowmChat());
         }
 

--
Gitblit v1.8.0