public override void OnResponse(BinaryReader reader)
        {
            var code = new Combinator(reader.ReadUInt32());

            //if (constructor != typeof (ConfigConstructor) )
            if (code.ToType == typeof(Messages_messagesSliceConstructor))
            {
                var gzipStream = reader.BaseStream as GZipStream;

                var memoryStream = reader.BaseStream as MemoryStream;

                if (gzipStream == null && memoryStream == null)
                {
                    Debugger.Break();
                }

                // ReSharper disable once PossibleNullReferenceException
                var count = gzipStream?.BufferSize ?? memoryStream.Length;

                var readBytes = reader.ReadBytes((int)count);

                throw new Exception("Error obtaining configuration.");
                //while(true) reader
            }


            ConfigConstructor config = new ConfigConstructor();

            config.Read(reader);

            ConfigConstructor = config;
        }
Ejemplo n.º 2
0
		public override void OnResponse(BinaryReader reader)
		{
			uint code = reader.ReadUInt32();
			ConfigConstructor config = new ConfigConstructor();
			config.Read(reader);

			ConfigConstructor = config;
		}
Ejemplo n.º 3
0
        public override void OnResponse(BinaryReader reader)
        {
            uint code = reader.ReadUInt32();
            ConfigConstructor config = new ConfigConstructor();

            config.Read(reader);
            responseCompletionSource.SetResult(config);
        }
Ejemplo n.º 4
0
        public override void OnResponse(BinaryReader reader)
        {
            uint code = reader.ReadUInt32();
            ConfigConstructor config = new ConfigConstructor();

            config.Read(reader);

            ConfigConstructor = config;
        }
Ejemplo n.º 5
0
        public override void OnResponse(BinaryReader reader)
        {
            uint code = reader.ReadUInt32();

            System.Diagnostics.Debug.WriteLine("code: " + code.ToString("x"));
            ;

            if (code == 0x4e32b894) // config constructor
            {
                ConfigConstructor config = new ConfigConstructor();
                config.Read(reader);
                ConfigConstructor = config;
            }
            else if (code == 0xff036af1) // auth.authorization :/
            {
                Auth_authorizationConstructor auth = new Auth_authorizationConstructor();
                auth.Read(reader);
                UserConstructor = (UserConstructor)auth.user;
            }
            else // TODO something didn't go right...
            {
                if (code == 0xb446ae3) // messages slice still?
                {
                    var result = TL.Parse(reader, code);

                    ;
                }
                else
                {
                    try
                    {
                        while (true)
                        {
                            reader.ReadUInt32();          // flush reader, it's the best we can do!
                        }
                    }
                    catch (EndOfStreamException) { }
                }
            }
        }