Ejemplo n.º 1
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public override void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     base.Serialize(writer, protocolVersion, index);
     writer.WriteText(UserName);
     writer.WriteText(Password);
     if (protocolVersion >= ProtocolVersions.Sha512)
     {
         writer.WriteText(Salt);
     }
 }
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     writer.WriteText(Directory);
     writer.WriteTextList(Aliases);
     writer.WriteBigEndianInt16((ushort)AccessRights);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public virtual void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     writer.WriteText(GroupName);
     writer.Write(IpLimit);
     writer.Write(UserLimit);
     byte options = (byte)(((byte)BypassUserLimit & 0x3) | ((byte)Enabled << 2));
     writer.Write(options);
     writer.WriteTextList(DisallowedIPs);
     writer.WriteTextList(AllowedIPs);
     writer.Write(EightPlusThree);
     writer.WriteList16(SharedFolders, protocolVersion);
     writer.Write(DownloadSpeedLimit, protocolVersion);
     writer.Write(UploadSpeedLimit, protocolVersion);
     writer.WriteText(Comment);
     writer.Write(ForceSsl);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Serialise object into FileZilla binary data
 /// </summary>
 /// <param name="writer">Binary writer to write data to</param>
 /// <param name="protocolVersion">Current FileZilla protocol version</param>
 /// <param name="index">The 0 based index of this item in relation to any parent list</param>
 public override void Serialize(BinaryWriter writer, int protocolVersion, int index)
 {
     base.Serialize(writer, protocolVersion, index);
     writer.WriteText(UserName);
     writer.WriteText(Password);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Serialise object into FileZilla binary data
        /// </summary>
        /// <param name="writer">Binary writer to write data to</param>
        /// <param name="protocolVersion">Current FileZilla protocol version</param>
        /// <param name="index">The 0 based index of this item in relation to any parent list</param>
        public virtual void Serialize(BinaryWriter writer, int protocolVersion, int index)
        {
            // Switch user Enabled 'Default' to 'Yes' when not assigned a group.
            if (Enabled == TriState.Default && GetType() == typeof(User) && string.IsNullOrEmpty(GroupName))
                Enabled=TriState.Yes;

            writer.WriteText(GroupName);
            writer.Write(IpLimit);
            writer.Write(UserLimit);
            byte options = (byte)(((byte)BypassUserLimit & 0x3) | ((byte)Enabled << 2));
            writer.Write(options);
            writer.WriteTextList(DisallowedIPs);
            writer.WriteTextList(AllowedIPs);
            if (protocolVersion < ProtocolVersions.Sha512)
            {
                writer.Write(EightPlusThree);
            }
            writer.WriteList16(SharedFolders, protocolVersion);
            writer.Write(DownloadSpeedLimit, protocolVersion);
            writer.Write(UploadSpeedLimit, protocolVersion);
            writer.WriteText(Comment);
            writer.Write(ForceSsl);
        }