| | |
| | | { |
| | | talkDict.Clear(); |
| | | lastTalkDataDict.Clear(); |
| | | currentDay = -1; |
| | | currentDayDict.Clear(); |
| | | nowChatChannel = ChatChannel.World; |
| | | nowChatTab = ChatTab.World; |
| | | } |
| | |
| | | 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) |
| | |
| | | } |
| | | } |
| | | |
| | | 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, |
| | |
| | | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | { |
| | | ChatTab.World, |
| | | ChatTab.Guild, |
| | | ChatTab.CrossServer, |
| | | // ChatTab.Person, |
| | | // ChatTab.BlackList, |
| | | }; |
| | |
| | | |
| | | switch (chatTab) |
| | | { |
| | | case ChatTab.World: |
| | | return true; |
| | | case ChatTab.Guild: |
| | | //没有公会 |
| | | if (!PlayerDatas.Instance.fairyData.HasFairy) |
| | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | World = 0, //世界 |
| | | Guild = 1, //公会 |
| | | Person = 2, //私聊 |
| | | BlackList = 3, //黑名单 |
| | | CrossServer = 2, //跨服 |
| | | Person = 3, //私聊 |
| | | BlackList = 4, //黑名单 |
| | | } |
| | | public enum ChatChannel |
| | | { |