From c087632d53cf054454b2c9a916c12d10cb4e0ab9 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 19 Sep 2013 13:20:27 -0500 Subject: [PATCH] have Domain Server treat Voxel Servers the same as Audio Mixers and Avatar Mixers --- domain-server/src/main.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/domain-server/src/main.cpp b/domain-server/src/main.cpp index 5c9638f7dc..a54328c3a7 100644 --- a/domain-server/src/main.cpp +++ b/domain-server/src/main.cpp @@ -185,9 +185,6 @@ int main(int argc, const char* argv[]) { // Start the web server. ctx = mg_start(&callbacks, NULL, options); - // wait to check on voxel-servers till we've given our NodeList a chance to get a good list - int checkForVoxelServerAttempt = 0; - while (true) { ::assignmentQueueMutex.lock(); @@ -205,24 +202,19 @@ int main(int argc, const char* argv[]) { ::assignmentQueue.push_front(&audioMixerAssignment); } - // Now handle voxel servers. Couple of things are special about voxel servers. - // 1) They can run standalone, and so we want to wait to ask for an assignment until we've given them sufficient - // time to check in with us. So we will look for them, but we want actually add assignments unless we haven't - // seen one after a few tries. - // 2) They aren't soloNodeOfType() so we have to count them. + // Now handle voxel servers. Since Voxel Servers aren't soloNodeOfType() we will count them and add an assignment if + // there is not at least one of them in the domain. int voxelServerCount = 0; for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { if (node->getType() == NODE_TYPE_VOXEL_SERVER) { voxelServerCount++; } } - const int MIN_VOXEL_SERVER_CHECKS = 10; - if (checkForVoxelServerAttempt > MIN_VOXEL_SERVER_CHECKS && voxelServerCount == 0 && + if (voxelServerCount == 0 && std::find(::assignmentQueue.begin(), ::assignmentQueue.end(), &voxelServerAssignment) == ::assignmentQueue.end()) { qDebug("Missing a voxel server and assignment not in queue. Adding.\n"); ::assignmentQueue.push_front(&voxelServerAssignment); } - checkForVoxelServerAttempt++; ::assignmentQueueMutex.unlock();