コード例 #1
0
ファイル: AccountId.cs プロジェクト: mdX7/WoWLegionCompanion
        public static AccountId DeserializeLengthDelimited(Stream stream)
        {
            AccountId accountId = new AccountId();

            AccountId.DeserializeLengthDelimited(stream, accountId);
            return(accountId);
        }
コード例 #2
0
 public static CacheExpireRequest Deserialize(Stream stream, CacheExpireRequest instance, long limit)
 {
     if (instance.Account == null)
     {
         instance.Account = new List <AccountId>();
     }
     if (instance.GameAccount == null)
     {
         instance.GameAccount = new List <GameAccountHandle>();
     }
     if (instance.Email == null)
     {
         instance.Email = new List <string>();
     }
     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 != 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
                 {
                     instance.Email.Add(ProtocolParser.ReadString(stream));
                 }
             }
             else
             {
                 instance.GameAccount.Add(GameAccountHandle.DeserializeLengthDelimited(stream));
             }
         }
         else
         {
             instance.Account.Add(AccountId.DeserializeLengthDelimited(stream));
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
コード例 #3
0
 public static FlagUpdateRequest Deserialize(Stream stream, FlagUpdateRequest 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 != 16)
             {
                 if (num != 24)
                 {
                     if (num != 32)
                     {
                         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.Active = ProtocolParser.ReadBool(stream);
                     }
                 }
                 else
                 {
                     instance.Flag = ProtocolParser.ReadUInt64(stream);
                 }
             }
             else
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
         }
         else if (instance.Account == null)
         {
             instance.Account = AccountId.DeserializeLengthDelimited(stream);
         }
         else
         {
             AccountId.DeserializeLengthDelimited(stream, instance.Account);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
コード例 #4
0
 public static GetEBalanceRequest Deserialize(Stream stream, GetEBalanceRequest 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)
                 {
                     if (num2 != 24)
                     {
                         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.CurrencyHomeRegion = ProtocolParser.ReadUInt32(stream);
                     }
                 }
                 else
                 {
                     instance.Currency = ProtocolParser.ReadString(stream);
                 }
             }
             else if (instance.AccountId == null)
             {
                 instance.AccountId = AccountId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountId.DeserializeLengthDelimited(stream, instance.AccountId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
コード例 #5
0
 public static CredentialUpdateRequest Deserialize(Stream stream, CredentialUpdateRequest instance, long limit)
 {
     if (instance.OldCredentials == null)
     {
         instance.OldCredentials = new List <AccountCredential>();
     }
     if (instance.NewCredentials == null)
     {
         instance.NewCredentials = new List <AccountCredential>();
     }
     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 != 32)
                         {
                             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.Region = ProtocolParser.ReadUInt32(stream);
                         }
                     }
                     else
                     {
                         instance.NewCredentials.Add(AccountCredential.DeserializeLengthDelimited(stream));
                     }
                 }
                 else
                 {
                     instance.OldCredentials.Add(AccountCredential.DeserializeLengthDelimited(stream));
                 }
             }
             else if (instance.Account == null)
             {
                 instance.Account = AccountId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountId.DeserializeLengthDelimited(stream, instance.Account);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
コード例 #6
0
 public static GetAccountResponse Deserialize(Stream stream, GetAccountResponse instance, long limit)
 {
     if (instance.Email == null)
     {
         instance.Email = new List <string>();
     }
     if (instance.Links == null)
     {
         instance.Links = new List <GameAccountLink>();
     }
     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 != 90)
             {
                 if (num2 != 98)
                 {
                     if (num2 != 106)
                     {
                         if (num2 != 114)
                         {
                             if (num2 != 122)
                             {
                                 Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                                 uint field = key.Field;
                                 if (field != 16u)
                                 {
                                     if (field != 17u)
                                     {
                                         if (field == 0u)
                                         {
                                             throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                                         }
                                         ProtocolParser.SkipKey(stream, key);
                                     }
                                     else if (key.WireType == Wire.LengthDelimited)
                                     {
                                         if (instance.ParentalControlInfo == null)
                                         {
                                             instance.ParentalControlInfo = ParentalControlInfo.DeserializeLengthDelimited(stream);
                                         }
                                         else
                                         {
                                             ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo);
                                         }
                                     }
                                 }
                                 else if (key.WireType == Wire.LengthDelimited)
                                 {
                                     instance.Links.Add(GameAccountLink.DeserializeLengthDelimited(stream));
                                 }
                             }
                             else
                             {
                                 instance.FullName = ProtocolParser.ReadString(stream);
                             }
                         }
                         else
                         {
                             instance.BattleTag = ProtocolParser.ReadString(stream);
                         }
                     }
                     else
                     {
                         instance.Email.Add(ProtocolParser.ReadString(stream));
                     }
                 }
                 else if (instance.Id == null)
                 {
                     instance.Id = AccountId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     AccountId.DeserializeLengthDelimited(stream, instance.Id);
                 }
             }
             else if (instance.Blob == null)
             {
                 instance.Blob = AccountBlob.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountBlob.DeserializeLengthDelimited(stream, instance.Blob);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public static CreateGameAccountRequest Deserialize(Stream stream, CreateGameAccountRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.RealmPermissions = 1;
            while (true)
            {
                if (limit < (long)0 || stream.Position < limit)
                {
                    int num = stream.ReadByte();
                    if (num != -1)
                    {
                        switch (num)
                        {
                        case 29:
                        {
                            instance.Program = binaryReader.ReadUInt32();
                            continue;
                        }

                        case 32:
                        {
                            instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                            continue;
                        }

                        default:
                        {
                            if (num == 10)
                            {
                                if (instance.Account != null)
                                {
                                    AccountId.DeserializeLengthDelimited(stream, instance.Account);
                                }
                                else
                                {
                                    instance.Account = AccountId.DeserializeLengthDelimited(stream);
                                }
                                continue;
                            }
                            else if (num == 16)
                            {
                                instance.Region = ProtocolParser.ReadUInt32(stream);
                                continue;
                            }
                            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);
                                continue;
                            }
                        }
                        }
                    }
                    else
                    {
                        if (limit >= (long)0)
                        {
                            throw new EndOfStreamException();
                        }
                        break;
                    }
                }
                else
                {
                    if (stream.Position != limit)
                    {
                        throw new ProtocolBufferException("Read past max limit");
                    }
                    break;
                }
            }
            return(instance);
        }
コード例 #8
0
        public static CreateGameAccountRequest Deserialize(Stream stream, CreateGameAccountRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.RealmPermissions = 1u;
            while (limit < 0L || stream.get_Position() < limit)
            {
                int num = stream.ReadByte();
                if (num != -1)
                {
                    int num2 = num;
                    switch (num2)
                    {
                    case 29:
                        instance.Program = binaryReader.ReadUInt32();
                        continue;

                    case 30:
                    case 31:
                    {
IL_7A:
                        if (num2 == 10)
                        {
                            if (instance.Account == null)
                            {
                                instance.Account = AccountId.DeserializeLengthDelimited(stream);
                            }
                            else
                            {
                                AccountId.DeserializeLengthDelimited(stream, instance.Account);
                            }
                            continue;
                        }
                        if (num2 == 16)
                        {
                            instance.Region = ProtocolParser.ReadUInt32(stream);
                            continue;
                        }
                        Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                        uint field = key.Field;
                        if (field != 0u)
                        {
                            ProtocolParser.SkipKey(stream, key);
                            continue;
                        }
                        throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                    }

                    case 32:
                        instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                        continue;
                    }
                    goto IL_7A;
                }
                if (limit >= 0L)
                {
                    throw new EndOfStreamException();
                }
                return(instance);
            }
            if (stream.get_Position() == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }