public static PlayerAttack DeserializeLengthDelimited(Stream stream)
        {
            PlayerAttack playerAttack = Pool.Get <PlayerAttack>();

            PlayerAttack.DeserializeLengthDelimited(stream, playerAttack, false);
            return(playerAttack);
        }
        public static PlayerProjectileAttack DeserializeLengthDelimited(Stream stream, PlayerProjectileAttack instance, bool isDelta)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            while (stream.Position < position)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    throw new EndOfStreamException();
                }
                if (num <= 18)
                {
                    if (num != 10)
                    {
                        if (num == 18)
                        {
                            Vector3Serialized.DeserializeLengthDelimited(stream, ref instance.hitVelocity, isDelta);
                            continue;
                        }
                    }
                    else if (instance.playerAttack != null)
                    {
                        PlayerAttack.DeserializeLengthDelimited(stream, instance.playerAttack, isDelta);
                        continue;
                    }
                    else
                    {
                        instance.playerAttack = PlayerAttack.DeserializeLengthDelimited(stream);
                        continue;
                    }
                }
                else if (num == 29)
                {
                    instance.hitDistance = ProtocolParser.ReadSingle(stream);
                    continue;
                }
                else if (num == 37)
                {
                    instance.travelTime = ProtocolParser.ReadSingle(stream);
                    continue;
                }
                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);
            }
            if (stream.Position != position)
            {
                throw new ProtocolBufferException("Read past max limit");
            }
            return(instance);
        }