/// <summary> /// Handles the incoming packet that has been sent from the server. /// </summary> public void Parse(ClientMessage message, ConnectionCore connection) { string roomName = message.ReadString(); Chatroom chatRoom = Chatroom.CreateFromPacket(message); connection.ClientManager.ChatroomManager.AddPrivateRoom(chatRoom); }
/// <summary> /// Handles the incoming packet that has been sent from the server. /// </summary> public void Parse(ClientMessage message, ConnectionCore connection) { Dictionary <int, Chatroom> chatRooms = new Dictionary <int, Chatroom>(); int chatRoomUsers = message.ReadInt32(); for (int i = 0; i < chatRoomUsers; i++) { Chatroom chatRoom = Chatroom.CreateFromPacket(message); chatRooms.Add(chatRoom.ID, chatRoom); } connection.ClientManager.ChatroomManager.InitializeChatrooms(chatRooms); }