Showing the changes to assignment-client/src/AssignmentClient.cpp (1 of 9 files). Show all
Unified · Split
| @@ -59,6 +59,7 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) : · 58 unmodified lines | ||
| 59 | 59 | const QString ASSIGNMENT_POOL_OPTION = "pool"; |
| 60 | 60 | const QString ASSIGNMENT_WALLET_DESTINATION_ID_OPTION = "wallet"; |
| 61 | 61 | const QString CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION = "a"; |
| 62 | + const QString CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION = "p"; | |
| 62 | 63 | |
| 63 | 64 | Assignment::Type requestAssignmentType = Assignment::AllTypes; |
| 64 | 65 | |
| @@ -87,17 +88,29 @@ AssignmentClient::AssignmentClient(int &argc, char **argv) : · 22 unmodified lines | ||
| 87 | 88 | |
| 88 | 89 | // create a NodeList as an unassigned client |
| 89 | 90 | NodeList* nodeList = NodeList::createInstance(NodeType::Unassigned); |
| 91 | + | |
| 92 | + unsigned short assignmentServerPort = DEFAULT_DOMAIN_SERVER_PORT; | |
| 93 | + | |
| 94 | + // check for an overriden assignment server port | |
| 95 | + if (argumentVariantMap.contains(CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION)) { | |
| 96 | + assignmentServerPort = | |
| 97 | + argumentVariantMap.value(CUSTOM_ASSIGNMENT_SERVER_PORT_OPTION).toString().toUInt(); | |
| 98 | + } | |
| 99 | + | |
| 100 | + HifiSockAddr assignmentServerSocket(DEFAULT_ASSIGNMENT_SERVER_HOSTNAME, assignmentServerPort); | |
| 90 | 101 | |
| 91 | 102 | // check for an overriden assignment server hostname |
| 92 | 103 | if (argumentVariantMap.contains(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION)) { |
| 93 | 104 | _assignmentServerHostname = argumentVariantMap.value(CUSTOM_ASSIGNMENT_SERVER_HOSTNAME_OPTION).toString(); |
| 94 | 105 | |
| 95 | − // set the custom assignment socket on our NodeList | |
| 96 | − HifiSockAddr customAssignmentSocket = HifiSockAddr(_assignmentServerHostname, DEFAULT_DOMAIN_SERVER_PORT); | |
| 97 | − | |
| 98 | − nodeList->setAssignmentServerSocket(customAssignmentSocket); | |
| 106 | + // change the hostname for our assignment server | |
| 107 | + assignmentServerSocket = HifiSockAddr(_assignmentServerHostname, assignmentServerSocket.getPort()); | |
| 99 | 108 | } |
| 109 | + | |
| 110 | + nodeList->setAssignmentServerSocket(assignmentServerSocket); | |
| 100 | 111 | |
| 112 | + qDebug() << "Assignment server socket is" << assignmentServerSocket; | |
| 113 | + | |
| 101 | 114 | // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required |
| 102 | 115 | qDebug() << "Waiting for assignment -" << _requestAssignment; |
| 103 | 116 | |