From bcd1dcef07dc129d68539ca2d562c5df53007f36 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 12 二月 2026 21:32:52 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/System/Chat/ChatManager.cs |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/Main/System/Chat/ChatManager.cs b/Main/System/Chat/ChatManager.cs
index b5bf315..ed795fd 100644
--- a/Main/System/Chat/ChatManager.cs
+++ b/Main/System/Chat/ChatManager.cs
@@ -115,7 +115,7 @@
     {
         talkDict.Clear();
         lastTalkDataDict.Clear();
-        currentDay = -1;
+        currentDayDict.Clear();
         nowChatChannel = ChatChannel.World;
         nowChatTab = ChatTab.World;
     }
@@ -331,12 +331,12 @@
         ChatReport(channelType, content);
     }
 
-    void ChatReport(int chatType, string content, string toPlayer="")
+    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)
@@ -413,13 +413,19 @@
         }
     }
 
-    public int currentDay = -1;
+    public Dictionary<ChatChannel, int> currentDayDict = new Dictionary<ChatChannel, int>();
     public bool TryAddDate(int allSeconds, ChatChannel type, bool isSendBullet)
     {
         DateTime talkTime = TimeUtility.GetTime((uint)allSeconds);
-        if (talkTime.Day != currentDay)
+        // 纭繚瀛楀吀涓寘鍚棰戦亾鐨勬潯鐩�
+        if (!currentDayDict.ContainsKey(type))
         {
-            currentDay = talkTime.Day;
+            currentDayDict[type] = -1;
+        }
+        // 姣忎釜棰戦亾鐙珛妫�鏌ユ棩鏈�
+        if (talkTime.Day != currentDayDict[type])
+        {
+            currentDayDict[type] = talkTime.Day;
             AddTalkData(type, new TalkData()
             {
                 ChannelType = (byte)type,
@@ -434,7 +440,7 @@
 
     public void AddSysData(string msg, ArrayList infoList, ChatChannel type, bool isSendBullet)
     {
-        int allSeconds = TimeUtility.AllSeconds;
+        int allSeconds = type == ChatChannel.CrossServer ? TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) : TimeUtility.AllSeconds;
         // 濡傛灉闅斿ぉ,澧炲姞鏃ユ湡琛�
         TryAddDate(allSeconds, type, isSendBullet);
 
@@ -464,7 +470,7 @@
             talkDict[type] = new List<TalkData>();
         }
 
-        int allSeconds = TimeUtility.AllSeconds;
+        int allSeconds = type == ChatChannel.CrossServer ? TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) : TimeUtility.AllSeconds;
         // 濡傛灉闅斿ぉ,澧炲姞鏃ユ湡琛�
         TryAddDate(allSeconds, type, true);
 
@@ -572,6 +578,7 @@
     {
         ChatTab.World,
         ChatTab.Guild,
+        ChatTab.CrossServer,
         // ChatTab.Person,
         // ChatTab.BlackList,
     };
@@ -583,8 +590,6 @@
 
         switch (chatTab)
         {
-            case ChatTab.World:
-                return true;
             case ChatTab.Guild:
                 //娌℃湁鍏細
                 if (!PlayerDatas.Instance.fairyData.HasFairy)
@@ -594,8 +599,17 @@
                     return false;
                 }
                 return true;
+            case ChatTab.CrossServer:
+                //娌℃湁鍚堟湇
+                if (GuildManager.Instance.zoneID <= 0)
+                {
+                    if (isTip)
+                        SysNotifyMgr.Instance.ShowTip("CrossServerNoOpen");
+                    return false;
+                }
+                return true;
             default:
-                return false;
+                return true;
         }
     }
 
@@ -697,8 +711,9 @@
 {
     World = 0,      //涓栫晫
     Guild = 1,      //鍏細      
-    Person = 2,     //绉佽亰
-    BlackList = 3,  //榛戝悕鍗�
+    CrossServer = 2,    //璺ㄦ湇
+    Person = 3,     //绉佽亰
+    BlackList = 4,  //榛戝悕鍗�
 }
 public enum ChatChannel
 {

--
Gitblit v1.8.0