public static void Serialize(Stream stream, GetGameAccountStateRequest instance)
 {
     if (instance.HasAccountId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.AccountId);
     }
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
     if (instance.HasOptions)
     {
         stream.WriteByte(82);
         ProtocolParser.WriteUInt32(stream, instance.Options.GetSerializedSize());
         GameAccountFieldOptions.Serialize(stream, instance.Options);
     }
     if (instance.HasTags)
     {
         stream.WriteByte(90);
         ProtocolParser.WriteUInt32(stream, instance.Tags.GetSerializedSize());
         GameAccountFieldTags.Serialize(stream, instance.Tags);
     }
 }
        public static GetGameAccountStateRequest DeserializeLengthDelimited(Stream stream, GetGameAccountStateRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GetGameAccountStateRequest.Deserialize(stream, instance, num));
        }
        public static GetGameAccountStateRequest DeserializeLengthDelimited(Stream stream)
        {
            GetGameAccountStateRequest getGameAccountStateRequest = new GetGameAccountStateRequest();

            GetGameAccountStateRequest.DeserializeLengthDelimited(stream, getGameAccountStateRequest);
            return(getGameAccountStateRequest);
        }
Exemple #4
0
        public override bool Equals(object obj)
        {
            GetGameAccountStateRequest getGameAccountStateRequest = obj as GetGameAccountStateRequest;

            if (getGameAccountStateRequest == null)
            {
                return(false);
            }
            if (this.HasAccountId != getGameAccountStateRequest.HasAccountId || this.HasAccountId && !this.AccountId.Equals(getGameAccountStateRequest.AccountId))
            {
                return(false);
            }
            if (this.HasGameAccountId != getGameAccountStateRequest.HasGameAccountId || this.HasGameAccountId && !this.GameAccountId.Equals(getGameAccountStateRequest.GameAccountId))
            {
                return(false);
            }
            if (this.HasOptions != getGameAccountStateRequest.HasOptions || this.HasOptions && !this.Options.Equals(getGameAccountStateRequest.Options))
            {
                return(false);
            }
            if (this.HasTags == getGameAccountStateRequest.HasTags && (!this.HasTags || this.Tags.Equals(getGameAccountStateRequest.Tags)))
            {
                return(true);
            }
            return(false);
        }
 public void Serialize(Stream stream)
 {
     GetGameAccountStateRequest.Serialize(stream, this);
 }
 public static GetGameAccountStateRequest Deserialize(Stream stream, GetGameAccountStateRequest 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 != 10)
         {
             if (num != 18)
             {
                 if (num != 82)
                 {
                     if (num != 90)
                     {
                         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.Tags == null)
                     {
                         instance.Tags = GameAccountFieldTags.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.Tags);
                     }
                 }
                 else if (instance.Options == null)
                 {
                     instance.Options = GameAccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.Options);
                 }
             }
             else if (instance.GameAccountId == null)
             {
                 instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
             }
         }
         else if (instance.AccountId == null)
         {
             instance.AccountId = EntityId.DeserializeLengthDelimited(stream);
         }
         else
         {
             EntityId.DeserializeLengthDelimited(stream, instance.AccountId);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static GetGameAccountStateRequest Deserialize(Stream stream, GetGameAccountStateRequest instance)
 {
     return(GetGameAccountStateRequest.Deserialize(stream, instance, -1L));
 }
        public override bool Equals(object obj)
        {
            GetGameAccountStateRequest getGameAccountStateRequest = obj as GetGameAccountStateRequest;

            return(getGameAccountStateRequest != null && this.HasAccountId == getGameAccountStateRequest.HasAccountId && (!this.HasAccountId || this.AccountId.Equals(getGameAccountStateRequest.AccountId)) && this.HasGameAccountId == getGameAccountStateRequest.HasGameAccountId && (!this.HasGameAccountId || this.GameAccountId.Equals(getGameAccountStateRequest.GameAccountId)) && this.HasOptions == getGameAccountStateRequest.HasOptions && (!this.HasOptions || this.Options.Equals(getGameAccountStateRequest.Options)) && this.HasTags == getGameAccountStateRequest.HasTags && (!this.HasTags || this.Tags.Equals(getGameAccountStateRequest.Tags)));
        }