TLSharp/TeleSharp.TL/TL/TLDcOption.cs

66 lines
1.3 KiB
C#
Raw Normal View History

2016-09-24 15:38:26 +02:00
using System.IO;
2017-12-20 12:06:31 +01:00
2016-09-24 15:38:26 +02:00
namespace TeleSharp.TL
{
[TLObject(98092748)]
2016-09-24 15:38:26 +02:00
public class TLDcOption : TLObject
{
2017-12-20 12:06:31 +01:00
public bool Cdn { get; set; }
2016-09-24 15:38:26 +02:00
public override int Constructor
{
get
{
return 98092748;
}
}
public int Flags { get; set; }
2017-12-20 12:06:31 +01:00
public int Id { get; set; }
2017-12-20 12:06:31 +01:00
public string IpAddress { get; set; }
2017-12-20 12:06:31 +01:00
public bool Ipv6 { get; set; }
public bool MediaOnly { get; set; }
public int Port { get; set; }
2016-09-24 15:38:26 +02:00
2017-12-20 12:06:31 +01:00
public bool Static { get; set; }
public bool TcpoOnly { get; set; }
2016-09-24 15:38:26 +02:00
public void ComputeFlags()
{
}
2016-09-24 15:38:26 +02:00
public override void DeserializeBody(BinaryReader br)
{
Flags = br.ReadInt32();
Ipv6 = (Flags & 1) != 0;
MediaOnly = (Flags & 2) != 0;
TcpoOnly = (Flags & 4) != 0;
Cdn = (Flags & 8) != 0;
2017-12-20 12:06:31 +01:00
Static = (Flags & 16) != 0;
Id = br.ReadInt32();
IpAddress = StringUtil.Deserialize(br);
Port = br.ReadInt32();
2016-09-24 15:38:26 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
bw.Write(Flags);
2016-09-24 15:38:26 +02:00
2017-12-20 12:06:31 +01:00
bw.Write(Id);
StringUtil.Serialize(IpAddress, bw);
bw.Write(Port);
2016-09-24 15:38:26 +02:00
}
}
}