aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs66
-rw-r--r--OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs5
-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
7 files changed, 111 insertions, 112 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1ca142e..c3846d9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -245,8 +245,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
245 string state = sog.GetStateSnapshot(); 245 string state = sog.GetStateSnapshot();
246 ad.AttachmentObjectStates.Add(state); 246 ad.AttachmentObjectStates.Add(state);
247 sp.InTransitScriptStates.Add(state); 247 sp.InTransitScriptStates.Add(state);
248 // Let's remove the scripts of the original object here 248
249 sog.RemoveScriptInstances(true); 249 // Scripts of the originals will be removed when the Agent is successfully removed.
250 // sog.RemoveScriptInstances(true);
250 } 251 }
251 } 252 }
252 } 253 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index f7057fe..9963521 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -483,52 +483,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
483 { 483 {
484 if (m_creatorIdForAssetId.ContainsKey(assetId)) 484 if (m_creatorIdForAssetId.ContainsKey(assetId))
485 { 485 {
486 string xmlData = Utils.BytesToString(data); 486 data = SceneObjectSerializer.ModifySerializedObject(assetId, data,
487 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 487 sog => {
488 bool modified = false;
489
490 foreach (SceneObjectPart sop in sog.Parts)
491 {
492 if (string.IsNullOrEmpty(sop.CreatorData))
493 {
494 sop.CreatorID = m_creatorIdForAssetId[assetId];
495 modified = true;
496 }
497 }
498
499 return modified;
500 });
488 501
489 CoalescedSceneObjects coa = null; 502 if (data == null)
490 if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) 503 return false;
491 {
492// m_log.DebugFormat(
493// "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count);
494
495 if (coa.Objects.Count == 0)
496 {
497 m_log.WarnFormat(
498 "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of coalesced object from asset {0} as it has zero loaded components",
499 assetId);
500 return false;
501 }
502
503 sceneObjects.AddRange(coa.Objects);
504 }
505 else
506 {
507 SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
508
509 if (deserializedObject != null)
510 {
511 sceneObjects.Add(deserializedObject);
512 }
513 else
514 {
515 m_log.WarnFormat(
516 "[INVENTORY ARCHIVE READ REQUEST]: Aborting load of object from asset {0} as deserialization failed",
517 assetId);
518
519 return false;
520 }
521 }
522
523 foreach (SceneObjectGroup sog in sceneObjects)
524 foreach (SceneObjectPart sop in sog.Parts)
525 if (string.IsNullOrEmpty(sop.CreatorData))
526 sop.CreatorID = m_creatorIdForAssetId[assetId];
527
528 if (coa != null)
529 data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa));
530 else
531 data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0]));
532 } 504 }
533 } 505 }
534 506
@@ -550,7 +522,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
550 return false; 522 return false;
551 } 523 }
552 } 524 }
553 525
554 /// <summary> 526 /// <summary>
555 /// Load control file 527 /// Load control file
556 /// </summary> 528 /// </summary>
@@ -656,4 +628,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
656 m_assetsLoaded = true; 628 m_assetsLoaded = true;
657 } 629 }
658 } 630 }
659} \ No newline at end of file 631}
diff --git a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
index 8838612..3849996 100644
--- a/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Search/BasicSearchModule.cs
@@ -150,6 +150,8 @@ namespace OpenSim.Region.CoreModules.Framework.Search
150 150
151 void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart) 151 void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
152 { 152 {
153 queryText = queryText.Trim();
154
153 if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People) 155 if (((DirFindFlags)queryFlags & DirFindFlags.People) == DirFindFlags.People)
154 { 156 {
155 if (string.IsNullOrEmpty(queryText)) 157 if (string.IsNullOrEmpty(queryText))
@@ -194,4 +196,4 @@ namespace OpenSim.Region.CoreModules.Framework.Search
194 196
195 } 197 }
196 198
197} \ No newline at end of file 199}
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
index 9f0a719..3455e2c 100644
--- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs
@@ -278,7 +278,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
278 { 278 {
279 foreach (UserData data in m_UserCache.Values) 279 foreach (UserData data in m_UserCache.Values)
280 { 280 {
281 if (users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null && 281 if (data.Id != UUID.Zero &&
282 users.Find(delegate(UserData d) { return d.Id == data.Id; }) == null &&
282 (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower()))) 283 (data.FirstName.ToLower().StartsWith(query.ToLower()) || data.LastName.ToLower().StartsWith(query.ToLower())))
283 users.Add(data); 284 users.Add(data);
284 } 285 }
@@ -725,4 +726,4 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
725 726
726 } 727 }
727 728
728} \ No newline at end of file 729}
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 }