public static GameSessionInfo DeserializeLengthDelimited(Stream stream, GameSessionInfo instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(GameSessionInfo.Deserialize(stream, instance, num));
        }
 public static void Serialize(Stream stream, GameSessionInfo instance)
 {
     if (instance.HasStartTime)
     {
         stream.WriteByte(24);
         ProtocolParser.WriteUInt32(stream, instance.StartTime);
     }
     if (instance.HasLocation)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.Location.GetSerializedSize());
         GameSessionLocation.Serialize(stream, instance.Location);
     }
     if (instance.HasHasBenefactor)
     {
         stream.WriteByte(40);
         ProtocolParser.WriteBool(stream, instance.HasBenefactor);
     }
     if (instance.HasIsUsingIgr)
     {
         stream.WriteByte(48);
         ProtocolParser.WriteBool(stream, instance.IsUsingIgr);
     }
     if (instance.HasParentalControlsActive)
     {
         stream.WriteByte(56);
         ProtocolParser.WriteBool(stream, instance.ParentalControlsActive);
     }
 }
        public static GameSessionInfo DeserializeLengthDelimited(Stream stream)
        {
            GameSessionInfo gameSessionInfo = new GameSessionInfo();

            GameSessionInfo.DeserializeLengthDelimited(stream, gameSessionInfo);
            return(gameSessionInfo);
        }
        public override bool Equals(object obj)
        {
            GameSessionInfo gameSessionInfo = obj as GameSessionInfo;

            if (gameSessionInfo == null)
            {
                return(false);
            }
            if (this.HasStartTime != gameSessionInfo.HasStartTime || this.HasStartTime && !this.StartTime.Equals(gameSessionInfo.StartTime))
            {
                return(false);
            }
            if (this.HasLocation != gameSessionInfo.HasLocation || this.HasLocation && !this.Location.Equals(gameSessionInfo.Location))
            {
                return(false);
            }
            if (this.HasHasBenefactor != gameSessionInfo.HasHasBenefactor || this.HasHasBenefactor && !this.HasBenefactor.Equals(gameSessionInfo.HasBenefactor))
            {
                return(false);
            }
            if (this.HasIsUsingIgr != gameSessionInfo.HasIsUsingIgr || this.HasIsUsingIgr && !this.IsUsingIgr.Equals(gameSessionInfo.IsUsingIgr))
            {
                return(false);
            }
            if (this.HasParentalControlsActive == gameSessionInfo.HasParentalControlsActive && (!this.HasParentalControlsActive || this.ParentalControlsActive.Equals(gameSessionInfo.ParentalControlsActive)))
            {
                return(true);
            }
            return(false);
        }
        public static GameSessionInfo DeserializeLengthDelimited(Stream stream, GameSessionInfo instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(GameSessionInfo.Deserialize(stream, instance, position));
        }
 public static void Serialize(Stream stream, GetGameSessionInfoResponse instance)
 {
     if (instance.HasSessionInfo)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.SessionInfo.GetSerializedSize());
         GameSessionInfo.Serialize(stream, instance.SessionInfo);
     }
 }
예제 #7
0
 public static GetGameSessionInfoResponse Deserialize(Stream stream, GetGameSessionInfoResponse 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 != 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)
             {
                 GameSessionInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
             }
             else
             {
                 instance.SessionInfo = GameSessionInfo.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
예제 #8
0
 public static GetGameSessionInfoResponse Deserialize(Stream stream, GetGameSessionInfoResponse 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 != 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 = GameSessionInfo.DeserializeLengthDelimited(stream);
             }
             else
             {
                 GameSessionInfo.DeserializeLengthDelimited(stream, instance.SessionInfo);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public void SetSessionInfo(GameSessionInfo val)
 {
     this.SessionInfo = val;
 }
        public override bool Equals(object obj)
        {
            GameSessionInfo gameSessionInfo = obj as GameSessionInfo;

            return(gameSessionInfo != null && this.HasStartTime == gameSessionInfo.HasStartTime && (!this.HasStartTime || this.StartTime.Equals(gameSessionInfo.StartTime)) && this.HasLocation == gameSessionInfo.HasLocation && (!this.HasLocation || this.Location.Equals(gameSessionInfo.Location)) && this.HasHasBenefactor == gameSessionInfo.HasHasBenefactor && (!this.HasHasBenefactor || this.HasBenefactor.Equals(gameSessionInfo.HasBenefactor)) && this.HasIsUsingIgr == gameSessionInfo.HasIsUsingIgr && (!this.HasIsUsingIgr || this.IsUsingIgr.Equals(gameSessionInfo.IsUsingIgr)) && this.HasParentalControlsActive == gameSessionInfo.HasParentalControlsActive && (!this.HasParentalControlsActive || this.ParentalControlsActive.Equals(gameSessionInfo.ParentalControlsActive)));
        }
 public void Serialize(Stream stream)
 {
     GameSessionInfo.Serialize(stream, this);
 }
 public static GameSessionInfo Deserialize(Stream stream, GameSessionInfo 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 != 34)
                 {
                     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.ParentalControlsActive = ProtocolParser.ReadBool(stream);
                             }
                         }
                         else
                         {
                             instance.IsUsingIgr = ProtocolParser.ReadBool(stream);
                         }
                     }
                     else
                     {
                         instance.HasBenefactor = ProtocolParser.ReadBool(stream);
                     }
                 }
                 else if (instance.Location == null)
                 {
                     instance.Location = GameSessionLocation.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     GameSessionLocation.DeserializeLengthDelimited(stream, instance.Location);
                 }
             }
             else
             {
                 instance.StartTime = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static GameSessionInfo Deserialize(Stream stream, GameSessionInfo instance)
 {
     return(GameSessionInfo.Deserialize(stream, instance, -1L));
 }