Esempio n. 1
0
String RpcMethod::getMethodNameWithVersion() const
{
	String methodName = this->methodName;
	if(version != currentVersion())
		methodName = methodName + version;
	return methodName;
}
Esempio n. 2
0
File: Client.cpp Progetto: ifzz/FDK
bool CClient::CheckProtocolVersion(const CProtocolVersion& requiredVersion) const
{
    auto version = GetProtocolVersion();
    if (version.empty())
        return true;

    CProtocolVersion currentVersion(version);
    return requiredVersion <= currentVersion;
}
Esempio n. 3
0
void Entity::EnsureVersion()
{
	Query currentVersion(m_db, "SELECT version FROM dbschema ORDER BY version ASC");
	if(!currentVersion.Step()) {
		Query setVersion(m_db, "INSERT INTO dbschema(version) VALUES (?)");
		setVersion.BindInt64(1, kCurrentVersion);
		setVersion.Step();
	} else {
		Query updateVersion(m_db, "UPDATE dbschema SET version = ?");
		updateVersion.BindInt64(1, kCurrentVersion);
		updateVersion.Step();
	}
}
Esempio n. 4
0
AutoUpdateChecker::AutoUpdateChecker(QObject *parent) :
    QObject(parent),
    m_Nam(this)
{
    // Never communicate over HTTP
    m_Nam.setStrictTransportSecurityEnabled(true);

    connect(&m_Nam, SIGNAL(finished(QNetworkReply*)),
            this, SLOT(handleUpdateCheckRequestFinished(QNetworkReply*)));

    QString currentVersion(VERSION_STR);
    qDebug() << "Current Moonlight version:" << currentVersion;
    parseStringToVersionQuad(currentVersion, m_CurrentVersionQuad);

    // Should at least have a 1.0-style version number
    Q_ASSERT(m_CurrentVersionQuad.count() > 1);
}
Esempio n. 5
0
    void CrrFile::readHeader(const std::string& path, std::istream& in, uint64_t* chrTableOffset)
    {
        char buf[4];
        in.read(buf, 4);
        if (0 != memcmp(buf, "CRR\n", 4))
            throw Exception("failed to open reference "+path+": not a crr file");

        uint32_t version;
        readBinaryInt(in, &version);
        if (version != currentVersion())
            throw Exception("failed to open reference "+path+": version mismatch");

        uint64_t filler;
        readBinaryInt(in, &filler);
        readBinaryInt(in, &filler);

        readBinaryInt(in, chrTableOffset);
    }
Esempio n. 6
0
void RpcMethod::reset()
{
	this->version = currentVersion();
	this->status = STATUS_REQUEST;
	this->authToken = "";
	this->owner = "";
	this->methodName = "";

	if (isAutoDelArgs())
	{
		delete args;
		//delete returnValue;
	}
	this->args = null;
	this->returnValue = null;
	this->waitResult = false;
	//this->autoDelArgs = false;
}
Esempio n. 7
0
int main(int argc, char *argv[])
{
    QCoreApplication::setApplicationName( "VideoLibrary" );

    for(int i=0;i<argc;i++){
        if(!strcmp(argv[i],"-v")){              //return version ID integer
            QString version(CURRENT_VERSION);
            QStringList n = version.split(".");
            int ID = n.at(0).toInt()*100*100 + n.at(1).toInt()*100 + n.at(2).toInt();
            qDebug() << QString("Version : ") + version + QString(" - ID : ") + QString::number(ID);
            return ID;
        }
        if(!strcmp(argv[i],"-n")){              //return 1 if CURRENT_VERSION > version
            QStringList currentVersion = QString(CURRENT_VERSION).split(".");
            QStringList version = QString(argv[i+1]).split(".");
            if(currentVersion.at(0)>version.at(0)) return 1;
            if(currentVersion.at(1)>version.at(1)) return 1;
            if(currentVersion.at(2)>version.at(2)) return 1;
            return 0;
        }
    }

    QApplication a(argc, argv);

    QString path = qApp->applicationFilePath();

    Window w;
    w.setExecutableFilename(path);

#if defined(__WIN32__)
    if(path.contains("-update.exe")){
        QString original_path = path;
        original_path = original_path.remove("-update");

        w.showNewFeatures();

        if(QFile::exists(original_path)){
            if(!QFile::remove(original_path)){
               QMessageBox mess;
               mess.setText(QString("Can't remove: %1\nPlease close the software then restart the update").arg(original_path));
               mess.setWindowTitle("Error");
               mess.setIcon(QMessageBox::Critical);
               mess.exec();
            }
        }

        QFile::copy(path,original_path);
        QProcess process;

#ifdef DEBUG_OUTPUT
        w.addLog(path,QString(CURRENT_VERSION),original_path,"Install update");
#endif

        process.startDetached("\""+original_path+"\"");
        exit(1);
    }else{
        QString update = path;
        update.remove(".exe");
        update += "-update.exe";

#ifdef DEBUG_OUTPUT
        w.addLog(path,QString(CURRENT_VERSION),update,"Update path");
#endif

        if(QFile::exists(update)){
            QProcess process;
            QStringList arg;
            arg << "-v";
            int version = process.execute("\""+update+"\"",arg);
            QString updateVersion = QString::number(version);
            QString currentVersion(CURRENT_VERSION);
            QStringList n = currentVersion.split(".");
            int ID = n.at(0).toInt()*100*100 + n.at(1).toInt()*100 + n.at(2).toInt();
            if(ID>=version){
                qDebug() << "Already up to date";
#ifdef DEBUG_OUTPUT
                w.addLog(path,QString(CURRENT_VERSION),"","Already up to date");
                QMessageBox mess;
                mess.setText(QString("Already up to date\n%1 wille be remove").arg(update));
                mess.setWindowTitle("Information");
                mess.setIcon(QMessageBox::Information);
                mess.setDetailedText("Current version: "+currentVersion+"\n\n"
                                     "Update version: "+updateVersion);
                mess.exec();
#endif
                QFile::remove(update);
            }else{
#ifdef DEBUG_OUTPUT
                w.addLog(path,QString(CURRENT_VERSION),QString::number(version),"Start Update");
                QMessageBox mess;
                mess.setText(QString("Start update"));
                mess.setWindowTitle("Information");
                mess.setIcon(QMessageBox::Information);
                mess.setDetailedText("Update path:\n"+update);
                mess.exec();
#endif
                process.startDetached("\""+update+"\"");
                exit(1);
            }
        }
    }
#endif

    w.show();
    if(w.initForm()!=0)
        return 0;

    return a.exec();
}
Esempio n. 8
0
void LasZipStorage::write(Chunk& chunk) const
{
    Cell::PooledStack cellStack(chunk.acquire());
    const Schema& schema(chunk.schema());

    if (!m_metadata.delta())
    {
        throw std::runtime_error("Laszip storage requires scaling.");
    }

    const Delta& delta(*m_metadata.delta());

    CellTable cellTable(
            chunk.pool(),
            std::move(cellStack),
            makeUnique<Schema>(Schema::normalize(schema)));

    StreamReader reader(cellTable);

    const auto& outEndpoint(chunk.builder().outEndpoint());
    const auto& tmpEndpoint(chunk.builder().tmpEndpoint());

    const std::string localDir = outEndpoint.isLocal() ?
        outEndpoint.prefixedRoot() : tmpEndpoint.prefixedRoot();

    const std::string filename(m_metadata.basename(chunk.id()) + ".laz");

    const auto offset = Point::unscale(
            chunk.bounds().mid(),
            delta.scale(),
            delta.offset())
        .apply([](double d) { return std::floor(d); });

    // See https://www.pdal.io/stages/writers.las.html
    uint64_t timeMask(schema.hasTime() ? 1 : 0);
    uint64_t colorMask(schema.hasColor() ? 2 : 0);

    pdal::Options options;
    options.add("filename", localDir + filename);
    options.add("minor_version", 4);
    options.add("extra_dims", "all");
    options.add("software_id", "Entwine " + currentVersion().toString());
    options.add("compression", "laszip");
    options.add("dataformat_id", timeMask | colorMask);

    options.add("scale_x", delta.scale().x);
    options.add("scale_y", delta.scale().y);
    options.add("scale_z", delta.scale().z);

    options.add("offset_x", offset.x);
    options.add("offset_y", offset.y);
    options.add("offset_z", offset.z);

    if (auto r = m_metadata.reprojection()) options.add("a_srs", r->out());
    else if (m_metadata.srs().size()) options.add("a_srs", m_metadata.srs());

    auto lock(Executor::getLock());

    pdal::LasWriter writer;
    writer.setOptions(options);
    writer.setInput(reader);
    writer.prepare(cellTable);

    lock.unlock();

    writer.execute(cellTable);

    if (!outEndpoint.isLocal())
    {
        io::ensurePut(outEndpoint, filename, tmpEndpoint.getBinary(filename));

        arbiter::fs::remove(tmpEndpoint.prefixedRoot() + filename);
    }
}