mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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;
|
||||
QCommandLineOption runServer("runServer", "Whether to run the server");
|
||||
QCommandLineOption serverContentPath("serverContentPath", "Where to find server content", "serverContentPath");
|
||||
parser.addOption(runServer);
|
||||
parser.addOption(serverContentPath);
|
||||
QCommandLineOption runServerOption("runServer", "Whether to run the server");
|
||||
QCommandLineOption serverContentPathOption("serverContentPath", "Where to find server content", "serverContentPath");
|
||||
parser.addOption(runServerOption);
|
||||
parser.addOption(serverContentPathOption);
|
||||
parser.parse(arguments);
|
||||
if (parser.isSet(runServer)) {
|
||||
if (parser.isSet(runServerOption)) {
|
||||
QString serverPath = QFileInfo(arguments[0]).path();
|
||||
serverPath += "/server-console/server-console.exe";
|
||||
//serverPath = "./server-console/server-console.exe";
|
||||
QStringList args;
|
||||
if (parser.isSet(serverContentPath)) {
|
||||
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPath);
|
||||
if (parser.isSet(serverContentPathOption)) {
|
||||
QString serverContentPath = QFileInfo(arguments[0]).path() + "/" + parser.value(serverContentPathOption);
|
||||
args << "--" << "--contentPath" << serverContentPath;
|
||||
}
|
||||
qDebug() << "server path: " << serverPath << args;
|
||||
|
|
Loading…
Reference in a new issue