mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:29:03 +02:00
have Domain Server treat Voxel Servers the same as Audio Mixers and Avatar Mixers
This commit is contained in:
parent
f6754ea9c7
commit
c087632d53
1 changed files with 3 additions and 11 deletions
|
@ -185,9 +185,6 @@ int main(int argc, const char* argv[]) {
|
||||||
// Start the web server.
|
// Start the web server.
|
||||||
ctx = mg_start(&callbacks, NULL, options);
|
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) {
|
while (true) {
|
||||||
|
|
||||||
::assignmentQueueMutex.lock();
|
::assignmentQueueMutex.lock();
|
||||||
|
@ -205,24 +202,19 @@ int main(int argc, const char* argv[]) {
|
||||||
::assignmentQueue.push_front(&audioMixerAssignment);
|
::assignmentQueue.push_front(&audioMixerAssignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now handle voxel servers. Couple of things are special about voxel servers.
|
// Now handle voxel servers. Since Voxel Servers aren't soloNodeOfType() we will count them and add an assignment if
|
||||||
// 1) They can run standalone, and so we want to wait to ask for an assignment until we've given them sufficient
|
// there is not at least one of them in the domain.
|
||||||
// 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.
|
|
||||||
int voxelServerCount = 0;
|
int voxelServerCount = 0;
|
||||||
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
||||||
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
||||||
voxelServerCount++;
|
voxelServerCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const int MIN_VOXEL_SERVER_CHECKS = 10;
|
if (voxelServerCount == 0 &&
|
||||||
if (checkForVoxelServerAttempt > MIN_VOXEL_SERVER_CHECKS && voxelServerCount == 0 &&
|
|
||||||
std::find(::assignmentQueue.begin(), ::assignmentQueue.end(), &voxelServerAssignment) == ::assignmentQueue.end()) {
|
std::find(::assignmentQueue.begin(), ::assignmentQueue.end(), &voxelServerAssignment) == ::assignmentQueue.end()) {
|
||||||
qDebug("Missing a voxel server and assignment not in queue. Adding.\n");
|
qDebug("Missing a voxel server and assignment not in queue. Adding.\n");
|
||||||
::assignmentQueue.push_front(&voxelServerAssignment);
|
::assignmentQueue.push_front(&voxelServerAssignment);
|
||||||
}
|
}
|
||||||
checkForVoxelServerAttempt++;
|
|
||||||
|
|
||||||
::assignmentQueueMutex.unlock();
|
::assignmentQueueMutex.unlock();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue