mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
more command-line arguments
This commit is contained in:
parent
6231fc4ba1
commit
d3dc0698a5
2 changed files with 21 additions and 2 deletions
|
@ -33,6 +33,10 @@ ICEClientApp::ICEClientApp(int argc, char* argv[]) : QCoreApplication(argc, argv
|
|||
const QCommandLineOption howManyTimesOption("n", "how many times to cycle", "0");
|
||||
parser.addOption(howManyTimesOption);
|
||||
|
||||
const QCommandLineOption domainIDOption("d", "domain-server uuid");
|
||||
parser.addOption(domainIDOption);
|
||||
|
||||
|
||||
if (!parser.parse(QCoreApplication::arguments())) {
|
||||
qCritical() << parser.errorText() << endl;
|
||||
parser.showHelp();
|
||||
|
@ -50,6 +54,11 @@ ICEClientApp::ICEClientApp(int argc, char* argv[]) : QCoreApplication(argc, argv
|
|||
_actionMax = parser.value(howManyTimesOption).toInt();
|
||||
}
|
||||
|
||||
if (parser.isSet(domainIDOption)) {
|
||||
_domainID = QUuid(parser.value(howManyTimesOption));
|
||||
}
|
||||
|
||||
|
||||
_iceServerAddr = HifiSockAddr("127.0.0.1", ICE_SERVER_DEFAULT_PORT);
|
||||
if (parser.isSet(iceServerAddressOption)) {
|
||||
// parse the IP and port combination for this target
|
||||
|
@ -97,12 +106,21 @@ void ICEClientApp::doSomething() {
|
|||
_localSockAddr = HifiSockAddr("127.0.0.1", _socket->localPort());
|
||||
_publicSockAddr = HifiSockAddr("127.0.0.1", _socket->localPort());
|
||||
|
||||
QUuid peerID = QUuid("75cd162a-53dc-4292-aaa5-1304ab1bb0f2");
|
||||
// QUuid peerID = QUuid("75cd162a-53dc-4292-aaa5-1304ab1bb0f2");
|
||||
QUuid peerID;
|
||||
if (_domainID == QUuid()) {
|
||||
// pick a random domain-id
|
||||
peerID = QUuid::createUuid();
|
||||
_state = 2;
|
||||
} else {
|
||||
// use the domain UUID given on the command-line
|
||||
peerID = _domainID;
|
||||
_state = 1;
|
||||
}
|
||||
_sessionUUID = QUuid::createUuid();
|
||||
|
||||
sendPacketToIceServer(PacketType::ICEServerQuery, _iceServerAddr, _sessionUUID, peerID);
|
||||
|
||||
_state = 1;
|
||||
_actionCount++;
|
||||
} else if (_state == 2) {
|
||||
_state = 3;
|
||||
|
|
|
@ -39,6 +39,7 @@ private:
|
|||
unsigned int _actionMax { 0 };
|
||||
|
||||
QUuid _sessionUUID;
|
||||
QUuid _domainID;
|
||||
|
||||
QTimer* _pingDomainTimer { nullptr };
|
||||
|
||||
|
|
Loading…
Reference in a new issue