[Execute]//喇叭默认走马灯 public void Excute(GameCmd.stSpeakerChatUserCmd_CS cmd) { if (!ChatDataManager.CanRecieveChatMsgWithBlack(cmd.dwOPDes)) { return; } ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Top, cmd.username); ChatChannel channel = DataManager.Manager <ChatDataManager>().GetChannelByType(CHATTYPE.CHAT_WORLD); if (channel != null) { channel.Add(channel.ToChatInfo(cmd)); } }
public void AddChat(GameCmd.stCommonMChatUserCmd_CS cmd) { if (cmd.byChatType != CHATTYPE.CHAT_SILENT) { return; } if (!ChatDataManager.CanRecieveChatMsgWithBlack(cmd.dwOPDes)) { //Engine.Utility.Log.Info("player {0} is in black not recieve chat msg!", cmd.dwOPDes); return; } CircularQueue <ChatInfo> chatList; if (!m_dictChatInfo.TryGetValue(cmd.dwOPDes, out chatList)) { chatList = new CircularQueue <ChatInfo>() { Capacity = 50 }; m_dictChatInfo.Add(cmd.dwOPDes, chatList); m_dictMsgTips[cmd.dwOPDes] = false; } ChatInfo chatInfo = ToChatInfo(cmd); chatList.Enqueue(chatInfo); if (chatInfo.Id != 0) { if (chatInfo.IsMe) { //DateTime UnixBase = new DateTime(1970, 1, 1, 0, 0, 0); //TimeSpan ts = (UserData.ServerTime - UnixBase ); //chatInfo.Timestamp = (uint)ts.TotalSeconds - (uint)UserData.ServerTimeDelta; chatInfo.Timestamp = (uint)DateTimeHelper.Instance.Now; } UpdateMsgTipsUI(chatInfo); DataManager.Manager <RelationManager>().UpdateContactTimestamp(chatInfo.Id, chatInfo.Timestamp); } else { UpdateMsgTipsUI(chatInfo); } }
public void ExecuteChatCmd(GameCmd.stWildChannelCommonChatUserCmd_CS cmd) { if (!ChatDataManager.CanRecieveChatMsgWithBlack(cmd.dwOPDes)) { return; } if (cmd.byChatType == GameCmd.CHATTYPE.CHAT_SYS) { if ((cmd.byChatPos & (uint)GameCmd.ChatPos.ChatPos_Tips) == (uint)GameCmd.ChatPos.ChatPos_Tips) { TipsManager.Instance.ShowTips(cmd.szInfo); } if ((cmd.byChatPos & (uint)GameCmd.ChatPos.ChatPos_Sys_chat) == (uint)GameCmd.ChatPos.ChatPos_Sys_chat) { DataManager.Manager <ChatDataManager>().PrivateChatManager.AddChat(new GameCmd.stCommonMChatUserCmd_CS() { szInfo = cmd.szInfo, byChatType = CHATTYPE.CHAT_SYS, dwOPDes = 0, szOPDes = "系统", }); return; } } ChatChannel channel = DataManager.Manager <ChatDataManager>().GetChannelByType(cmd.byChatType); if (channel != null) { channel.Add(channel.ToChatInfo(cmd)); } if ((GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Gm || (GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Important) { ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Top); } //下走马灯 不显示 if ((GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Sys && DataManager.Manager <ChatDataManager>().SimpleChannelContain(CHATTYPE.CHAT_SYS)) { ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Bottom); } }