History

Merge remote-tracking branch 'upstream/master'

Mark Peng committed 13 years ago

Commit cfcb3112 parents fe01067 30be3f95 files · +19 −18Browse files

Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all

Unified · Split

interface/src/Application.cpp+9−14
@@ -1145,25 +1145,20 @@ void Application::editPreferences() { · 1144 unmodified lines
11451145 return;
11461146 }
11471147
1148−
1149− const char* newHostname = domainServerHostname->text().toLocal8Bit().data();
1150−
1148+ char newHostname[MAX_HOSTNAME_BYTES] = {};
1149+ memcpy(newHostname, domainServerHostname->text().toAscii().data(), domainServerHostname->text().size());
1150+
11511151 // check if the domain server hostname is new
1152− if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, sizeof(&newHostname)) != 0) {
1153− // if so we need to clear the nodelist and delete the local voxels
1154− Node *voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
1152+ if (memcmp(NodeList::getInstance()->getDomainHostname(), newHostname, strlen(newHostname)) != 0) {
11551153
1156− if (voxelServer) {
1157− voxelServer->lock();
1158− }
1154+ NodeList::getInstance()->clear();
11591155
1156+ // kill the local voxels
11601157 _voxels.killLocalVoxels();
11611158
1162− if (voxelServer) {
1163− voxelServer->unlock();
1164− }
1159+ // reset the environment to default
1160+ _environment.resetToDefault();
11651161
1166− NodeList::getInstance()->clear();
11671162 NodeList::getInstance()->setDomainHostname(newHostname);
11681163 }
11691164
@@ -3379,7 +3374,7 @@ void* Application::networkReceive(void* args) { · 2209 unmodified lines
33793374 case PACKET_TYPE_ENVIRONMENT_DATA: {
33803375 if (app->_renderVoxels->isChecked()) {
33813376 Node* voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
3382− if (voxelServer) {
3377+ if (voxelServer && socketMatch(voxelServer->getActiveSocket(), &senderAddress)) {
33833378 voxelServer->lock();
33843379
33853380 if (app->_incomingPacket[0] == PACKET_TYPE_ENVIRONMENT_DATA) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t