From 9e3de05e977ea6f2bb486275fcc04446d43536cf Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 31 Oct 2013 13:55:26 -0700 Subject: [PATCH] activate public socket if a node sends data to VS and AM --- assignment-client/src/audio/AudioMixer.cpp | 6 ++++++ libraries/voxel-server-library/src/VoxelServer.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 19da129488..c8897fe2b1 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -326,6 +326,12 @@ void AudioMixer::run() { if (matchingNode) { nodeList->updateNodeWithData(matchingNode, nodeAddress, packetData, receivedBytes); + + if (!matchingNode->getActiveSocket()) { + // 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 + matchingNode->activatePublicSocket(); + } } } else { // let processNodeData handle it. diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index cf0eeb4de9..b6b7ae92ae 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -460,6 +460,12 @@ void VoxelServer::run() { if (node) { nodeList->updateNodeWithData(node, &senderAddress, packetData, packetLength); + if (!node->getActiveSocket()) { + // 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 + node->activatePublicSocket(); + } + VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData(); if (nodeData && !nodeData->isVoxelSendThreadInitalized()) { nodeData->initializeVoxelSendThread(this);