mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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.parse(arguments);
|
||||
if (parser.isSet(runServerOption)) {
|
||||
QString serverPath = QFileInfo(arguments[0]).path();
|
||||
serverPath += "/server-console/server-console.exe";
|
||||
//serverPath = "./server-console/server-console.exe";
|
||||
//QString serverPath = QFileInfo(arguments[0]).path();
|
||||
QString applicationDirPath = QCoreApplication::applicationDirPath();
|
||||
QString serverPath = "/server-console/server-console.exe";
|
||||
qDebug() << "Application dir path is: " << applicationDirPath;
|
||||
qDebug() << "Server path is: " << serverPath;
|
||||
QStringList args;
|
||||
if (parser.isSet(serverContentPathOption)) {
|
||||
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPathOption);
|
||||
args << "--" << "--contentPath" << serverContentPath;
|
||||
}
|
||||
qDebug() << "server path: " << serverPath << args;
|
||||
qDebug() << QFileInfo(arguments[0]).path();
|
||||
qDebug() << QProcess::startDetached(serverPath, args);
|
||||
|
||||
// Sleep a short amount of time to give the server a chance to start
|
||||
usleep(2000000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue