mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:50:37 +02:00
Clean up launch server in main.cpp
This commit is contained in:
parent
0aba1d3e54
commit
224c35d568
1 changed files with 6 additions and 4 deletions
|
@ -129,18 +129,20 @@ int main(int argc, const char* argv[]) {
|
||||||
parser.addOption(serverContentPathOption);
|
parser.addOption(serverContentPathOption);
|
||||||
parser.parse(arguments);
|
parser.parse(arguments);
|
||||||
if (parser.isSet(runServerOption)) {
|
if (parser.isSet(runServerOption)) {
|
||||||
QString serverPath = QFileInfo(arguments[0]).path();
|
//QString serverPath = QFileInfo(arguments[0]).path();
|
||||||
serverPath += "/server-console/server-console.exe";
|
QString applicationDirPath = QCoreApplication::applicationDirPath();
|
||||||
//serverPath = "./server-console/server-console.exe";
|
QString serverPath = "/server-console/server-console.exe";
|
||||||
|
qDebug() << "Application dir path is: " << applicationDirPath;
|
||||||
|
qDebug() << "Server path is: " << serverPath;
|
||||||
QStringList args;
|
QStringList args;
|
||||||
if (parser.isSet(serverContentPathOption)) {
|
if (parser.isSet(serverContentPathOption)) {
|
||||||
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPathOption);
|
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPathOption);
|
||||||
args << "--" << "--contentPath" << serverContentPath;
|
args << "--" << "--contentPath" << serverContentPath;
|
||||||
}
|
}
|
||||||
qDebug() << "server path: " << serverPath << args;
|
|
||||||
qDebug() << QFileInfo(arguments[0]).path();
|
qDebug() << QFileInfo(arguments[0]).path();
|
||||||
qDebug() << QProcess::startDetached(serverPath, args);
|
qDebug() << QProcess::startDetached(serverPath, args);
|
||||||
|
|
||||||
|
// Sleep a short amount of time to give the server a chance to start
|
||||||
usleep(2000000);
|
usleep(2000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue