mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 22:16:39 +02:00
commit
951a805ee6
2 changed files with 0 additions and 87 deletions
|
@ -118,19 +118,12 @@ void VoxelNodeData::writeToPacket(unsigned char* buffer, int bytes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
VoxelNodeData::~VoxelNodeData() {
|
VoxelNodeData::~VoxelNodeData() {
|
||||||
|
|
||||||
qDebug("VoxelNodeData::~VoxelNodeData() this=%p owningNode=%p _voxelSendThread=%p\n",
|
|
||||||
this, getOwningNode(), _voxelSendThread);
|
|
||||||
QUuid nodeUUID = getOwningNode()->getUUID();
|
|
||||||
qDebug() << "VoxelNodeData::~VoxelNodeData() nodeUUID=" << nodeUUID << "\n";
|
|
||||||
|
|
||||||
delete[] _voxelPacket;
|
delete[] _voxelPacket;
|
||||||
delete[] _lastVoxelPacket;
|
delete[] _lastVoxelPacket;
|
||||||
|
|
||||||
if (_voxelSendThread) {
|
if (_voxelSendThread) {
|
||||||
_voxelSendThread->terminate();
|
_voxelSendThread->terminate();
|
||||||
delete _voxelSendThread;
|
delete _voxelSendThread;
|
||||||
qDebug("VoxelNodeData::~VoxelNodeData() DELETED _voxelSendThread=%p\n", _voxelSendThread);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -649,47 +649,21 @@ void VoxelServer::run() {
|
||||||
|
|
||||||
// loop to send to nodes requesting data
|
// loop to send to nodes requesting data
|
||||||
while (true) {
|
while (true) {
|
||||||
bool wantNoisyDebugging = true;
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() top of while(true)\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for >= in case one gets past the goalie
|
// check for >= in case one gets past the goalie
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING NodeList::getInstance()->getNumNoReplyDomainCheckIns()\n";
|
|
||||||
}
|
|
||||||
if (NodeList::getInstance()->getNumNoReplyDomainCheckIns() >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
|
if (NodeList::getInstance()->getNumNoReplyDomainCheckIns() >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS) {
|
||||||
qDebug() << "Exit loop... getInstance()->getNumNoReplyDomainCheckIns() >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS\n";
|
qDebug() << "Exit loop... getInstance()->getNumNoReplyDomainCheckIns() >= MAX_SILENT_DOMAIN_SERVER_CHECK_INS\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING NodeList::getInstance()->getNumNoReplyDomainCheckIns()\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
// send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed
|
// 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) {
|
if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) {
|
||||||
gettimeofday(&lastDomainServerCheckIn, NULL);
|
gettimeofday(&lastDomainServerCheckIn, NULL);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "NodeList::getInstance()->sendDomainServerCheckIn()\n";
|
|
||||||
}
|
|
||||||
NodeList::getInstance()->sendDomainServerCheckIn();
|
NodeList::getInstance()->sendDomainServerCheckIn();
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "AFTER NodeList::getInstance()->sendDomainServerCheckIn()\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ping our inactive nodes to punch holes with them
|
// ping our inactive nodes to punch holes with them
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING nodeList->possiblyPingInactiveNodes()\n";
|
|
||||||
}
|
|
||||||
nodeList->possiblyPingInactiveNodes();
|
nodeList->possiblyPingInactiveNodes();
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING nodeList->possiblyPingInactiveNodes()\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING nodeList->getNodeSocket()->receive()\n";
|
|
||||||
}
|
|
||||||
if (nodeList->getNodeSocket()->receive(&senderAddress, packetData, &packetLength) &&
|
if (nodeList->getNodeSocket()->receive(&senderAddress, packetData, &packetLength) &&
|
||||||
packetVersionMatch(packetData)) {
|
packetVersionMatch(packetData)) {
|
||||||
|
|
||||||
|
@ -701,56 +675,23 @@ void VoxelServer::run() {
|
||||||
QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*)packetData + numBytesPacketHeader,
|
QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*)packetData + numBytesPacketHeader,
|
||||||
NUM_BYTES_RFC4122_UUID));
|
NUM_BYTES_RFC4122_UUID));
|
||||||
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING nodeList->nodeWithUUID() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
Node* node = nodeList->nodeWithUUID(nodeUUID);
|
Node* node = nodeList->nodeWithUUID(nodeUUID);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING nodeList->nodeWithUUID() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING nodeList->updateNodeWithData() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
nodeList->updateNodeWithData(node, &senderAddress, packetData, packetLength);
|
nodeList->updateNodeWithData(node, &senderAddress, packetData, packetLength);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING nodeList->updateNodeWithData() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING nodeList->getActiveSocket() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
if (!node->getActiveSocket()) {
|
if (!node->getActiveSocket()) {
|
||||||
// we don't have an active socket for this node, but they're talking to us
|
// we don't have an active socket for this node, but they're talking to us
|
||||||
// this means they've heard from us and can reply, let's assume public is active
|
// this means they've heard from us and can reply, let's assume public is active
|
||||||
node->activatePublicSocket();
|
node->activatePublicSocket();
|
||||||
}
|
}
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING nodeList->getActiveSocket() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING node->getLinkedData() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData();
|
VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData();
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() AFTER CALLING node->getLinkedData() line: " << __LINE__ << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nodeData && !nodeData->isVoxelSendThreadInitalized()) {
|
if (nodeData && !nodeData->isVoxelSendThreadInitalized()) {
|
||||||
nodeData->initializeVoxelSendThread(this);
|
nodeData->initializeVoxelSendThread(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (packetData[0] == PACKET_TYPE_VOXEL_JURISDICTION_REQUEST) {
|
} else if (packetData[0] == PACKET_TYPE_VOXEL_JURISDICTION_REQUEST) {
|
||||||
if (_jurisdictionSender) {
|
if (_jurisdictionSender) {
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING _jurisdictionSender->queueReceivedPacket()...\n";
|
|
||||||
}
|
|
||||||
_jurisdictionSender->queueReceivedPacket(senderAddress, packetData, packetLength);
|
_jurisdictionSender->queueReceivedPacket(senderAddress, packetData, packetLength);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() DONE WITH _jurisdictionSender->queueReceivedPacket()...\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (_voxelServerPacketProcessor &&
|
} else if (_voxelServerPacketProcessor &&
|
||||||
(packetData[0] == PACKET_TYPE_SET_VOXEL
|
(packetData[0] == PACKET_TYPE_SET_VOXEL
|
||||||
|
@ -785,57 +726,36 @@ void VoxelServer::run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING _voxelServerPacketProcessor->queueReceivedPacket()...\n";
|
|
||||||
}
|
|
||||||
_voxelServerPacketProcessor->queueReceivedPacket(senderAddress, packetData, packetLength);
|
_voxelServerPacketProcessor->queueReceivedPacket(senderAddress, packetData, packetLength);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() DONE WITH _voxelServerPacketProcessor->queueReceivedPacket()...\n";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// let processNodeData handle it.
|
// let processNodeData handle it.
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() CALLING NodeList::getInstance()->processNodeData(&senderAddress, packetData, packetLength)...\n";
|
|
||||||
}
|
|
||||||
NodeList::getInstance()->processNodeData(&senderAddress, packetData, packetLength);
|
NodeList::getInstance()->processNodeData(&senderAddress, packetData, packetLength);
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run() DONE WITH NodeList::getInstance()->processNodeData(&senderAddress, packetData, packetLength)...\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wantNoisyDebugging) {
|
|
||||||
qDebug() << "VoxelServer::run()... BOTTOM OF loop...\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
qDebug() << "VoxelServer::run()... AFTER loop...\n";
|
|
||||||
|
|
||||||
// call NodeList::clear() so that all of our node specific objects, including our sending threads, are
|
// call NodeList::clear() so that all of our node specific objects, including our sending threads, are
|
||||||
// properly shutdown and cleaned up.
|
// properly shutdown and cleaned up.
|
||||||
NodeList::getInstance()->clear();
|
NodeList::getInstance()->clear();
|
||||||
|
|
||||||
qDebug() << "VoxelServer::run()... terminating _jurisdictionSender\n";
|
|
||||||
if (_jurisdictionSender) {
|
if (_jurisdictionSender) {
|
||||||
_jurisdictionSender->terminate();
|
_jurisdictionSender->terminate();
|
||||||
delete _jurisdictionSender;
|
delete _jurisdictionSender;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "VoxelServer::run()... terminating _voxelServerPacketProcessor\n";
|
|
||||||
if (_voxelServerPacketProcessor) {
|
if (_voxelServerPacketProcessor) {
|
||||||
_voxelServerPacketProcessor->terminate();
|
_voxelServerPacketProcessor->terminate();
|
||||||
delete _voxelServerPacketProcessor;
|
delete _voxelServerPacketProcessor;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "VoxelServer::run()... terminating _voxelPersistThread\n";
|
|
||||||
if (_voxelPersistThread) {
|
if (_voxelPersistThread) {
|
||||||
_voxelPersistThread->terminate();
|
_voxelPersistThread->terminate();
|
||||||
delete _voxelPersistThread;
|
delete _voxelPersistThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tell our NodeList we're done with notifications
|
// tell our NodeList we're done with notifications
|
||||||
qDebug() << "VoxelServer::run()... nodeList->removeHook(&_nodeWatcher)\n";
|
|
||||||
nodeList->removeHook(&_nodeWatcher);
|
nodeList->removeHook(&_nodeWatcher);
|
||||||
|
|
||||||
qDebug() << "VoxelServer::run()... deleting _jurisdiction\n";
|
|
||||||
delete _jurisdiction;
|
delete _jurisdiction;
|
||||||
_jurisdiction = NULL;
|
_jurisdiction = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue