public static AccountServiceRegion DeserializeLengthDelimited(Stream stream, AccountServiceRegion instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(AccountServiceRegion.Deserialize(stream, instance, position)); }
public static AccountServiceRegion DeserializeLengthDelimited(Stream stream) { AccountServiceRegion accountServiceRegion = new AccountServiceRegion(); AccountServiceRegion.DeserializeLengthDelimited(stream, accountServiceRegion); return(accountServiceRegion); }
public static AccountServiceRegion DeserializeLengthDelimited(Stream stream, AccountServiceRegion instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(AccountServiceRegion.Deserialize(stream, instance, num)); }
public static void Serialize(Stream stream, AccountServiceRegion instance) { stream.WriteByte(8); ProtocolParser.WriteUInt32(stream, instance.Id); if (instance.Shard == null) { throw new ArgumentNullException("Shard", "Required by proto specification."); } stream.WriteByte(18); ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.Shard)); }
public static void Serialize(Stream stream, AccountServiceConfig instance) { if (instance.Region.Count > 0) { foreach (AccountServiceRegion accountServiceRegion in instance.Region) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, accountServiceRegion.GetSerializedSize()); AccountServiceRegion.Serialize(stream, accountServiceRegion); } } }
public override int GetHashCode() { int num = base.GetType().GetHashCode(); using (List <AccountServiceRegion> .Enumerator enumerator = this.Region.GetEnumerator()) { while (enumerator.MoveNext()) { AccountServiceRegion current = enumerator.get_Current(); num ^= current.GetHashCode(); } } return(num); }
public static void Serialize(Stream stream, AccountServiceConfig instance) { if (instance.Region.get_Count() > 0) { using (List <AccountServiceRegion> .Enumerator enumerator = instance.Region.GetEnumerator()) { while (enumerator.MoveNext()) { AccountServiceRegion current = enumerator.get_Current(); stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, current.GetSerializedSize()); AccountServiceRegion.Serialize(stream, current); } } } }
public static AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion instance, long limit) { while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { int num2 = num; if (num2 != 8) { if (num2 != 18) { Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field == 0u) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } else { instance.Shard = ProtocolParser.ReadString(stream); } } else { instance.Id = ProtocolParser.ReadUInt32(stream); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { AccountServiceRegion accountServiceRegion = obj as AccountServiceRegion; if (accountServiceRegion == null) { return(false); } if (!this.Id.Equals(accountServiceRegion.Id)) { return(false); } if (!this.Shard.Equals(accountServiceRegion.Shard)) { return(false); } return(true); }
public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance, long limit) { if (instance.Region == null) { instance.Region = new List <AccountServiceRegion>(); } while (true) { if (limit < (long)0 || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= (long)0) { throw new EndOfStreamException(); } break; } else if (num == 10) { instance.Region.Add(AccountServiceRegion.DeserializeLengthDelimited(stream)); } else { Key key = ProtocolParser.ReadKey((byte)num, stream); if (key.Field == 0) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion instance, long limit) { while (true) { if (limit < (long)0 || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= (long)0) { throw new EndOfStreamException(); } break; } else if (num == 8) { instance.Id = ProtocolParser.ReadUInt32(stream); } else if (num == 18) { instance.Shard = ProtocolParser.ReadString(stream); } else { Key key = ProtocolParser.ReadKey((byte)num, stream); if (key.Field == 0) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public uint GetSerializedSize() { uint num = 0u; if (this.Region.get_Count() > 0) { using (List <AccountServiceRegion> .Enumerator enumerator = this.Region.GetEnumerator()) { while (enumerator.MoveNext()) { AccountServiceRegion current = enumerator.get_Current(); num += 1u; uint serializedSize = current.GetSerializedSize(); num += serializedSize + ProtocolParser.SizeOfUInt32(serializedSize); } } } return(num); }
public static AccountServiceConfig Deserialize(Stream stream, AccountServiceConfig instance, long limit) { if (instance.Region == null) { instance.Region = new List <AccountServiceRegion>(); } while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { int num2 = num; if (num2 != 10) { Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field == 0u) { throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } ProtocolParser.SkipKey(stream, key); } else { instance.Region.Add(AccountServiceRegion.DeserializeLengthDelimited(stream)); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static AccountServiceRegion Deserialize(Stream stream, AccountServiceRegion instance) { return(AccountServiceRegion.Deserialize(stream, instance, -1L)); }
public void Deserialize(Stream stream) { AccountServiceRegion.Deserialize(stream, this); }
public override bool Equals(object obj) { AccountServiceRegion accountServiceRegion = obj as AccountServiceRegion; return(accountServiceRegion != null && this.Id.Equals(accountServiceRegion.Id) && this.Shard.Equals(accountServiceRegion.Shard)); }
public void AddRegion(AccountServiceRegion val) { this._Region.Add(val); }