send VOXEL_QUERY to out of view voxel servers with PPS of 0

This commit is contained in:
ZappoMan 2013-10-28 12:07:02 -07:00
parent 0095259adf
commit 1c2e5eecd6

View file

@ -2381,16 +2381,14 @@ void Application::queryVoxels() {
}
}
// make sure there's at least one voxel server
// assume there's at least one voxel server
if (voxelServerCount < 1) {
return; // no voxel servers to talk to, we can bail.
voxelServerCount = 1;
}
// set our preferred PPS to be exactly evenly divided among all of the voxel servers...
int perServerPPS = DEFAULT_MAX_VOXEL_PPS/voxelServerCount;
_voxelQuery.setMaxVoxelPacketsPerSecond(perServerPPS);
UDPSocket* nodeSocket = NodeList::getInstance()->getNodeSocket();
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
// only send to the NodeTypes that are NODE_TYPE_VOXEL_SERVER
@ -2412,6 +2410,12 @@ void Application::queryVoxels() {
ViewFrustum::location serverFrustumLocation = _viewFrustum.boxInFrustum(serverBounds);
if (serverFrustumLocation != ViewFrustum::OUTSIDE) {
//printf("_voxelQuery.setMaxVoxelPacketsPerSecond(perServerPPS=%d)\n",perServerPPS);
_voxelQuery.setMaxVoxelPacketsPerSecond(perServerPPS);
} else {
//printf("_voxelQuery.setMaxVoxelPacketsPerSecond(0)\n");
_voxelQuery.setMaxVoxelPacketsPerSecond(0);
}
// set up the packet for sending...
unsigned char* endOfVoxelQueryPacket = voxelQueryPacket;
@ -2434,7 +2438,6 @@ void Application::queryVoxels() {
}
}
}
}
/////////////////////////////////////////////////////////////////////////////////////
// loadViewFrustum()