/// <summary>
        /// Read a negotiation packet from the client.
        /// </summary>
        /// <param name="packet">the reading packet</param>
        internal NegotiationHandler(ReadPacket packet)
        {
            int offset = 0;
            int recordType;
            while ((recordType = packet.ReadUnsignedByte()) != 0xFF)
            {
                records.Add(new Record(recordType, packet.ReadBeShort(), packet.ReadBeShort()));
                offset += 5;
            }
            offset++; // the ending mark 0xFF

            for (int i = 0; i < records.Count; i++)
            {
                offset = records[i].ReadData(offset, packet);
            }
        }