private void _onPacketArrived(Int32 _stream_id, PacketType _packet_type, GC_ChatMsg _msg) { switch ((EChatType)_msg.ChatType) { case EChatType.CHAT_HALL: case EChatType.CHAT_ROOM: case EChatType.CHAT_CLUB: case EChatType.CHAT_TRADE: { if (ChatInfo.ContainsKey(_msg.ChatType)) { if (ChatInfo[_msg.ChatType].Count >= MaxChatCount) { ChatInfo[_msg.ChatType].RemoveFirst(); } ChatInfo[_msg.ChatType].AddLast(_msg); } else { LinkedList <GC_ChatMsg> chats = new LinkedList <GC_ChatMsg>(); chats.AddLast(_msg); ChatInfo.Add(_msg.ChatType, chats); } SignalSystem.FireSignal(SignalId.Chat_ReceiveChat, _msg); } break; } }
private void _addChat(GC_ChatMsg _data) { eChatTarget type = eChatTarget.eChatTarget_other; PlayerInfoBase player = null; if (_data.PlayerID == MainPlayer.Instance.PlayerInfo.PlayerID) { type = eChatTarget.eChatTarget_mine; player = MainPlayer.Instance.PlayerInfo; } else { type = eChatTarget.eChatTarget_other; player = LobbySystem.Instance.GetPlayerInfo(_data.PlayerID); } _addChat(type, player.PlayerName, player.Level, _data.Chat); }
private void _receivePlayerChat(SignalId _signal_id, SignalParameters _parameters) { GC_ChatMsg data = _parameters[0] as GC_ChatMsg; _addChat(data); }