| | |
| | | using System.Collections; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.Text; |
| | | using System; |
| | | using LitJson; |
| | | |
| | | public partial class ChatManager : GameSystemManager<ChatManager> |
| | |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | // 0-系统 1-日期 2-自己 3-其他玩家 |
| | | public int GetTalkDataType(TalkData talkData) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public void AddTalkData(ChatChannel type, TalkData data, bool isSendBullet) |
| | | { |
| | | //如果超过限制先删除旧数据 |
| | |
| | | } |
| | | } |
| | | |
| | | if (isSendBullet) |
| | | { |
| | | OnUpdateTalkEvent?.Invoke(type, data, isSendBullet); |
| | | } |
| | | OnUpdateTalkEvent?.Invoke(type, data, isSendBullet); |
| | | } |
| | | |
| | | public Dictionary<ChatChannel, int> currentDayDict = new Dictionary<ChatChannel, int>(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | public void AddSysData(string msg, ArrayList infoList, ChatChannel type, bool isSendBullet) |
| | | public void AddSysData(string msg, ArrayList infoList, ChatChannel type) |
| | | { |
| | | int allSeconds = type == ChatChannel.CrossServer ? TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) : TimeUtility.AllSeconds; |
| | | // 如果隔天,增加日期行 |
| | | TryAddDate(allSeconds, type, isSendBullet); |
| | | |
| | | TryAddDate(allSeconds, type, false); |
| | | |
| | | if (!talkDict.ContainsKey(type)) |
| | | { |
| | | talkDict[type] = new List<TalkData>(); |
| | | } |
| | | |
| | | AddTalkData(type, new TalkData() |
| | | { |
| | | ChannelType = (byte)type, |
| | |
| | | BubbleBox = 1, |
| | | TalkTime = (uint)allSeconds, |
| | | InfoList = new ArrayList(infoList), |
| | | }, isSendBullet); |
| | | }, false); |
| | | } |
| | | |
| | | public void SendPureBullet(string msg, ArrayList infoList, ChatChannel type = ChatChannel.World) |
| | | { |
| | | TalkData talkData = new TalkData() |
| | | { |
| | | ChannelType = (byte)type, |
| | | isSystem = true, |
| | | Content = msg, |
| | | InfoList = infoList != null ? new ArrayList(infoList) : null |
| | | }; |
| | | |
| | | OnUpdateTalkEvent?.Invoke(type, talkData, true); |
| | | } |
| | | public void UpdateTalk(HB310_tagMCTalk vNetData) |
| | | { |
| | | if (!IsValidChatChannel(vNetData.ChannelType)) |
| | |
| | | private void Notify(GMNotifyMessgae _notify) |
| | | { |
| | | ServerTipDetails.ShowMarquee(_notify.message, null, 10); |
| | | ChatManager.Instance.AddSysData(_notify.message, infoArray, ChatChannel.World, false); |
| | | ChatManager.Instance.AddSysData(_notify.message, infoArray, ChatChannel.World); |
| | | } |
| | | |
| | | private bool CheckNotify(GMNotifyMessgae _notify) |
| | |
| | | case SysNotifyType.SysMarqueeTip: |
| | | ServerTipDetails.ShowMarquee(msg, tipInfoList, order); |
| | | break; |
| | | case SysNotifyType.SysBulletScreen: |
| | | ChatManager.Instance.SendPureBullet(msg, tipInfoList); |
| | | break; |
| | | case SysNotifyType.ChatChannelWorld: |
| | | ChatManager.Instance.AddSysData(msg, tipInfoList, ChatChannel.World, true); |
| | | ChatManager.Instance.AddSysData(msg, tipInfoList, ChatChannel.World); |
| | | break; |
| | | case SysNotifyType.ChatChannelGuild: |
| | | ChatManager.Instance.AddSysData(msg, tipInfoList, ChatChannel.Guild, true); |
| | | ChatManager.Instance.AddSysData(msg, tipInfoList, ChatChannel.Guild); |
| | | break; |
| | | case SysNotifyType.SysRealmTip: |
| | | if (OnSysTipEvent != null) |
| | |
| | | SysChatWin = 6, //聊天位置的提示 |
| | | SysEvenKill = 7,//上古战场连杀提示 |
| | | SysFixedTip1 = 11,//固定提示2 |
| | | SysBulletScreen = 19,//弹幕 |
| | | ChatChannelWorld = 20,//聊天-世界频道 |
| | | ChatChannelGuild = 21,//聊天-公会频道 |
| | | SysFairyQuestionTip = 31,//仙盟频道问答提示 |