don't listen to VS packets not from current VS

This commit is contained in:
Stephen Birarda 2013-07-18 15:49:07 -07:00
parent 45d82dc97c
commit a00b95666a

View file

@ -1148,12 +1148,8 @@ void Application::editPreferences() {
// check if the domain server hostname is new // check if the domain server hostname is new
if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, strlen(newHostname)) != 0) { if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, strlen(newHostname)) != 0) {
// if so we need to clear the nodelist and delete the existing voxel and environment data
Node *voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
if (voxelServer) { NodeList::getInstance()->clear();
voxelServer->lock();
}
// kill the local voxels // kill the local voxels
_voxels.killLocalVoxels(); _voxels.killLocalVoxels();
@ -1161,11 +1157,6 @@ void Application::editPreferences() {
// reset the environment to default // reset the environment to default
_environment.resetToDefault(); _environment.resetToDefault();
if (voxelServer) {
voxelServer->unlock();
}
NodeList::getInstance()->clear();
NodeList::getInstance()->setDomainHostname(newHostname); NodeList::getInstance()->setDomainHostname(newHostname);
} }
@ -3356,7 +3347,7 @@ void* Application::networkReceive(void* args) {
case PACKET_TYPE_ENVIRONMENT_DATA: { case PACKET_TYPE_ENVIRONMENT_DATA: {
if (app->_renderVoxels->isChecked()) { if (app->_renderVoxels->isChecked()) {
Node* voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER); Node* voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
if (voxelServer) { if (voxelServer && socketMatch(voxelServer->getActiveSocket(), &senderAddress)) {
voxelServer->lock(); voxelServer->lock();
if (app->_incomingPacket[0] == PACKET_TYPE_ENVIRONMENT_DATA) { if (app->_incomingPacket[0] == PACKET_TYPE_ENVIRONMENT_DATA) {