Ejemplo n.º 1
0
 public override void Load(ByteReader reader)
 {
     Reason      = (DisconnectReason)reader.GetUInt32();
     Description = reader.GetString(Encoding.UTF8);
     if (!reader.IsEOF)
     {
         Language = reader.GetString();
     }
 }
Ejemplo n.º 2
0
        }                                       // only for password auth


        public override void Load(ByteReader reader)
        {
            UserName    = reader.GetString(Encoding.UTF8);
            ServiceName = reader.GetString(Encoding.ASCII);
            MethodName  = reader.GetString(Encoding.ASCII);

            if (MethodName == "password")
            {
                ChangePassword = reader.GetBoolean();
                Password       = reader.GetString(Encoding.UTF8);
            }
        }
Ejemplo n.º 3
0
        public override void Load(ByteReader reader)
        {
            RecipientChannel = reader.GetUInt32();
            RequestType      = reader.GetString(Encoding.ASCII);
            WantReply        = reader.GetBoolean();

            if (RequestType == "env")
            {
                VariableName  = reader.GetString(Encoding.UTF8);
                VariableValue = reader.GetString(Encoding.UTF8);
            }
            else if (RequestType == "subsystem")
            {
                SubsystemName = reader.GetString(Encoding.UTF8);
            }
        }
Ejemplo n.º 4
0
 public override void Load(ByteReader reader)
 {
     ChannelType       = reader.GetString(Encoding.ASCII);
     SenderChannel     = reader.GetUInt32();
     InitialWindowSize = reader.GetUInt32();
     MaximumPacketSize = reader.GetUInt32();
 }
        public void NormalOperationTest()
        {
            byte[] bytes  = File.ReadAllBytes(Path.Combine("Files", "structdata.dat"));
            var    reader = new ByteReader(bytes);

            Assert.AreEqual(35000, reader.GetUshort());
            Assert.AreEqual(230, reader.GetByte());
            Assert.AreEqual("spam", reader.GetString(4));
            Assert.AreEqual(4211001100, reader.GetUint());
            Assert.AreEqual(1, reader.GetBits(1));
            Assert.AreEqual(2, reader.GetBits(4));
            Assert.AreEqual(1, reader.GetBits(3));
            Assert.AreEqual(10, reader.GetByte());
        }
Ejemplo n.º 6
0
 public override void Load(ByteReader reader)
 {
     ServiceName = reader.GetString(Encoding.UTF8);
 }
Ejemplo n.º 7
0
 public override void Load(ByteReader reader)
 {
     Id   = reader.GetUInt32();
     Path = reader.GetString();
 }