mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Fix server arguments causing crash on startup
This commit is contained in:
parent
fe6382d1b6
commit
0aba1d3e54
1 changed files with 7 additions and 7 deletions
|
@ -123,18 +123,18 @@ int main(int argc, const char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
QCommandLineOption runServer("runServer", "Whether to run the server");
|
QCommandLineOption runServerOption("runServer", "Whether to run the server");
|
||||||
QCommandLineOption serverContentPath("serverContentPath", "Where to find server content", "serverContentPath");
|
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
||||||
parser.addOption(runServer);
|
parser.addOption(runServerOption);
|
||||||
parser.addOption(serverContentPath);
|
parser.addOption(serverContentPathOption);
|
||||||
parser.parse(arguments);
|
parser.parse(arguments);
|
||||||
if (parser.isSet(runServer)) {
|
if (parser.isSet(runServerOption)) {
|
||||||
QString serverPath = QFileInfo(arguments[0]).path();
|
QString serverPath = QFileInfo(arguments[0]).path();
|
||||||
serverPath += "/server-console/server-console.exe";
|
serverPath += "/server-console/server-console.exe";
|
||||||
//serverPath = "./server-console/server-console.exe";
|
//serverPath = "./server-console/server-console.exe";
|
||||||
QStringList args;
|
QStringList args;
|
||||||
if (parser.isSet(serverContentPath)) {
|
if (parser.isSet(serverContentPathOption)) {
|
||||||
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPath);
|
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPathOption);
|
||||||
args << "--" << "--contentPath" << serverContentPath;
|
args << "--" << "--contentPath" << serverContentPath;
|
||||||
}
|
}
|
||||||
qDebug() << "server path: " << serverPath << args;
|
qDebug() << "server path: " << serverPath << args;
|
||||||
|
|
Loading…
Reference in a new issue