Пример #1
0
        public static GameAccountHandle DeserializeLengthDelimited(Stream stream)
        {
            GameAccountHandle gameAccountHandle = new GameAccountHandle();

            GameAccountHandle.DeserializeLengthDelimited(stream, gameAccountHandle);
            return(gameAccountHandle);
        }
Пример #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 GameAccountSessionNotification Deserialize(Stream stream, GameAccountSessionNotification 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.GameAccount != null)
                 {
                     GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
                 }
                 else
                 {
                     instance.GameAccount = GameAccountHandle.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.SessionInfo != null)
             {
                 GameSessionUpdateInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
             }
             else
             {
                 instance.SessionInfo = GameSessionUpdateInfo.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static GameAccountSessionNotification Deserialize(Stream stream, GameAccountSessionNotification 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.SessionInfo == null)
                 {
                     instance.SessionInfo = GameSessionUpdateInfo.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameSessionUpdateInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
                 }
             }
             else if (instance.GameAccount == null)
             {
                 instance.GameAccount = GameAccountHandle.DeserializeLengthDelimited(stream);
             }
             else
             {
                 GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static GameAccountList Deserialize(Stream stream, GameAccountList instance, long limit)
 {
     if (instance.Handle == null)
     {
         instance.Handle = new List <GameAccountHandle>();
     }
     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 != 24)
             {
                 if (num2 != 34)
                 {
                     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.Handle.Add(GameAccountHandle.DeserializeLengthDelimited(stream));
                 }
             }
             else
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Пример #6
0
 public static GameAccountList Deserialize(Stream stream, GameAccountList instance, long limit)
 {
     if (instance.Handle == null)
     {
         instance.Handle = new List <GameAccountHandle>();
     }
     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 == 24)
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 34)
             {
                 instance.Handle.Add(GameAccountHandle.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);
 }
Пример #7
0
 public static GameAccountBlob Deserialize(Stream stream, GameAccountBlob instance, long limit)
 {
     instance.Name             = string.Empty;
     instance.RealmPermissions = 0u;
     instance.Flags            = 0UL;
     instance.BillingFlags     = 0u;
     if (instance.Licenses == null)
     {
         instance.Licenses = new List <AccountLicense>();
     }
     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 != 24)
                 {
                     if (num != 32)
                     {
                         if (num != 40)
                         {
                             if (num != 48)
                             {
                                 if (num != 56)
                                 {
                                     if (num != 80)
                                     {
                                         if (num != 88)
                                         {
                                             if (num != 96)
                                             {
                                                 if (num != 104)
                                                 {
                                                     if (num != 112)
                                                     {
                                                         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");
                                                         }
                                                         if (field != 20u)
                                                         {
                                                             ProtocolParser.SkipKey(stream, key);
                                                         }
                                                         else if (key.WireType == Wire.LengthDelimited)
                                                         {
                                                             instance.Licenses.Add(AccountLicense.DeserializeLengthDelimited(stream));
                                                         }
                                                     }
                                                     else
                                                     {
                                                         instance.BoxLevelExpiration = ProtocolParser.ReadUInt64(stream);
                                                     }
                                                 }
                                                 else
                                                 {
                                                     instance.BoxLevel = ProtocolParser.ReadUInt32(stream);
                                                 }
                                             }
                                             else
                                             {
                                                 instance.StatusExpiration = ProtocolParser.ReadUInt64(stream);
                                             }
                                         }
                                         else
                                         {
                                             instance.UnitsRemaining = ProtocolParser.ReadUInt32(stream);
                                         }
                                     }
                                     else
                                     {
                                         instance.SubscriptionExpiration = ProtocolParser.ReadUInt64(stream);
                                     }
                                 }
                                 else
                                 {
                                     instance.CacheExpiration = ProtocolParser.ReadUInt64(stream);
                                 }
                             }
                             else
                             {
                                 instance.BillingFlags = ProtocolParser.ReadUInt32(stream);
                             }
                         }
                         else
                         {
                             instance.Flags = ProtocolParser.ReadUInt64(stream);
                         }
                     }
                     else
                     {
                         instance.Status = ProtocolParser.ReadUInt32(stream);
                     }
                 }
                 else
                 {
                     instance.RealmPermissions = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else
             {
                 instance.Name = ProtocolParser.ReadString(stream);
             }
         }
         else if (instance.GameAccount == null)
         {
             instance.GameAccount = GameAccountHandle.DeserializeLengthDelimited(stream);
         }
         else
         {
             GameAccountHandle.DeserializeLengthDelimited(stream, instance.GameAccount);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public static AccountReference Deserialize(Stream stream, AccountReference instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.Region = 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 == 13)
                    {
                        instance.Id = binaryReader.ReadUInt32();
                    }
                    else if (num == 18)
                    {
                        instance.Email = ProtocolParser.ReadString(stream);
                    }
                    else if (num == 26)
                    {
                        if (instance.Handle != null)
                        {
                            GameAccountHandle.DeserializeLengthDelimited(stream, instance.Handle);
                        }
                        else
                        {
                            instance.Handle = GameAccountHandle.DeserializeLengthDelimited(stream);
                        }
                    }
                    else if (num == 34)
                    {
                        instance.BattleTag = ProtocolParser.ReadString(stream);
                    }
                    else if (num == 80)
                    {
                        instance.Region = ProtocolParser.ReadUInt32(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);
        }