Showing the changes to assignment-client/src/AssignmentClientApp.cpp (1 of 8 files). Show all
Unified · Split
| @@ -4,6 +4,7 @@ · 3 unmodified lines | |||
| 4 | // | 4 | // |
| 5 | // Created by Seth Alves on 2/19/15. | 5 | // Created by Seth Alves on 2/19/15. |
| 6 | // Copyright 2015 High Fidelity, Inc. | 6 | // Copyright 2015 High Fidelity, Inc. |
| 7 | // Copyright 2021 Vircadia contributors. | ||
| 7 | // | 8 | // |
| 8 | // Distributed under the Apache License, Version 2.0. | 9 | // Distributed under the Apache License, Version 2.0. |
| 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | 10 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| @@ -44,7 +45,7 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : · 34 unmodified lines | |||
| 44 | 45 | ||
| 45 | // parse command-line | 46 | // parse command-line |
| 46 | QCommandLineParser parser; | 47 | QCommandLineParser parser; |
| 47 | parser.setApplicationDescription("High Fidelity Assignment Client"); | 48 | parser.setApplicationDescription("Vircadia Assignment Client"); |
| 48 | const QCommandLineOption helpOption = parser.addHelpOption(); | 49 | const QCommandLineOption helpOption = parser.addHelpOption(); |
| 49 | const QCommandLineOption versionOption = parser.addVersionOption(); | 50 | const QCommandLineOption versionOption = parser.addVersionOption(); |
| 50 | 51 | ||
| @@ -54,8 +55,8 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : · 3 unmodified lines | |||
| 54 | type = static_cast<Assignment::Type>(static_cast<int>(type) + 1)) { | 55 | type = static_cast<Assignment::Type>(static_cast<int>(type) + 1)) { |
| 55 | typeDescription.append(QStringLiteral("\n%1 | %2").arg(QString::number(type), Assignment::typeToString(type))); | 56 | typeDescription.append(QStringLiteral("\n%1 | %2").arg(QString::number(type), Assignment::typeToString(type))); |
| 56 | } | 57 | } |
| 57 | const QCommandLineOption clientTypeOption(ASSIGNMENT_TYPE_OVERRIDE_OPTION, typeDescription, "type"); | ||
| 58 | 58 | ||
| 59 | const QCommandLineOption clientTypeOption(ASSIGNMENT_TYPE_OVERRIDE_OPTION, typeDescription, "type"); | ||
| 59 | parser.addOption(clientTypeOption); | 60 | parser.addOption(clientTypeOption); |
| 60 | 61 | ||
| 61 | const QCommandLineOption poolOption(ASSIGNMENT_POOL_OPTION, "set assignment pool", "pool-name"); | 62 | const QCommandLineOption poolOption(ASSIGNMENT_POOL_OPTION, "set assignment pool", "pool-name"); |
| @@ -99,6 +100,9 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : · 37 unmodified lines | |||
| 99 | const QCommandLineOption logDirectoryOption(ASSIGNMENT_LOG_DIRECTORY, "directory to store logs", "log-directory"); | 100 | const QCommandLineOption logDirectoryOption(ASSIGNMENT_LOG_DIRECTORY, "directory to store logs", "log-directory"); |
| 100 | parser.addOption(logDirectoryOption); | 101 | parser.addOption(logDirectoryOption); |
| 101 | 102 | ||
| 103 | const QCommandLineOption disableDomainPortAutoDiscoveryOption(ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY, "disable automatic discovery of the domain server port"); | ||
| 104 | parser.addOption(disableDomainPortAutoDiscoveryOption); | ||
| 105 | |||
| 102 | const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid"); | 106 | const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid"); |
| 103 | parser.addOption(parentPIDOption); | 107 | parser.addOption(parentPIDOption); |
| 104 | 108 | ||
| @@ -151,11 +155,14 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : · 46 unmodified lines | |||
| 151 | } | 155 | } |
| 152 | 156 | ||
| 153 | QString logDirectory; | 157 | QString logDirectory; |
| 154 | |||
| 155 | if (parser.isSet(logDirectoryOption)) { | 158 | if (parser.isSet(logDirectoryOption)) { |
| 156 | logDirectory = parser.value(logDirectoryOption); | 159 | logDirectory = parser.value(logDirectoryOption); |
| 157 | } | 160 | } |
| 158 | 161 | ||
| 162 | bool disableDomainPortAutoDiscovery = false; | ||
| 163 | if (parser.isSet(disableDomainPortAutoDiscoveryOption)) { | ||
| 164 | disableDomainPortAutoDiscovery = true; | ||
| 165 | } | ||
| 159 | 166 | ||
| 160 | Assignment::Type requestAssignmentType = Assignment::AllTypes; | 167 | Assignment::Type requestAssignmentType = Assignment::AllTypes; |
| 161 | if (argumentVariantMap.contains(ASSIGNMENT_TYPE_OVERRIDE_OPTION)) { | 168 | if (argumentVariantMap.contains(ASSIGNMENT_TYPE_OVERRIDE_OPTION)) { |
| @@ -250,13 +257,15 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : · 88 unmodified lines | |||
| 250 | AssignmentClientMonitor* monitor = new AssignmentClientMonitor(numForks, minForks, maxForks, | 257 | AssignmentClientMonitor* monitor = new AssignmentClientMonitor(numForks, minForks, maxForks, |
| 251 | requestAssignmentType, assignmentPool, listenPort, | 258 | requestAssignmentType, assignmentPool, listenPort, |
| 252 | childMinListenPort, walletUUID, assignmentServerHostname, | 259 | childMinListenPort, walletUUID, assignmentServerHostname, |
| 253 | assignmentServerPort, httpStatusPort, logDirectory); | 260 | assignmentServerPort, httpStatusPort, logDirectory, |
| 261 | disableDomainPortAutoDiscovery); | ||
| 254 | monitor->setParent(this); | 262 | monitor->setParent(this); |
| 255 | connect(this, &QCoreApplication::aboutToQuit, monitor, &AssignmentClientMonitor::aboutToQuit); | 263 | connect(this, &QCoreApplication::aboutToQuit, monitor, &AssignmentClientMonitor::aboutToQuit); |
| 256 | } else { | 264 | } else { |
| 257 | AssignmentClient* client = new AssignmentClient(requestAssignmentType, assignmentPool, listenPort, | 265 | AssignmentClient* client = new AssignmentClient(requestAssignmentType, assignmentPool, listenPort, |
| 258 | walletUUID, assignmentServerHostname, | 266 | walletUUID, assignmentServerHostname, |
| 259 | assignmentServerPort, monitorPort); | 267 | assignmentServerPort, monitorPort, |
| 268 | disableDomainPortAutoDiscovery); | ||
| 260 | client->setParent(this); | 269 | client->setParent(this); |
| 261 | connect(this, &QCoreApplication::aboutToQuit, client, &AssignmentClient::aboutToQuit); | 270 | connect(this, &QCoreApplication::aboutToQuit, client, &AssignmentClient::aboutToQuit); |
| 262 | } | 271 | } |