Exemple #1
0
        /// <summary>
        /// Handles the incoming packet that has been sent from the server.
        /// </summary>
        public void Parse(ClientMessage message, ConnectionCore connection)
        {
            int    chatroomId  = message.ReadInt32();
            int    messageId   = message.ReadInt32();
            int    UserId      = message.ReadInt32();
            string username    = message.ReadString();
            string chatMessage = message.ReadString();

            Chatrooms.ChatMessage ChatMessage = new Chatrooms.ChatMessage(chatroomId, messageId, chatMessage, new ChatroomUser(UserId, username));
            connection.ClientManager.ChatroomManager.HandleMessage(ChatMessage);
        }
        /// <summary>
        /// Handles the incoming packet that has been sent from the server.
        /// </summary>
        public void Parse(ClientMessage message, ConnectionCore connection)
        {
            int chatroomId = message.ReadInt32();
            int messageId  = message.ReadInt32();
            int userId     = message.ReadInt32();

            string broadcastMessage = message.ReadString();

            Chatrooms.ChatMessage broadcastChatMessage = new Chatrooms.ChatMessage(chatroomId, messageId, broadcastMessage);
            connection.ClientManager.ChatroomManager.HandleMessage(broadcastChatMessage);
        }