Example #1
0
        public static GameTimeInfo DeserializeLengthDelimited(Stream stream, GameTimeInfo instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GameTimeInfo.Deserialize(stream, instance, num));
        }
Example #2
0
        public override bool Equals(object obj)
        {
            GameTimeInfo gameTimeInfo = obj as GameTimeInfo;

            if (gameTimeInfo == null)
            {
                return(false);
            }
            if (this.HasIsUnlimitedPlayTime != gameTimeInfo.HasIsUnlimitedPlayTime || this.HasIsUnlimitedPlayTime && !this.IsUnlimitedPlayTime.Equals(gameTimeInfo.IsUnlimitedPlayTime))
            {
                return(false);
            }
            if (this.HasPlayTimeExpires != gameTimeInfo.HasPlayTimeExpires || this.HasPlayTimeExpires && !this.PlayTimeExpires.Equals(gameTimeInfo.PlayTimeExpires))
            {
                return(false);
            }
            if (this.HasIsSubscription != gameTimeInfo.HasIsSubscription || this.HasIsSubscription && !this.IsSubscription.Equals(gameTimeInfo.IsSubscription))
            {
                return(false);
            }
            if (this.HasIsRecurringSubscription == gameTimeInfo.HasIsRecurringSubscription && (!this.HasIsRecurringSubscription || this.IsRecurringSubscription.Equals(gameTimeInfo.IsRecurringSubscription)))
            {
                return(true);
            }
            return(false);
        }
Example #3
0
        public static GameTimeInfo DeserializeLengthDelimited(Stream stream)
        {
            GameTimeInfo gameTimeInfo = new GameTimeInfo();

            GameTimeInfo.DeserializeLengthDelimited(stream, gameTimeInfo);
            return(gameTimeInfo);
        }
 public static GameAccountState Deserialize(Stream stream, GameAccountState 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 != 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.GameStatus == null)
                 {
                     instance.GameStatus = GameStatus.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameStatus.DeserializeLengthDelimited(stream, instance.GameStatus);
                 }
             }
             else if (instance.GameTimeInfo == null)
             {
                 instance.GameTimeInfo = GameTimeInfo.DeserializeLengthDelimited(stream);
             }
             else
             {
                 GameTimeInfo.DeserializeLengthDelimited(stream, instance.GameTimeInfo);
             }
         }
         else if (instance.GameLevelInfo == null)
         {
             instance.GameLevelInfo = GameLevelInfo.DeserializeLengthDelimited(stream);
         }
         else
         {
             GameLevelInfo.DeserializeLengthDelimited(stream, instance.GameLevelInfo);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static GameTimeInfo Deserialize(Stream stream, GameTimeInfo 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 != 24)
             {
                 if (num2 != 40)
                 {
                     if (num2 != 48)
                     {
                         if (num2 != 56)
                         {
                             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.IsRecurringSubscription = ProtocolParser.ReadBool(stream);
                         }
                     }
                     else
                     {
                         instance.IsSubscription = ProtocolParser.ReadBool(stream);
                     }
                 }
                 else
                 {
                     instance.PlayTimeExpires = ProtocolParser.ReadUInt64(stream);
                 }
             }
             else
             {
                 instance.IsUnlimitedPlayTime = ProtocolParser.ReadBool(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Example #6
0
 public static GameTimeInfo Deserialize(Stream stream, GameTimeInfo 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 == 24)
             {
                 instance.IsUnlimitedPlayTime = ProtocolParser.ReadBool(stream);
             }
             else if (num == 40)
             {
                 instance.PlayTimeExpires = ProtocolParser.ReadUInt64(stream);
             }
             else if (num == 48)
             {
                 instance.IsSubscription = ProtocolParser.ReadBool(stream);
             }
             else if (num == 56)
             {
                 instance.IsRecurringSubscription = 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 (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static void Serialize(Stream stream, GameAccountState instance)
 {
     if (instance.HasGameLevelInfo)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.GameLevelInfo.GetSerializedSize());
         GameLevelInfo.Serialize(stream, instance.GameLevelInfo);
     }
     if (instance.HasGameTimeInfo)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.GameTimeInfo.GetSerializedSize());
         GameTimeInfo.Serialize(stream, instance.GameTimeInfo);
     }
     if (instance.HasGameStatus)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.GameStatus.GetSerializedSize());
         GameStatus.Serialize(stream, instance.GameStatus);
     }
 }
Example #8
0
 public static void Serialize(Stream stream, GameTimeInfo instance)
 {
     if (instance.HasIsUnlimitedPlayTime)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteBool(stream, instance.IsUnlimitedPlayTime);
     }
     if (instance.HasPlayTimeExpires)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteUInt64(stream, instance.PlayTimeExpires);
     }
     if (instance.HasIsSubscription)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteBool(stream, instance.IsSubscription);
     }
     if (instance.HasIsRecurringSubscription)
     {
         stream.WriteByte(56);
         ProtocolParser.WriteBool(stream, instance.IsRecurringSubscription);
     }
 }
Example #9
0
 public void Serialize(Stream stream)
 {
     GameTimeInfo.Serialize(stream, this);
 }
Example #10
0
 public static GameTimeInfo Deserialize(Stream stream, GameTimeInfo instance)
 {
     return(GameTimeInfo.Deserialize(stream, instance, -1L));
 }
Example #11
0
        public override bool Equals(object obj)
        {
            GameTimeInfo gameTimeInfo = obj as GameTimeInfo;

            return(gameTimeInfo != null && this.HasIsUnlimitedPlayTime == gameTimeInfo.HasIsUnlimitedPlayTime && (!this.HasIsUnlimitedPlayTime || this.IsUnlimitedPlayTime.Equals(gameTimeInfo.IsUnlimitedPlayTime)) && this.HasPlayTimeExpires == gameTimeInfo.HasPlayTimeExpires && (!this.HasPlayTimeExpires || this.PlayTimeExpires.Equals(gameTimeInfo.PlayTimeExpires)) && this.HasIsSubscription == gameTimeInfo.HasIsSubscription && (!this.HasIsSubscription || this.IsSubscription.Equals(gameTimeInfo.IsSubscription)) && this.HasIsRecurringSubscription == gameTimeInfo.HasIsRecurringSubscription && (!this.HasIsRecurringSubscription || this.IsRecurringSubscription.Equals(gameTimeInfo.IsRecurringSubscription)));
        }
 public void SetGameTimeInfo(GameTimeInfo val)
 {
     this.GameTimeInfo = val;
 }