public static void Serialize(Stream stream, GetAccountStateRequest instance)
 {
     if (instance.HasEntityId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.EntityId.GetSerializedSize());
         EntityId.Serialize(stream, instance.EntityId);
     }
     if (instance.HasProgram)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt32(stream, instance.Program);
     }
     if (instance.HasRegion)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.Region);
     }
     if (instance.HasOptions)
     {
         stream.WriteByte(82);
         ProtocolParser.WriteUInt32(stream, instance.Options.GetSerializedSize());
         AccountFieldOptions.Serialize(stream, instance.Options);
     }
     if (instance.HasTags)
     {
         stream.WriteByte(90);
         ProtocolParser.WriteUInt32(stream, instance.Tags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.Tags);
     }
 }
Beispiel #2
0
        public static AccountFieldOptions DeserializeLengthDelimited(Stream stream)
        {
            AccountFieldOptions accountFieldOptions = new AccountFieldOptions();

            AccountFieldOptions.DeserializeLengthDelimited(stream, accountFieldOptions);
            return(accountFieldOptions);
        }
Beispiel #3
0
        public static AccountFieldOptions DeserializeLengthDelimited(Stream stream, AccountFieldOptions instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(AccountFieldOptions.Deserialize(stream, instance, num));
        }
Beispiel #4
0
 public static void Serialize(Stream stream, AccountFieldOptions instance)
 {
     if (instance.HasAllFields)
     {
         stream.WriteByte(8);
         ProtocolParser.WriteBool(stream, instance.AllFields);
     }
     if (instance.HasFieldAccountLevelInfo)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.FieldAccountLevelInfo);
     }
     if (instance.HasFieldPrivacyInfo)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteBool(stream, instance.FieldPrivacyInfo);
     }
     if (instance.HasFieldParentalControlInfo)
     {
         stream.WriteByte(32);
         ProtocolParser.WriteBool(stream, instance.FieldParentalControlInfo);
     }
     if (instance.HasFieldGameLevelInfo)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteBool(stream, instance.FieldGameLevelInfo);
     }
     if (instance.HasFieldGameStatus)
     {
         stream.WriteByte(56);
         ProtocolParser.WriteBool(stream, instance.FieldGameStatus);
     }
     if (instance.HasFieldGameAccounts)
     {
         stream.WriteByte(64);
         ProtocolParser.WriteBool(stream, instance.FieldGameAccounts);
     }
 }
Beispiel #5
0
 public static void Serialize(Stream stream, SubscriberReference instance)
 {
     if (instance.HasObjectId)
     {
         stream.WriteByte(8);
         ProtocolParser.WriteUInt64(stream, instance.ObjectId);
     }
     if (instance.HasEntityId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.EntityId.GetSerializedSize());
         EntityId.Serialize(stream, instance.EntityId);
     }
     if (instance.HasAccountOptions)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.AccountOptions.GetSerializedSize());
         AccountFieldOptions.Serialize(stream, instance.AccountOptions);
     }
     if (instance.HasAccountTags)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.AccountTags);
     }
     if (instance.HasGameAccountOptions)
     {
         stream.WriteByte(42);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountOptions.GetSerializedSize());
         GameAccountFieldOptions.Serialize(stream, instance.GameAccountOptions);
     }
     if (instance.HasGameAccountTags)
     {
         stream.WriteByte(50);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountTags.GetSerializedSize());
         GameAccountFieldTags.Serialize(stream, instance.GameAccountTags);
     }
 }
Beispiel #6
0
        public override bool Equals(object obj)
        {
            AccountFieldOptions accountFieldOption = obj as AccountFieldOptions;

            if (accountFieldOption == null)
            {
                return(false);
            }
            if (this.HasAllFields != accountFieldOption.HasAllFields || this.HasAllFields && !this.AllFields.Equals(accountFieldOption.AllFields))
            {
                return(false);
            }
            if (this.HasFieldAccountLevelInfo != accountFieldOption.HasFieldAccountLevelInfo || this.HasFieldAccountLevelInfo && !this.FieldAccountLevelInfo.Equals(accountFieldOption.FieldAccountLevelInfo))
            {
                return(false);
            }
            if (this.HasFieldPrivacyInfo != accountFieldOption.HasFieldPrivacyInfo || this.HasFieldPrivacyInfo && !this.FieldPrivacyInfo.Equals(accountFieldOption.FieldPrivacyInfo))
            {
                return(false);
            }
            if (this.HasFieldParentalControlInfo != accountFieldOption.HasFieldParentalControlInfo || this.HasFieldParentalControlInfo && !this.FieldParentalControlInfo.Equals(accountFieldOption.FieldParentalControlInfo))
            {
                return(false);
            }
            if (this.HasFieldGameLevelInfo != accountFieldOption.HasFieldGameLevelInfo || this.HasFieldGameLevelInfo && !this.FieldGameLevelInfo.Equals(accountFieldOption.FieldGameLevelInfo))
            {
                return(false);
            }
            if (this.HasFieldGameStatus != accountFieldOption.HasFieldGameStatus || this.HasFieldGameStatus && !this.FieldGameStatus.Equals(accountFieldOption.FieldGameStatus))
            {
                return(false);
            }
            if (this.HasFieldGameAccounts == accountFieldOption.HasFieldGameAccounts && (!this.HasFieldGameAccounts || this.FieldGameAccounts.Equals(accountFieldOption.FieldGameAccounts)))
            {
                return(true);
            }
            return(false);
        }
 public void SetOptions(AccountFieldOptions val)
 {
     this.Options = val;
 }
 public static GetAccountStateRequest Deserialize(Stream stream, GetAccountStateRequest 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 != 16)
                 {
                     if (num2 != 24)
                     {
                         if (num2 != 82)
                         {
                             if (num2 != 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 = AccountFieldTags.DeserializeLengthDelimited(stream);
                             }
                             else
                             {
                                 AccountFieldTags.DeserializeLengthDelimited(stream, instance.Tags);
                             }
                         }
                         else if (instance.Options == null)
                         {
                             instance.Options = AccountFieldOptions.DeserializeLengthDelimited(stream);
                         }
                         else
                         {
                             AccountFieldOptions.DeserializeLengthDelimited(stream, instance.Options);
                         }
                     }
                     else
                     {
                         instance.Region = ProtocolParser.ReadUInt32(stream);
                     }
                 }
                 else
                 {
                     instance.Program = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else if (instance.EntityId == null)
             {
                 instance.EntityId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.EntityId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #9
0
 public void Serialize(Stream stream)
 {
     AccountFieldOptions.Serialize(stream, this);
 }
Beispiel #10
0
 public static AccountFieldOptions Deserialize(Stream stream, AccountFieldOptions 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 != 8)
         {
             if (num != 16)
             {
                 if (num != 24)
                 {
                     if (num != 32)
                     {
                         if (num != 48)
                         {
                             if (num != 56)
                             {
                                 if (num != 64)
                                 {
                                     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.FieldGameAccounts = ProtocolParser.ReadBool(stream);
                                 }
                             }
                             else
                             {
                                 instance.FieldGameStatus = ProtocolParser.ReadBool(stream);
                             }
                         }
                         else
                         {
                             instance.FieldGameLevelInfo = ProtocolParser.ReadBool(stream);
                         }
                     }
                     else
                     {
                         instance.FieldParentalControlInfo = ProtocolParser.ReadBool(stream);
                     }
                 }
                 else
                 {
                     instance.FieldPrivacyInfo = ProtocolParser.ReadBool(stream);
                 }
             }
             else
             {
                 instance.FieldAccountLevelInfo = ProtocolParser.ReadBool(stream);
             }
         }
         else
         {
             instance.AllFields = ProtocolParser.ReadBool(stream);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #11
0
 public static AccountFieldOptions Deserialize(Stream stream, AccountFieldOptions instance)
 {
     return(AccountFieldOptions.Deserialize(stream, instance, -1L));
 }
Beispiel #12
0
        public override bool Equals(object obj)
        {
            AccountFieldOptions accountFieldOptions = obj as AccountFieldOptions;

            return(accountFieldOptions != null && this.HasAllFields == accountFieldOptions.HasAllFields && (!this.HasAllFields || this.AllFields.Equals(accountFieldOptions.AllFields)) && this.HasFieldAccountLevelInfo == accountFieldOptions.HasFieldAccountLevelInfo && (!this.HasFieldAccountLevelInfo || this.FieldAccountLevelInfo.Equals(accountFieldOptions.FieldAccountLevelInfo)) && this.HasFieldPrivacyInfo == accountFieldOptions.HasFieldPrivacyInfo && (!this.HasFieldPrivacyInfo || this.FieldPrivacyInfo.Equals(accountFieldOptions.FieldPrivacyInfo)) && this.HasFieldParentalControlInfo == accountFieldOptions.HasFieldParentalControlInfo && (!this.HasFieldParentalControlInfo || this.FieldParentalControlInfo.Equals(accountFieldOptions.FieldParentalControlInfo)) && this.HasFieldGameLevelInfo == accountFieldOptions.HasFieldGameLevelInfo && (!this.HasFieldGameLevelInfo || this.FieldGameLevelInfo.Equals(accountFieldOptions.FieldGameLevelInfo)) && this.HasFieldGameStatus == accountFieldOptions.HasFieldGameStatus && (!this.HasFieldGameStatus || this.FieldGameStatus.Equals(accountFieldOptions.FieldGameStatus)) && this.HasFieldGameAccounts == accountFieldOptions.HasFieldGameAccounts && (!this.HasFieldGameAccounts || this.FieldGameAccounts.Equals(accountFieldOptions.FieldGameAccounts)));
        }
Beispiel #13
0
 public static GetAccountStateRequest Deserialize(Stream stream, GetAccountStateRequest 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.EntityId != null)
                 {
                     bnet.protocol.EntityId.DeserializeLengthDelimited(stream, instance.EntityId);
                 }
                 else
                 {
                     instance.EntityId = bnet.protocol.EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 16)
             {
                 instance.Program = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 24)
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 82)
             {
                 if (instance.Options != null)
                 {
                     AccountFieldOptions.DeserializeLengthDelimited(stream, instance.Options);
                 }
                 else
                 {
                     instance.Options = AccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num != 90)
             {
                 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.Tags != null)
             {
                 AccountFieldTags.DeserializeLengthDelimited(stream, instance.Tags);
             }
             else
             {
                 instance.Tags = AccountFieldTags.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Beispiel #14
0
 public static SubscriberReference Deserialize(Stream stream, SubscriberReference instance, long limit)
 {
     instance.ObjectId = 0UL;
     while (limit < 0L || stream.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 8)
         {
             if (num != 18)
             {
                 if (num != 26)
                 {
                     if (num != 34)
                     {
                         if (num != 42)
                         {
                             if (num != 50)
                             {
                                 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.GameAccountOptions == null)
                         {
                             instance.GameAccountOptions = GameAccountFieldOptions.DeserializeLengthDelimited(stream);
                         }
                         else
                         {
                             GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.GameAccountOptions);
                         }
                     }
                     else if (instance.AccountTags == null)
                     {
                         instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags);
                     }
                 }
                 else if (instance.AccountOptions == null)
                 {
                     instance.AccountOptions = AccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     AccountFieldOptions.DeserializeLengthDelimited(stream, instance.AccountOptions);
                 }
             }
             else if (instance.EntityId == null)
             {
                 instance.EntityId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.EntityId);
             }
         }
         else
         {
             instance.ObjectId = ProtocolParser.ReadUInt64(stream);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #15
0
 public static SubscriberReference Deserialize(Stream stream, SubscriberReference instance, long limit)
 {
     instance.ObjectId = (ulong)0;
     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.ObjectId = ProtocolParser.ReadUInt64(stream);
             }
             else if (num == 18)
             {
                 if (instance.EntityId != null)
                 {
                     bnet.protocol.EntityId.DeserializeLengthDelimited(stream, instance.EntityId);
                 }
                 else
                 {
                     instance.EntityId = bnet.protocol.EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 26)
             {
                 if (instance.AccountOptions != null)
                 {
                     AccountFieldOptions.DeserializeLengthDelimited(stream, instance.AccountOptions);
                 }
                 else
                 {
                     instance.AccountOptions = AccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 34)
             {
                 if (instance.AccountTags != null)
                 {
                     AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags);
                 }
                 else
                 {
                     instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 42)
             {
                 if (instance.GameAccountOptions != null)
                 {
                     GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.GameAccountOptions);
                 }
                 else
                 {
                     instance.GameAccountOptions = GameAccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num != 50)
             {
                 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);
 }