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