From 32314ad5408c5fff945bdcce606052fa9d9140d7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 30 Sep 2013 13:34:22 -0700 Subject: [PATCH] have VS send UUID with check in for static assignment behavior --- assignment-client/src/audio/AudioMixer.cpp | 2 +- assignment-client/src/avatars/AvatarMixer.cpp | 2 +- domain-server/src/DomainServer.cpp | 10 +++------- libraries/shared/src/Assignment.h | 2 +- libraries/voxel-server-library/src/VoxelServer.cpp | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 98e4036533..2e54988eec 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -129,7 +129,7 @@ void AudioMixer::run() { // send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) { gettimeofday(&lastDomainServerCheckIn, NULL); - NodeList::getInstance()->sendDomainServerCheckIn(this->getUUID().toRfc4122().constData()); + NodeList::getInstance()->sendDomainServerCheckIn(_uuid.toRfc4122().constData()); if (Logging::shouldSendStats() && numStatCollections > 0) { // if we should be sending stats to Logstash send the appropriate average now diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index b074981a12..1a4f9844eb 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -119,7 +119,7 @@ void AvatarMixer::run() { // send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) { gettimeofday(&lastDomainServerCheckIn, NULL); - NodeList::getInstance()->sendDomainServerCheckIn(this->getUUID().toRfc4122().constData()); + NodeList::getInstance()->sendDomainServerCheckIn(_uuid.toRfc4122().constData()); } if (nodeList->getNodeSocket()->receive(nodeAddress, packetData, &receivedBytes) && diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 9f16cd3ade..40c4df68cf 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -260,13 +260,9 @@ Assignment* DomainServer::deployableAssignmentForRequest(Assignment& requestAssi // remove the assignment from the queue _assignmentQueue.erase(assignment); - if (deployableAssignment->getType() != Assignment::VoxelServerType) { - // keep audio-mixer and avatar-mixer assignments in the queue - // until we get a check-in from that GUID - // but stick it at the back so the others have a chance to go out - - _assignmentQueue.push_back(deployableAssignment); - } + // until we get a check-in from that GUID + // put assignment back in queue but stick it at the back so the others have a chance to go out + _assignmentQueue.push_back(deployableAssignment); } // stop looping, we've handed out an assignment diff --git a/libraries/shared/src/Assignment.h b/libraries/shared/src/Assignment.h index 8069cf96d9..4f2ec5e0f3 100644 --- a/libraries/shared/src/Assignment.h +++ b/libraries/shared/src/Assignment.h @@ -89,7 +89,7 @@ public: friend QDataStream& operator<<(QDataStream &out, const Assignment& assignment); friend QDataStream& operator>>(QDataStream &in, Assignment& assignment); -private: +protected: QUuid _uuid; /// the 16 byte UUID for this assignment Assignment::Command _command; /// the command for this assignment (Create, Deploy, Request) Assignment::Type _type; /// the type of the assignment, defines what the assignee will do diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index 0cd67a6856..5e587fbbe2 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -358,7 +358,7 @@ void VoxelServer::run() { // send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) { gettimeofday(&lastDomainServerCheckIn, NULL); - NodeList::getInstance()->sendDomainServerCheckIn(); + NodeList::getInstance()->sendDomainServerCheckIn(_uuid.toRfc4122().constData()); } if (nodeList->getNodeSocket()->receive(&senderAddress, packetData, &packetLength) &&