TLSharp/TeleSharp.TL/TL/TLAuthorization.cs

66 lines
2.2 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System.IO;
2017-04-13 08:38:01 +02:00
2016-09-24 15:38:26 +02:00
namespace TeleSharp.TL
{
2017-04-13 08:38:01 +02:00
[TLObject(2079516406)]
2016-09-24 15:38:26 +02:00
public class TLAuthorization : TLObject
{
2017-04-13 08:38:01 +02:00
public override int Constructor => 2079516406;
2016-09-24 15:38:26 +02:00
2017-04-13 08:38:01 +02:00
public long hash { get; set; }
public int flags { get; set; }
public string device_model { get; set; }
public string platform { get; set; }
public string system_version { get; set; }
public int api_id { get; set; }
public string app_name { get; set; }
public string app_version { get; set; }
public int date_created { get; set; }
public int date_active { get; set; }
public string ip { get; set; }
public string country { get; set; }
public string region { get; set; }
2016-09-24 15:38:26 +02:00
2017-04-13 08:38:01 +02:00
public void ComputeFlags()
{
flags = 0;
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
hash = br.ReadInt64();
2017-04-13 08:38:01 +02:00
flags = br.ReadInt32();
device_model = StringUtil.Deserialize(br);
platform = StringUtil.Deserialize(br);
system_version = StringUtil.Deserialize(br);
api_id = br.ReadInt32();
app_name = StringUtil.Deserialize(br);
app_version = StringUtil.Deserialize(br);
date_created = br.ReadInt32();
date_active = br.ReadInt32();
ip = StringUtil.Deserialize(br);
country = StringUtil.Deserialize(br);
region = StringUtil.Deserialize(br);
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
2017-04-13 08:38:01 +02:00
bw.Write(Constructor);
2016-09-24 15:38:26 +02:00
ComputeFlags();
2017-04-13 08:38:01 +02:00
bw.Write(flags);
bw.Write(hash);
StringUtil.Serialize(device_model, bw);
StringUtil.Serialize(platform, bw);
StringUtil.Serialize(system_version, bw);
bw.Write(api_id);
StringUtil.Serialize(app_name, bw);
StringUtil.Serialize(app_version, bw);
bw.Write(date_created);
bw.Write(date_active);
StringUtil.Serialize(ip, bw);
StringUtil.Serialize(country, bw);
StringUtil.Serialize(region, bw);
2016-09-24 15:38:26 +02:00
}
}
2017-04-13 08:38:01 +02:00
}