mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Update interface to launch server
This commit is contained in:
parent
4974c88880
commit
392ecb0dae
1 changed files with 22 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "InterfaceLogging.h"
|
||||
#include "UserActivityLogger.h"
|
||||
#include "MainWindow.h"
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
#ifdef HAS_BUGSPLAT
|
||||
#include <BuildInfo.h>
|
||||
|
@ -121,6 +122,27 @@ int main(int argc, const char* argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
QCommandLineParser parser;
|
||||
QCommandLineOption runServer("runServer", "Whether to run the server");
|
||||
QCommandLineOption serverContentPath("serverContentPath", "Where to find server content", "serverContentPath");
|
||||
parser.addOption(runServer);
|
||||
parser.addOption(serverContentPath);
|
||||
parser.parse(arguments);
|
||||
if (parser.isSet(runServer)) {
|
||||
QString serverPath = QFileInfo(arguments[0]).path();
|
||||
serverPath += "/server-console/server-console.exe";
|
||||
//serverPath = "./server-console/server-console.exe";
|
||||
QStringList args;
|
||||
if (parser.isSet(serverContentPath)) {
|
||||
args << "--" << "--contentPath" << parser.value(serverContentPath);
|
||||
}
|
||||
qDebug() << "server path: " << serverPath << args;
|
||||
qDebug() << QFileInfo(arguments[0]).path();
|
||||
qDebug() << QProcess::startDetached(serverPath, args);
|
||||
|
||||
usleep(2000000);
|
||||
}
|
||||
|
||||
QElapsedTimer startupTime;
|
||||
startupTime.start();
|
||||
|
||||
|
|
Loading…
Reference in a new issue