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

            num += stream.get_Position();
            return(ServerStateChangeRequest.Deserialize(stream, instance, num));
        }
Exemple #2
0
 public static void Serialize(Stream stream, ServerStateChangeRequest instance)
 {
     stream.WriteByte(8);
     ProtocolParser.WriteUInt32(stream, instance.State);
     stream.WriteByte(16);
     ProtocolParser.WriteUInt64(stream, instance.EventTime);
 }
Exemple #3
0
        public static ServerStateChangeRequest DeserializeLengthDelimited(Stream stream)
        {
            ServerStateChangeRequest serverStateChangeRequest = new ServerStateChangeRequest();

            ServerStateChangeRequest.DeserializeLengthDelimited(stream, serverStateChangeRequest);
            return(serverStateChangeRequest);
        }
Exemple #4
0
        public static ServerStateChangeRequest DeserializeLengthDelimited(Stream stream, ServerStateChangeRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(ServerStateChangeRequest.Deserialize(stream, instance, position));
        }
Exemple #5
0
 public static ServerStateChangeRequest Deserialize(Stream stream, ServerStateChangeRequest 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 != 8)
             {
                 if (num2 != 16)
                 {
                     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.EventTime = ProtocolParser.ReadUInt64(stream);
                 }
             }
             else
             {
                 instance.State = ProtocolParser.ReadUInt32(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Exemple #6
0
        public override bool Equals(object obj)
        {
            ServerStateChangeRequest serverStateChangeRequest = obj as ServerStateChangeRequest;

            if (serverStateChangeRequest == null)
            {
                return(false);
            }
            if (!this.State.Equals(serverStateChangeRequest.State))
            {
                return(false);
            }
            if (!this.EventTime.Equals(serverStateChangeRequest.EventTime))
            {
                return(false);
            }
            return(true);
        }
Exemple #7
0
 public static ServerStateChangeRequest Deserialize(Stream stream, ServerStateChangeRequest 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 == 8)
             {
                 instance.State = ProtocolParser.ReadUInt32(stream);
             }
             else if (num == 16)
             {
                 instance.EventTime = ProtocolParser.ReadUInt64(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);
 }
Exemple #8
0
 public void Serialize(Stream stream)
 {
     ServerStateChangeRequest.Serialize(stream, this);
 }
Exemple #9
0
 public static ServerStateChangeRequest Deserialize(Stream stream, ServerStateChangeRequest instance)
 {
     return(ServerStateChangeRequest.Deserialize(stream, instance, -1L));
 }
Exemple #10
0
        public override bool Equals(object obj)
        {
            ServerStateChangeRequest serverStateChangeRequest = obj as ServerStateChangeRequest;

            return(serverStateChangeRequest != null && this.State.Equals(serverStateChangeRequest.State) && this.EventTime.Equals(serverStateChangeRequest.EventTime));
        }