public static CAIS DeserializeLengthDelimited(Stream stream, CAIS instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(CAIS.Deserialize(stream, instance, position)); }
public static CAIS DeserializeLengthDelimited(Stream stream, CAIS instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(CAIS.Deserialize(stream, instance, num)); }
public static CAIS DeserializeLengthDelimited(Stream stream) { CAIS cAIS = new CAIS(); CAIS.DeserializeLengthDelimited(stream, cAIS); return(cAIS); }
public static void Serialize(Stream stream, GameSessionUpdateInfo instance) { if (instance.HasCais) { stream.WriteByte(66); ProtocolParser.WriteUInt32(stream, instance.Cais.GetSerializedSize()); CAIS.Serialize(stream, instance.Cais); } }
public static void Serialize(Stream stream, GetCAISInfoResponse instance) { if (instance.HasCaisInfo) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.CaisInfo.GetSerializedSize()); CAIS.Serialize(stream, instance.CaisInfo); } }
public static CAIS Deserialize(Stream stream, CAIS 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 != 16) { if (num2 != 24) { 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.LastHeardTime = ProtocolParser.ReadUInt64(stream); } } else { instance.RestedMinutes = ProtocolParser.ReadUInt32(stream); } } else { instance.PlayedMinutes = ProtocolParser.ReadUInt32(stream); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static CAIS Deserialize(Stream stream, CAIS 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.PlayedMinutes = ProtocolParser.ReadUInt32(stream); } else if (num == 16) { instance.RestedMinutes = ProtocolParser.ReadUInt32(stream); } else if (num == 24) { instance.LastHeardTime = ProtocolParser.ReadUInt64(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 void Serialize(Stream stream, CAIS instance) { if (instance.HasPlayedMinutes) { stream.WriteByte(8); ProtocolParser.WriteUInt32(stream, instance.PlayedMinutes); } if (instance.HasRestedMinutes) { stream.WriteByte(16); ProtocolParser.WriteUInt32(stream, instance.RestedMinutes); } if (instance.HasLastHeardTime) { stream.WriteByte(24); ProtocolParser.WriteUInt64(stream, instance.LastHeardTime); } }
public static GetCAISInfoResponse Deserialize(Stream stream, GetCAISInfoResponse 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 != 10) { 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 (instance.CaisInfo != null) { CAIS.DeserializeLengthDelimited(stream, instance.CaisInfo); } else { instance.CaisInfo = CAIS.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static GetCAISInfoResponse Deserialize(Stream stream, GetCAISInfoResponse 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 != 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 if (instance.CaisInfo == null) { instance.CaisInfo = CAIS.DeserializeLengthDelimited(stream); } else { CAIS.DeserializeLengthDelimited(stream, instance.CaisInfo); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { CAIS cAI = obj as CAIS; if (cAI == null) { return(false); } if (this.HasPlayedMinutes != cAI.HasPlayedMinutes || this.HasPlayedMinutes && !this.PlayedMinutes.Equals(cAI.PlayedMinutes)) { return(false); } if (this.HasRestedMinutes != cAI.HasRestedMinutes || this.HasRestedMinutes && !this.RestedMinutes.Equals(cAI.RestedMinutes)) { return(false); } if (this.HasLastHeardTime == cAI.HasLastHeardTime && (!this.HasLastHeardTime || this.LastHeardTime.Equals(cAI.LastHeardTime))) { return(true); } return(false); }
public static GameSessionUpdateInfo Deserialize(Stream stream, GameSessionUpdateInfo instance, long limit) { while (limit < 0L || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else if (num != 66) { 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 if (instance.Cais == null) { instance.Cais = CAIS.DeserializeLengthDelimited(stream); } else { CAIS.DeserializeLengthDelimited(stream, instance.Cais); } } if (stream.Position == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public override bool Equals(object obj) { CAIS cAIS = obj as CAIS; return(cAIS != null && this.HasPlayedMinutes == cAIS.HasPlayedMinutes && (!this.HasPlayedMinutes || this.PlayedMinutes.Equals(cAIS.PlayedMinutes)) && this.HasRestedMinutes == cAIS.HasRestedMinutes && (!this.HasRestedMinutes || this.RestedMinutes.Equals(cAIS.RestedMinutes)) && this.HasLastHeardTime == cAIS.HasLastHeardTime && (!this.HasLastHeardTime || this.LastHeardTime.Equals(cAIS.LastHeardTime))); }
public void SetCaisInfo(CAIS val) { this.CaisInfo = val; }
public void SetCais(CAIS val) { this.Cais = val; }
public void Serialize(Stream stream) { CAIS.Serialize(stream, this); }
public void Deserialize(Stream stream) { CAIS.Deserialize(stream, this); }
public static CAIS Deserialize(Stream stream, CAIS instance) { return(CAIS.Deserialize(stream, instance, -1L)); }