public static GameAccountList DeserializeLengthDelimited(Stream stream)
        {
            GameAccountList gameAccountList = new GameAccountList();

            GameAccountList.DeserializeLengthDelimited(stream, gameAccountList);
            return(gameAccountList);
        }
Example #2
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 AccountState Deserialize(Stream stream, AccountState instance, long limit)
 {
     if (instance.GameLevelInfo == null)
     {
         instance.GameLevelInfo = new List <bnet.protocol.account.GameLevelInfo>();
     }
     if (instance.GameStatus == null)
     {
         instance.GameStatus = new List <bnet.protocol.account.GameStatus>();
     }
     if (instance.GameAccounts == null)
     {
         instance.GameAccounts = new List <GameAccountList>();
     }
     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.AccountLevelInfo != null)
                 {
                     bnet.protocol.account.AccountLevelInfo.DeserializeLengthDelimited(stream, instance.AccountLevelInfo);
                 }
                 else
                 {
                     instance.AccountLevelInfo = bnet.protocol.account.AccountLevelInfo.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 18)
             {
                 if (instance.PrivacyInfo != null)
                 {
                     bnet.protocol.account.PrivacyInfo.DeserializeLengthDelimited(stream, instance.PrivacyInfo);
                 }
                 else
                 {
                     instance.PrivacyInfo = bnet.protocol.account.PrivacyInfo.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 26)
             {
                 if (instance.ParentalControlInfo != null)
                 {
                     bnet.protocol.account.ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo);
                 }
                 else
                 {
                     instance.ParentalControlInfo = bnet.protocol.account.ParentalControlInfo.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 42)
             {
                 instance.GameLevelInfo.Add(bnet.protocol.account.GameLevelInfo.DeserializeLengthDelimited(stream));
             }
             else if (num == 50)
             {
                 instance.GameStatus.Add(bnet.protocol.account.GameStatus.DeserializeLengthDelimited(stream));
             }
             else if (num == 58)
             {
                 instance.GameAccounts.Add(GameAccountList.DeserializeLengthDelimited(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 AccountState Deserialize(Stream stream, AccountState instance, long limit)
 {
     if (instance.GameLevelInfo == null)
     {
         instance.GameLevelInfo = new List <GameLevelInfo>();
     }
     if (instance.GameStatus == null)
     {
         instance.GameStatus = new List <GameStatus>();
     }
     if (instance.GameAccounts == null)
     {
         instance.GameAccounts = 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 != 18)
                 {
                     if (num2 != 26)
                     {
                         if (num2 != 42)
                         {
                             if (num2 != 50)
                             {
                                 if (num2 != 58)
                                 {
                                     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.GameAccounts.Add(GameAccountList.DeserializeLengthDelimited(stream));
                                 }
                             }
                             else
                             {
                                 instance.GameStatus.Add(bnet.protocol.account.GameStatus.DeserializeLengthDelimited(stream));
                             }
                         }
                         else
                         {
                             instance.GameLevelInfo.Add(bnet.protocol.account.GameLevelInfo.DeserializeLengthDelimited(stream));
                         }
                     }
                     else if (instance.ParentalControlInfo == null)
                     {
                         instance.ParentalControlInfo = ParentalControlInfo.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo);
                     }
                 }
                 else if (instance.PrivacyInfo == null)
                 {
                     instance.PrivacyInfo = PrivacyInfo.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     PrivacyInfo.DeserializeLengthDelimited(stream, instance.PrivacyInfo);
                 }
             }
             else if (instance.AccountLevelInfo == null)
             {
                 instance.AccountLevelInfo = AccountLevelInfo.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountLevelInfo.DeserializeLengthDelimited(stream, instance.AccountLevelInfo);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }