Exemplo n.º 1
0
        public static GameAccountOnlineNotification DeserializeLengthDelimited(Stream stream)
        {
            GameAccountOnlineNotification gameAccountOnlineNotification = new GameAccountOnlineNotification();

            GameAccountOnlineNotification.DeserializeLengthDelimited(stream, gameAccountOnlineNotification);
            return(gameAccountOnlineNotification);
        }
Exemplo n.º 2
0
        public static GameAccountOnlineNotification DeserializeLengthDelimited(Stream stream, GameAccountOnlineNotification instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(GameAccountOnlineNotification.Deserialize(stream, instance, num));
        }
 public static GameAccountOnlineNotification Deserialize(Stream stream, GameAccountOnlineNotification 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.GameAccountId != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
                 }
                 else
                 {
                     instance.GameAccountId = EntityId.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.Host != null)
             {
                 ProcessId.DeserializeLengthDelimited(stream, instance.Host);
             }
             else
             {
                 instance.Host = ProcessId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Exemplo n.º 4
0
 public static GameAccountOnlineNotification Deserialize(Stream stream, GameAccountOnlineNotification 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.Host == null)
                 {
                     instance.Host = ProcessId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     ProcessId.DeserializeLengthDelimited(stream, instance.Host);
                 }
             }
             else if (instance.GameAccountId == null)
             {
                 instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Exemplo n.º 5
0
 public static void Serialize(Stream stream, GameAccountOnlineNotification instance)
 {
     if (instance.GameAccountId == null)
     {
         throw new ArgumentNullException("GameAccountId", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
     EntityId.Serialize(stream, instance.GameAccountId);
     if (instance.HasHost)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
        public override bool Equals(object obj)
        {
            GameAccountOnlineNotification gameAccountOnlineNotification = obj as GameAccountOnlineNotification;

            if (gameAccountOnlineNotification == null)
            {
                return(false);
            }
            if (!this.GameAccountId.Equals(gameAccountOnlineNotification.GameAccountId))
            {
                return(false);
            }
            if (this.HasHost == gameAccountOnlineNotification.HasHost && (!this.HasHost || this.Host.Equals(gameAccountOnlineNotification.Host)))
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 7
0
 public static GameAccountOnlineNotification Deserialize(Stream stream, GameAccountOnlineNotification instance)
 {
     return(GameAccountOnlineNotification.Deserialize(stream, instance, -1L));
 }
Exemplo n.º 8
0
 public void Deserialize(Stream stream)
 {
     GameAccountOnlineNotification.Deserialize(stream, this);
 }
Exemplo n.º 9
0
        public override bool Equals(object obj)
        {
            GameAccountOnlineNotification gameAccountOnlineNotification = obj as GameAccountOnlineNotification;

            return(gameAccountOnlineNotification != null && this.GameAccountId.Equals(gameAccountOnlineNotification.GameAccountId) && this.HasHost == gameAccountOnlineNotification.HasHost && (!this.HasHost || this.Host.Equals(gameAccountOnlineNotification.Host)));
        }