diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 527b7f2331..3fc09636ed 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -29,6 +29,7 @@ #include "InterfaceLogging.h" #include "UserActivityLogger.h" #include "MainWindow.h" +#include #ifdef HAS_BUGSPLAT #include @@ -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();