Esempio n. 1
0
 public static void Serialize(Stream stream, AccountStateNotification instance)
 {
     if (instance.HasState)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize());
         AccountState.Serialize(stream, instance.State);
     }
     if (instance.HasSubscriberId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.SubscriberId);
     }
     if (instance.HasAccountTags)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.AccountTags);
     }
     if (instance.HasSubscriptionCompleted)
     {
         stream.WriteByte(32);
         ProtocolParser.WriteBool(stream, instance.SubscriptionCompleted);
     }
 }
Esempio n. 2
0
        public static AccountFieldTags DeserializeLengthDelimited(Stream stream, AccountFieldTags instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(AccountFieldTags.Deserialize(stream, instance, num));
        }
Esempio n. 3
0
        public static AccountFieldTags DeserializeLengthDelimited(Stream stream)
        {
            AccountFieldTags accountFieldTags = new AccountFieldTags();

            AccountFieldTags.DeserializeLengthDelimited(stream, accountFieldTags);
            return(accountFieldTags);
        }
Esempio n. 4
0
 public static void Serialize(Stream stream, GameAccountNotification instance)
 {
     if (instance.RegionDelta.get_Count() > 0)
     {
         using (List <GameAccountList> .Enumerator enumerator = instance.RegionDelta.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 GameAccountList current = enumerator.get_Current();
                 stream.WriteByte(10);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 GameAccountList.Serialize(stream, current);
             }
         }
     }
     if (instance.HasSubscriberId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.SubscriberId);
     }
     if (instance.HasAccountTags)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.AccountTags);
     }
 }
Esempio n. 5
0
 public static GameAccountNotification Deserialize(Stream stream, GameAccountNotification instance, long limit)
 {
     if (instance.RegionDelta == null)
     {
         instance.RegionDelta = new List <GameAccountList>();
     }
     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 != 26)
                     {
                         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.AccountTags == null)
                     {
                         instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags);
                     }
                 }
                 else
                 {
                     instance.SubscriberId = ProtocolParser.ReadUInt64(stream);
                 }
             }
             else
             {
                 instance.RegionDelta.Add(GameAccountList.DeserializeLengthDelimited(stream));
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 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);
     }
 }
Esempio n. 7
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator = instance.GameLevelInfoTags.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ProgramTag current = enumerator.get_Current();
                        stream.WriteByte(58);
                        ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                        ProgramTag.Serialize(stream, current);
                    }
                }
            }
            if (instance.GameStatusTags.get_Count() > 0)
            {
                using (List <ProgramTag> .Enumerator enumerator2 = instance.GameStatusTags.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        ProgramTag current2 = enumerator2.get_Current();
                        stream.WriteByte(74);
                        ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                        ProgramTag.Serialize(stream, current2);
                    }
                }
            }
            if (instance.GameAccountTags.get_Count() > 0)
            {
                using (List <RegionTag> .Enumerator enumerator3 = instance.GameAccountTags.GetEnumerator())
                {
                    while (enumerator3.MoveNext())
                    {
                        RegionTag current3 = enumerator3.get_Current();
                        stream.WriteByte(90);
                        ProtocolParser.WriteUInt32(stream, current3.GetSerializedSize());
                        RegionTag.Serialize(stream, current3);
                    }
                }
            }
        }
Esempio n. 8
0
        public override bool Equals(object obj)
        {
            AccountFieldTags accountFieldTags = obj as AccountFieldTags;

            if (accountFieldTags == null)
            {
                return(false);
            }
            if (this.HasAccountLevelInfoTag != accountFieldTags.HasAccountLevelInfoTag || (this.HasAccountLevelInfoTag && !this.AccountLevelInfoTag.Equals(accountFieldTags.AccountLevelInfoTag)))
            {
                return(false);
            }
            if (this.HasPrivacyInfoTag != accountFieldTags.HasPrivacyInfoTag || (this.HasPrivacyInfoTag && !this.PrivacyInfoTag.Equals(accountFieldTags.PrivacyInfoTag)))
            {
                return(false);
            }
            if (this.HasParentalControlInfoTag != accountFieldTags.HasParentalControlInfoTag || (this.HasParentalControlInfoTag && !this.ParentalControlInfoTag.Equals(accountFieldTags.ParentalControlInfoTag)))
            {
                return(false);
            }
            if (this.GameLevelInfoTags.Count != accountFieldTags.GameLevelInfoTags.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.GameLevelInfoTags.Count; i++)
            {
                if (!this.GameLevelInfoTags[i].Equals(accountFieldTags.GameLevelInfoTags[i]))
                {
                    return(false);
                }
            }
            if (this.GameStatusTags.Count != accountFieldTags.GameStatusTags.Count)
            {
                return(false);
            }
            for (int j = 0; j < this.GameStatusTags.Count; j++)
            {
                if (!this.GameStatusTags[j].Equals(accountFieldTags.GameStatusTags[j]))
                {
                    return(false);
                }
            }
            if (this.GameAccountTags.Count != accountFieldTags.GameAccountTags.Count)
            {
                return(false);
            }
            for (int k = 0; k < this.GameAccountTags.Count; k++)
            {
                if (!this.GameAccountTags[k].Equals(accountFieldTags.GameAccountTags[k]))
                {
                    return(false);
                }
            }
            return(true);
        }
 public static AccountStateTagged Deserialize(Stream stream, AccountStateTagged 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.AccountState != null)
                 {
                     bnet.protocol.account.AccountState.DeserializeLengthDelimited(stream, instance.AccountState);
                 }
                 else
                 {
                     instance.AccountState = bnet.protocol.account.AccountState.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.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);
 }
Esempio n. 10
0
        public override bool Equals(object obj)
        {
            AccountFieldTags accountFieldTags = obj as AccountFieldTags;

            if (accountFieldTags == null)
            {
                return(false);
            }
            if (this.HasAccountLevelInfoTag != accountFieldTags.HasAccountLevelInfoTag || (this.HasAccountLevelInfoTag && !this.AccountLevelInfoTag.Equals(accountFieldTags.AccountLevelInfoTag)))
            {
                return(false);
            }
            if (this.HasPrivacyInfoTag != accountFieldTags.HasPrivacyInfoTag || (this.HasPrivacyInfoTag && !this.PrivacyInfoTag.Equals(accountFieldTags.PrivacyInfoTag)))
            {
                return(false);
            }
            if (this.HasParentalControlInfoTag != accountFieldTags.HasParentalControlInfoTag || (this.HasParentalControlInfoTag && !this.ParentalControlInfoTag.Equals(accountFieldTags.ParentalControlInfoTag)))
            {
                return(false);
            }
            if (this.GameLevelInfoTags.get_Count() != accountFieldTags.GameLevelInfoTags.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.GameLevelInfoTags.get_Count(); i++)
            {
                if (!this.GameLevelInfoTags.get_Item(i).Equals(accountFieldTags.GameLevelInfoTags.get_Item(i)))
                {
                    return(false);
                }
            }
            if (this.GameStatusTags.get_Count() != accountFieldTags.GameStatusTags.get_Count())
            {
                return(false);
            }
            for (int j = 0; j < this.GameStatusTags.get_Count(); j++)
            {
                if (!this.GameStatusTags.get_Item(j).Equals(accountFieldTags.GameStatusTags.get_Item(j)))
                {
                    return(false);
                }
            }
            if (this.GameAccountTags.get_Count() != accountFieldTags.GameAccountTags.get_Count())
            {
                return(false);
            }
            for (int k = 0; k < this.GameAccountTags.get_Count(); k++)
            {
                if (!this.GameAccountTags.get_Item(k).Equals(accountFieldTags.GameAccountTags.get_Item(k)))
                {
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 11
0
 public static AccountStateTagged Deserialize(Stream stream, AccountStateTagged 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.Tags == null)
                 {
                     instance.Tags = AccountFieldTags.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     AccountFieldTags.DeserializeLengthDelimited(stream, instance.Tags);
                 }
             }
             else if (instance.AccountState == null)
             {
                 instance.AccountState = AccountState.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountState.DeserializeLengthDelimited(stream, instance.AccountState);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static void Serialize(Stream stream, AccountStateTagged instance)
 {
     if (instance.HasAccountState)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AccountState.GetSerializedSize());
         bnet.protocol.account.AccountState.Serialize(stream, instance.AccountState);
     }
     if (instance.HasTags)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Tags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.Tags);
     }
 }
 public static void Serialize(Stream stream, GetAccountStateResponse instance)
 {
     if (instance.HasState)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize());
         AccountState.Serialize(stream, instance.State);
     }
     if (instance.HasTags)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Tags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.Tags);
     }
 }
Esempio n. 14
0
        public static void Serialize(Stream stream, AccountFieldTags instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAccountLevelInfoTag)
            {
                stream.WriteByte(21);
                binaryWriter.Write(instance.AccountLevelInfoTag);
            }
            if (instance.HasPrivacyInfoTag)
            {
                stream.WriteByte(29);
                binaryWriter.Write(instance.PrivacyInfoTag);
            }
            if (instance.HasParentalControlInfoTag)
            {
                stream.WriteByte(37);
                binaryWriter.Write(instance.ParentalControlInfoTag);
            }
            if (instance.GameLevelInfoTags.Count > 0)
            {
                foreach (ProgramTag programTag in instance.GameLevelInfoTags)
                {
                    stream.WriteByte(58);
                    ProtocolParser.WriteUInt32(stream, programTag.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag);
                }
            }
            if (instance.GameStatusTags.Count > 0)
            {
                foreach (ProgramTag programTag2 in instance.GameStatusTags)
                {
                    stream.WriteByte(74);
                    ProtocolParser.WriteUInt32(stream, programTag2.GetSerializedSize());
                    ProgramTag.Serialize(stream, programTag2);
                }
            }
            if (instance.GameAccountTags.Count > 0)
            {
                foreach (RegionTag regionTag in instance.GameAccountTags)
                {
                    stream.WriteByte(90);
                    ProtocolParser.WriteUInt32(stream, regionTag.GetSerializedSize());
                    RegionTag.Serialize(stream, regionTag);
                }
            }
        }
Esempio n. 15
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);
     }
 }
 public static void Serialize(Stream stream, GameAccountNotification instance)
 {
     if (instance.RegionDelta.Count > 0)
     {
         foreach (GameAccountList regionDeltum in instance.RegionDelta)
         {
             stream.WriteByte(10);
             ProtocolParser.WriteUInt32(stream, regionDeltum.GetSerializedSize());
             GameAccountList.Serialize(stream, regionDeltum);
         }
     }
     if (instance.HasSubscriberId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.SubscriberId);
     }
     if (instance.HasAccountTags)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.AccountTags.GetSerializedSize());
         AccountFieldTags.Serialize(stream, instance.AccountTags);
     }
 }
Esempio n. 17
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);
 }
 public void SetTags(AccountFieldTags val)
 {
     this.Tags = val;
 }
Esempio n. 19
0
 public static AccountStateNotification Deserialize(Stream stream, AccountStateNotification 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.State != null)
                 {
                     AccountState.DeserializeLengthDelimited(stream, instance.State);
                 }
                 else
                 {
                     instance.State = AccountState.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 16)
             {
                 instance.SubscriberId = ProtocolParser.ReadUInt64(stream);
             }
             else if (num != 26)
             {
                 if (num == 32)
                 {
                     instance.SubscriptionCompleted = ProtocolParser.ReadBool(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 (instance.AccountTags != null)
             {
                 AccountFieldTags.DeserializeLengthDelimited(stream, instance.AccountTags);
             }
             else
             {
                 instance.AccountTags = AccountFieldTags.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 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");
 }
Esempio n. 21
0
 public void Serialize(Stream stream)
 {
     AccountFieldTags.Serialize(stream, this);
 }
Esempio n. 22
0
        public static AccountFieldTags Deserialize(Stream stream, AccountFieldTags instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            if (instance.GameLevelInfoTags == null)
            {
                instance.GameLevelInfoTags = new List <ProgramTag>();
            }
            if (instance.GameStatusTags == null)
            {
                instance.GameStatusTags = new List <ProgramTag>();
            }
            if (instance.GameAccountTags == null)
            {
                instance.GameAccountTags = new List <RegionTag>();
            }
            while (limit < 0L || stream.Position < limit)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    if (limit >= 0L)
                    {
                        throw new EndOfStreamException();
                    }
                    return(instance);
                }
                else if (num != 21)
                {
                    if (num != 29)
                    {
                        if (num != 37)
                        {
                            if (num != 58)
                            {
                                if (num != 74)
                                {
                                    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
                                    {
                                        instance.GameAccountTags.Add(RegionTag.DeserializeLengthDelimited(stream));
                                    }
                                }
                                else
                                {
                                    instance.GameStatusTags.Add(ProgramTag.DeserializeLengthDelimited(stream));
                                }
                            }
                            else
                            {
                                instance.GameLevelInfoTags.Add(ProgramTag.DeserializeLengthDelimited(stream));
                            }
                        }
                        else
                        {
                            instance.ParentalControlInfoTag = binaryReader.ReadUInt32();
                        }
                    }
                    else
                    {
                        instance.PrivacyInfoTag = binaryReader.ReadUInt32();
                    }
                }
                else
                {
                    instance.AccountLevelInfoTag = binaryReader.ReadUInt32();
                }
            }
            if (stream.Position == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
Esempio n. 23
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");
 }
Esempio n. 24
0
 public static AccountFieldTags Deserialize(Stream stream, AccountFieldTags instance)
 {
     return(AccountFieldTags.Deserialize(stream, instance, -1L));
 }
Esempio n. 25
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);
 }