aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-03-25 00:20:38 +0000
committerJustin Clark-Casey (justincc)2014-03-25 00:20:38 +0000
commit091f3a80008a0f4a756fcb9ff4e87a24c2948c3c (patch)
treea98354e9317e0ed6892dec344a69447c0e9c70b8 /OpenSim/Region/CoreModules/World
parentDon't fail to enable permissions modules correctly if there is any leading or... (diff)
parentFixed Debug command for Groups. (Use of wrong capitalization caused *two* "de... (diff)
downloadopensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.zip
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.gz
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.bz2
opensim-SC_OLD-091f3a80008a0f4a756fcb9ff4e87a24c2948c3c.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs136
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs4
3 files changed, 83 insertions, 60 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 2e638d4..7920748 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -189,8 +189,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
189 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"] 189 m_rotationCenter = options.ContainsKey("rotation-center") ? (Vector3)options["rotation-center"]
190 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f); 190 : new Vector3(scene.RegionInfo.RegionSizeX / 2f, scene.RegionInfo.RegionSizeY / 2f, 0f);
191 191
192 // Zero can never be a valid user id 192 // Zero can never be a valid user or group id
193 m_validUserUuids[UUID.Zero] = false; 193 m_validUserUuids[UUID.Zero] = false;
194 m_validGroupUuids[UUID.Zero] = false;
194 195
195 m_groupsModule = m_rootScene.RequestModuleInterface<IGroupsModule>(); 196 m_groupsModule = m_rootScene.RequestModuleInterface<IGroupsModule>();
196 m_assetService = m_rootScene.AssetService; 197 m_assetService = m_rootScene.AssetService;
@@ -523,58 +524,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
523 oldTelehubUUID = UUID.Zero; 524 oldTelehubUUID = UUID.Zero;
524 } 525 }
525 526
526 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid 527 ModifySceneObject(scene, sceneObject);
527 // or creator data is present. Otherwise, use the estate owner instead.
528 foreach (SceneObjectPart part in sceneObject.Parts)
529 {
530 if (string.IsNullOrEmpty(part.CreatorData))
531 {
532 if (!ResolveUserUuid(scene, part.CreatorID))
533 part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
534 }
535 if (UserManager != null)
536 UserManager.AddUser(part.CreatorID, part.CreatorData);
537
538 if (!ResolveUserUuid(scene, part.OwnerID))
539 part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
540
541 if (!ResolveUserUuid(scene, part.LastOwnerID))
542 part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
543
544 if (!ResolveGroupUuid(part.GroupID))
545 part.GroupID = UUID.Zero;
546
547 // And zap any troublesome sit target information
548// part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
549// part.SitTargetPosition = new Vector3(0, 0, 0);
550
551 // Fix ownership/creator of inventory items
552 // Not doing so results in inventory items
553 // being no copy/no mod for everyone
554 lock (part.TaskInventory)
555 {
556 TaskInventoryDictionary inv = part.TaskInventory;
557 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
558 {
559 if (!ResolveUserUuid(scene, kvp.Value.OwnerID))
560 {
561 kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
562 }
563
564 if (string.IsNullOrEmpty(kvp.Value.CreatorData))
565 {
566 if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
567 kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
568 }
569
570 if (UserManager != null)
571 UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
572
573 if (!ResolveGroupUuid(kvp.Value.GroupID))
574 kvp.Value.GroupID = UUID.Zero;
575 }
576 }
577 }
578 528
579 if (scene.AddRestoredSceneObject(sceneObject, true, false)) 529 if (scene.AddRestoredSceneObject(sceneObject, true, false))
580 { 530 {
@@ -598,6 +548,67 @@ namespace OpenSim.Region.CoreModules.World.Archiver
598 scene.RegionInfo.RegionSettings.ClearSpawnPoints(); 548 scene.RegionInfo.RegionSettings.ClearSpawnPoints();
599 } 549 }
600 } 550 }
551
552 /// <summary>
553 /// Optionally modify a loaded SceneObjectGroup. Currently this just ensures that the
554 /// User IDs and Group IDs are valid, but other manipulations could be done as well.
555 /// </summary>
556 private void ModifySceneObject(Scene scene, SceneObjectGroup sceneObject)
557 {
558 // Try to retain the original creator/owner/lastowner if their uuid is present on this grid
559 // or creator data is present. Otherwise, use the estate owner instead.
560 foreach (SceneObjectPart part in sceneObject.Parts)
561 {
562 if (string.IsNullOrEmpty(part.CreatorData))
563 {
564 if (!ResolveUserUuid(scene, part.CreatorID))
565 part.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
566 }
567 if (UserManager != null)
568 UserManager.AddUser(part.CreatorID, part.CreatorData);
569
570 if (!(ResolveUserUuid(scene, part.OwnerID) || ResolveGroupUuid(part.OwnerID)))
571 part.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
572
573 if (!(ResolveUserUuid(scene, part.LastOwnerID) || ResolveGroupUuid(part.LastOwnerID)))
574 part.LastOwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
575
576 if (!ResolveGroupUuid(part.GroupID))
577 part.GroupID = UUID.Zero;
578
579 // And zap any troublesome sit target information
580 // part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
581 // part.SitTargetPosition = new Vector3(0, 0, 0);
582
583 // Fix ownership/creator of inventory items
584 // Not doing so results in inventory items
585 // being no copy/no mod for everyone
586 lock (part.TaskInventory)
587 {
588 TaskInventoryDictionary inv = part.TaskInventory;
589 foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
590 {
591 if (!(ResolveUserUuid(scene, kvp.Value.OwnerID) || ResolveGroupUuid(kvp.Value.OwnerID)))
592 {
593 kvp.Value.OwnerID = scene.RegionInfo.EstateSettings.EstateOwner;
594 }
595
596 if (string.IsNullOrEmpty(kvp.Value.CreatorData))
597 {
598 if (!ResolveUserUuid(scene, kvp.Value.CreatorID))
599 kvp.Value.CreatorID = scene.RegionInfo.EstateSettings.EstateOwner;
600 }
601
602 if (UserManager != null)
603 UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
604
605 if (!ResolveGroupUuid(kvp.Value.GroupID))
606 kvp.Value.GroupID = UUID.Zero;
607 }
608 }
609 }
610 }
611
601 612
602 /// <summary> 613 /// <summary>
603 /// Load serialized parcels. 614 /// Load serialized parcels.
@@ -695,9 +706,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
695 /// <returns></returns> 706 /// <returns></returns>
696 private bool ResolveGroupUuid(UUID uuid) 707 private bool ResolveGroupUuid(UUID uuid)
697 { 708 {
698 if (uuid == UUID.Zero)
699 return true; // this means the object has no group
700
701 lock (m_validGroupUuids) 709 lock (m_validGroupUuids)
702 { 710 {
703 if (!m_validGroupUuids.ContainsKey(uuid)) 711 if (!m_validGroupUuids.ContainsKey(uuid))
@@ -754,7 +762,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver
754 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; 762 sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];
755 763
756 if (assetType == (sbyte)AssetType.Unknown) 764 if (assetType == (sbyte)AssetType.Unknown)
765 {
757 m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); 766 m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid);
767 }
768 else if (assetType == (sbyte)AssetType.Object)
769 {
770 data = SceneObjectSerializer.ModifySerializedObject(UUID.Parse(uuid), data,
771 sog =>
772 {
773 ModifySceneObject(m_rootScene, sog);
774 return true;
775 });
776
777 if (data == null)
778 return false;
779 }
758 780
759 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); 781 //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
760 782
@@ -977,4 +999,4 @@ namespace OpenSim.Region.CoreModules.World.Archiver
977 return dearchivedScenes; 999 return dearchivedScenes;
978 } 1000 }
979 } 1001 }
980} \ No newline at end of file 1002}
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 3bd7b4a..cb9ad4a 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -1342,10 +1342,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
1342 { 1342 {
1343 m_regionChangeTimer.Stop(); 1343 m_regionChangeTimer.Stop();
1344 m_regionChangeTimer.Start(); 1344 m_regionChangeTimer.Start();
1345 }
1346 1345
1347 protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e)
1348 {
1349 ChangeDelegate change = OnRegionInfoChange; 1346 ChangeDelegate change = OnRegionInfoChange;
1350 1347
1351 if (change != null) 1348 if (change != null)
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 7f17aff..0ecf13b 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -1340,6 +1340,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1340 1340
1341 m_scene.ForEachClient(SendParcelOverlay); 1341 m_scene.ForEachClient(SendParcelOverlay);
1342 land.SendLandUpdateToClient(true, remote_client); 1342 land.SendLandUpdateToClient(true, remote_client);
1343 UpdateLandObject(land.LandData.LocalID, land.LandData);
1343 } 1344 }
1344 } 1345 }
1345 } 1346 }
@@ -1360,8 +1361,10 @@ namespace OpenSim.Region.CoreModules.World.Land
1360 land.LandData.GroupID = UUID.Zero; 1361 land.LandData.GroupID = UUID.Zero;
1361 land.LandData.IsGroupOwned = false; 1362 land.LandData.IsGroupOwned = false;
1362 land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); 1363 land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory);
1364
1363 m_scene.ForEachClient(SendParcelOverlay); 1365 m_scene.ForEachClient(SendParcelOverlay);
1364 land.SendLandUpdateToClient(true, remote_client); 1366 land.SendLandUpdateToClient(true, remote_client);
1367 UpdateLandObject(land.LandData.LocalID, land.LandData);
1365 } 1368 }
1366 } 1369 }
1367 } 1370 }
@@ -1388,6 +1391,7 @@ namespace OpenSim.Region.CoreModules.World.Land
1388 1391
1389 m_scene.ForEachClient(SendParcelOverlay); 1392 m_scene.ForEachClient(SendParcelOverlay);
1390 land.SendLandUpdateToClient(true, remote_client); 1393 land.SendLandUpdateToClient(true, remote_client);
1394 UpdateLandObject(land.LandData.LocalID, land.LandData);
1391 } 1395 }
1392 } 1396 }
1393 } 1397 }