public static GameAccountStateTagged DeserializeLengthDelimited(Stream stream, GameAccountStateTagged instance) { long position = (long)ProtocolParser.ReadUInt32(stream); position += stream.Position; return(GameAccountStateTagged.Deserialize(stream, instance, position)); }
public static GameAccountStateTagged DeserializeLengthDelimited(Stream stream) { GameAccountStateTagged gameAccountStateTagged = new GameAccountStateTagged(); GameAccountStateTagged.DeserializeLengthDelimited(stream, gameAccountStateTagged); return(gameAccountStateTagged); }
public static GameAccountStateTagged DeserializeLengthDelimited(Stream stream, GameAccountStateTagged instance) { long num = (long)((ulong)ProtocolParser.ReadUInt32(stream)); num += stream.get_Position(); return(GameAccountStateTagged.Deserialize(stream, instance, num)); }
public static GameAccountStateTagged Deserialize(Stream stream, GameAccountStateTagged 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) { if (instance.GameAccountState != null) { bnet.protocol.account.GameAccountState.DeserializeLengthDelimited(stream, instance.GameAccountState); } else { instance.GameAccountState = bnet.protocol.account.GameAccountState.DeserializeLengthDelimited(stream); } } else if (num != 18) { 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.GameAccountTags != null) { GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags); } else { instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static GameAccountStateTagged Deserialize(Stream stream, GameAccountStateTagged 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) { 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 if (instance.GameAccountTags == null) { instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream); } else { GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags); } } else if (instance.GameAccountState == null) { instance.GameAccountState = GameAccountState.DeserializeLengthDelimited(stream); } else { GameAccountState.DeserializeLengthDelimited(stream, instance.GameAccountState); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static void Serialize(Stream stream, GameAccountStateTagged instance) { if (instance.HasGameAccountState) { stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.GameAccountState.GetSerializedSize()); bnet.protocol.account.GameAccountState.Serialize(stream, instance.GameAccountState); } if (instance.HasGameAccountTags) { stream.WriteByte(18); ProtocolParser.WriteUInt32(stream, instance.GameAccountTags.GetSerializedSize()); GameAccountFieldTags.Serialize(stream, instance.GameAccountTags); } }
public override bool Equals(object obj) { GameAccountStateTagged gameAccountStateTagged = obj as GameAccountStateTagged; if (gameAccountStateTagged == null) { return(false); } if (this.HasGameAccountState != gameAccountStateTagged.HasGameAccountState || this.HasGameAccountState && !this.GameAccountState.Equals(gameAccountStateTagged.GameAccountState)) { return(false); } if (this.HasGameAccountTags == gameAccountStateTagged.HasGameAccountTags && (!this.HasGameAccountTags || this.GameAccountTags.Equals(gameAccountStateTagged.GameAccountTags))) { return(true); } return(false); }
public static GameAccountStateTagged Deserialize(Stream stream, GameAccountStateTagged instance) { return(GameAccountStateTagged.Deserialize(stream, instance, (long)-1)); }
public void Deserialize(Stream stream) { GameAccountStateTagged.Deserialize(stream, this); }
public override bool Equals(object obj) { GameAccountStateTagged gameAccountStateTagged = obj as GameAccountStateTagged; return(gameAccountStateTagged != null && this.HasGameAccountState == gameAccountStateTagged.HasGameAccountState && (!this.HasGameAccountState || this.GameAccountState.Equals(gameAccountStateTagged.GameAccountState)) && this.HasGameAccountTags == gameAccountStateTagged.HasGameAccountTags && (!this.HasGameAccountTags || this.GameAccountTags.Equals(gameAccountStateTagged.GameAccountTags))); }