public static GameAccountFieldOptions DeserializeLengthDelimited(Stream stream)
        {
            GameAccountFieldOptions gameAccountFieldOptions = new GameAccountFieldOptions();

            GameAccountFieldOptions.DeserializeLengthDelimited(stream, gameAccountFieldOptions);
            return(gameAccountFieldOptions);
        }
 public static GetGameAccountStateRequest Deserialize(Stream stream, GetGameAccountStateRequest 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 != 18)
             {
                 if (num != 82)
                 {
                     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 if (instance.Tags == null)
                     {
                         instance.Tags = GameAccountFieldTags.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.Tags);
                     }
                 }
                 else if (instance.Options == null)
                 {
                     instance.Options = GameAccountFieldOptions.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameAccountFieldOptions.DeserializeLengthDelimited(stream, instance.Options);
                 }
             }
             else if (instance.GameAccountId == null)
             {
                 instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
             }
         }
         else if (instance.AccountId == null)
         {
             instance.AccountId = EntityId.DeserializeLengthDelimited(stream);
         }
         else
         {
             EntityId.DeserializeLengthDelimited(stream, instance.AccountId);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
示例#3
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");
 }
示例#4
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);
 }