Example #1
0
		public byte[] Serialize(PacketBuilder packetBuilder)
		{
			packetBuilder.NewPacket();
			
			packetBuilder.WriteInt(ClientFlags);
			packetBuilder.WriteInt(MaxPacketSize);
			packetBuilder.WriteByte(CharsetNumber);
			packetBuilder.Write(new byte[23]);
			packetBuilder.WriteString(User);
			
			if (ScrambleBuffer != null) {
				packetBuilder.WriteLengthCodedBinary(ScrambleBuffer);
			} else {
				packetBuilder.WriteByte(0);
			}
			
			if (!string.IsNullOrEmpty(Databasename)) {
				packetBuilder.WriteString(Databasename);
			}
			
			return packetBuilder.Serialize(1);
		}