mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
change voxelServersExist() to make sure that all existing voxel servers have a legitimate jurisdiction
This commit is contained in:
parent
2b604864d6
commit
e32bfc38f5
1 changed files with 16 additions and 2 deletions
|
@ -88,16 +88,30 @@ void VoxelEditPacketSender::sendVoxelEditMessage(PACKET_TYPE type, VoxelDetail&
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelEditPacketSender::voxelServersExist() const {
|
bool VoxelEditPacketSender::voxelServersExist() const {
|
||||||
|
bool hasVoxelServers = false;
|
||||||
|
bool atLeastOnJurisdictionMissing = false; // assume the best
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
|
||||||
// only send to the NodeTypes that are NODE_TYPE_VOXEL_SERVER
|
// only send to the NodeTypes that are NODE_TYPE_VOXEL_SERVER
|
||||||
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
if (node->getType() == NODE_TYPE_VOXEL_SERVER) {
|
||||||
if (nodeList->getNodeActiveSocketOrPing(&(*node))) {
|
if (nodeList->getNodeActiveSocketOrPing(&(*node))) {
|
||||||
return true;
|
QUuid nodeUUID = node->getUUID();
|
||||||
|
// If we've got Jurisdictions set, then check to see if we know the jurisdiction for this server
|
||||||
|
if (_voxelServerJurisdictions) {
|
||||||
|
// lookup our nodeUUID in the jurisdiction map, if it's missing then we're
|
||||||
|
// missing at least one jurisdiction
|
||||||
|
if ((*_voxelServerJurisdictions).find(nodeUUID) == (*_voxelServerJurisdictions).end()) {
|
||||||
|
atLeastOnJurisdictionMissing = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hasVoxelServers = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (atLeastOnJurisdictionMissing) {
|
||||||
|
break; // no point in looking further...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return (hasVoxelServers && !atLeastOnJurisdictionMissing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method is called when the edit packet layer has determined that it has a fully formed packet destined for
|
// This method is called when the edit packet layer has determined that it has a fully formed packet destined for
|
||||||
|
|
Loading…
Reference in a new issue