lcy
昨天 0fd3d662ec09f023cb016e367aeae9d3d2267cf0
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
{