aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs14
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs14
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs21
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs10
5 files changed, 30 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index 59b30a9..7d9c9a9 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -776,7 +776,6 @@ namespace OpenSim.Region.CoreModules.Asset
776 { 776 {
777 UuidGatherer gatherer = new UuidGatherer(m_AssetService); 777 UuidGatherer gatherer = new UuidGatherer(m_AssetService);
778 778
779 Dictionary<UUID, sbyte> assetIdsToCheck = new Dictionary<UUID, sbyte>();
780 Dictionary<UUID, bool> assetsFound = new Dictionary<UUID, bool>(); 779 Dictionary<UUID, bool> assetsFound = new Dictionary<UUID, bool>();
781 780
782 foreach (Scene s in m_Scenes) 781 foreach (Scene s in m_Scenes)
@@ -784,10 +783,11 @@ namespace OpenSim.Region.CoreModules.Asset
784 StampRegionStatusFile(s.RegionInfo.RegionID); 783 StampRegionStatusFile(s.RegionInfo.RegionID);
785 784
786 s.ForEachSOG(delegate(SceneObjectGroup e) 785 s.ForEachSOG(delegate(SceneObjectGroup e)
787 { 786 {
788 gatherer.GatherAssetUuids(e, assetIdsToCheck); 787 gatherer.AddForInspection(e);
788 gatherer.GatherAll();
789 789
790 foreach (UUID assetID in assetIdsToCheck.Keys) 790 foreach (UUID assetID in gatherer.GatheredUuids.Keys)
791 { 791 {
792 if (!assetsFound.ContainsKey(assetID)) 792 if (!assetsFound.ContainsKey(assetID))
793 { 793 {
@@ -800,7 +800,7 @@ namespace OpenSim.Region.CoreModules.Asset
800 else if (storeUncached) 800 else if (storeUncached)
801 { 801 {
802 AssetBase cachedAsset = m_AssetService.Get(assetID.ToString()); 802 AssetBase cachedAsset = m_AssetService.Get(assetID.ToString());
803 if (cachedAsset == null && assetIdsToCheck[assetID] != (sbyte)AssetType.Unknown) 803 if (cachedAsset == null && gatherer.GatheredUuids[assetID] != (sbyte)AssetType.Unknown)
804 assetsFound[assetID] = false; 804 assetsFound[assetID] = false;
805 else 805 else
806 assetsFound[assetID] = true; 806 assetsFound[assetID] = true;
@@ -810,11 +810,11 @@ namespace OpenSim.Region.CoreModules.Asset
810 { 810 {
811 m_log.DebugFormat( 811 m_log.DebugFormat(
812 "[FLOTSAM ASSET CACHE]: Could not find asset {0}, type {1} referenced by object {2} at {3} in scene {4} when pre-caching all scene assets", 812 "[FLOTSAM ASSET CACHE]: Could not find asset {0}, type {1} referenced by object {2} at {3} in scene {4} when pre-caching all scene assets",
813 assetID, assetIdsToCheck[assetID], e.Name, e.AbsolutePosition, s.Name); 813 assetID, gatherer.GatheredUuids[assetID], e.Name, e.AbsolutePosition, s.Name);
814 } 814 }
815 } 815 }
816 816
817 assetIdsToCheck.Clear(); 817 gatherer.GatheredUuids.Clear();
818 }); 818 });
819 } 819 }
820 820
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index 6dab227..42a4c7a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -94,11 +94,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
94 protected UUID m_id; 94 protected UUID m_id;
95 95
96 /// <value> 96 /// <value>
97 /// Used to collect the uuids of the assets that we need to save into the archive
98 /// </value>
99 protected Dictionary<UUID, sbyte> m_assetUuids = new Dictionary<UUID, sbyte>();
100
101 /// <value>
102 /// Used to collect the uuids of the users that we need to save into the archive 97 /// Used to collect the uuids of the users that we need to save into the archive
103 /// </value> 98 /// </value>
104 protected Dictionary<UUID, int> m_userUuids = new Dictionary<UUID, int>(); 99 protected Dictionary<UUID, int> m_userUuids = new Dictionary<UUID, int>();
@@ -225,7 +220,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
225 220
226 // Don't chase down link asset items as they actually point to their target item IDs rather than an asset 221 // Don't chase down link asset items as they actually point to their target item IDs rather than an asset
227 if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder) 222 if (SaveAssets && itemAssetType != AssetType.Link && itemAssetType != AssetType.LinkFolder)
228 m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (sbyte)inventoryItem.AssetType, m_assetUuids); 223 m_assetGatherer.AddForInspection(inventoryItem.AssetID);
229 } 224 }
230 225
231 /// <summary> 226 /// <summary>
@@ -422,12 +417,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
422 417
423 if (SaveAssets) 418 if (SaveAssets)
424 { 419 {
425 m_log.DebugFormat("[INVENTORY ARCHIVER]: Saving {0} assets for items", m_assetUuids.Count); 420 m_assetGatherer.GatherAll();
421
422 m_log.DebugFormat(
423 "[INVENTORY ARCHIVER]: Saving {0} assets for items", m_assetGatherer.GatheredUuids.Count);
426 424
427 AssetsRequest ar 425 AssetsRequest ar
428 = new AssetsRequest( 426 = new AssetsRequest(
429 new AssetsArchiver(m_archiveWriter), 427 new AssetsArchiver(m_archiveWriter),
430 m_assetUuids, m_scene.AssetService, 428 m_assetGatherer.GatheredUuids, m_scene.AssetService,
431 m_scene.UserAccountService, m_scene.RegionInfo.ScopeID, 429 m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
432 options, ReceivedAllAssets); 430 options, ReceivedAllAssets);
433 431
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 2ddb599..fceda80 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -605,8 +605,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
605 // so.Name, so.AttachedAvatar, url); 605 // so.Name, so.AttachedAvatar, url);
606 606
607 IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); 607 IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
608 IteratingHGUuidGatherer uuidGatherer 608 HGUuidGatherer uuidGatherer
609 = new IteratingHGUuidGatherer(Scene.AssetService, url, ids); 609 = new HGUuidGatherer(Scene.AssetService, url, ids);
610 uuidGatherer.AddForInspection(so); 610 uuidGatherer.AddForInspection(so);
611 611
612 while (!uuidGatherer.Complete) 612 while (!uuidGatherer.Complete)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 2ac1517..6343a81 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -412,12 +412,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
412 412
413 // The act of gathering UUIDs downloads some assets from the remote server 413 // The act of gathering UUIDs downloads some assets from the remote server
414 // but not all... 414 // but not all...
415 Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
416 HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); 415 HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL);
417 uuidGatherer.GatherAssetUuids(assetID, meta.Type, ids); 416 uuidGatherer.AddForInspection(assetID);
418 m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", ids.Count); 417 uuidGatherer.GatherAll();
418
419 m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", uuidGatherer.GatheredUuids.Count);
419 bool success = true; 420 bool success = true;
420 foreach (UUID uuid in ids.Keys) 421 foreach (UUID uuid in uuidGatherer.GatheredUuids.Keys)
421 if (FetchAsset(userAssetURL, uuid) == null) 422 if (FetchAsset(userAssetURL, uuid) == null)
422 success = false; 423 success = false;
423 424
@@ -428,7 +429,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
428 m_log.DebugFormat("[HG ASSET MAPPER]: Successfully got item {0} from asset server {1}", assetID, userAssetURL); 429 m_log.DebugFormat("[HG ASSET MAPPER]: Successfully got item {0} from asset server {1}", assetID, userAssetURL);
429 } 430 }
430 431
431
432 public void Post(UUID assetID, UUID ownerID, string userAssetURL) 432 public void Post(UUID assetID, UUID ownerID, string userAssetURL)
433 { 433 {
434 m_log.DebugFormat("[HG ASSET MAPPER]: Starting to send asset {0} with children to asset server {1}", assetID, userAssetURL); 434 m_log.DebugFormat("[HG ASSET MAPPER]: Starting to send asset {0} with children to asset server {1}", assetID, userAssetURL);
@@ -442,9 +442,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
442 return; 442 return;
443 } 443 }
444 444
445 Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
446 HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); 445 HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty);
447 uuidGatherer.GatherAssetUuids(asset.FullID, asset.Type, ids); 446 uuidGatherer.AddForInspection(asset.FullID);
448 447
449 // Check which assets already exist in the destination server 448 // Check which assets already exist in the destination server
450 449
@@ -452,16 +451,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
452 if (!url.EndsWith("/") && !url.EndsWith("=")) 451 if (!url.EndsWith("/") && !url.EndsWith("="))
453 url = url + "/"; 452 url = url + "/";
454 453
455 string[] remoteAssetIDs = new string[ids.Count]; 454 string[] remoteAssetIDs = new string[uuidGatherer.GatheredUuids.Count];
456 int i = 0; 455 int i = 0;
457 foreach (UUID id in ids.Keys) 456 foreach (UUID id in uuidGatherer.GatheredUuids.Keys)
458 remoteAssetIDs[i++] = url + id.ToString(); 457 remoteAssetIDs[i++] = url + id.ToString();
459 458
460 bool[] exist = m_scene.AssetService.AssetsExist(remoteAssetIDs); 459 bool[] exist = m_scene.AssetService.AssetsExist(remoteAssetIDs);
461 460
462 var existSet = new HashSet<string>(); 461 var existSet = new HashSet<string>();
463 i = 0; 462 i = 0;
464 foreach (UUID id in ids.Keys) 463 foreach (UUID id in uuidGatherer.GatheredUuids.Keys)
465 { 464 {
466 if (exist[i]) 465 if (exist[i])
467 existSet.Add(id.ToString()); 466 existSet.Add(id.ToString());
@@ -472,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
472 471
473 bool success = true; 472 bool success = true;
474 473
475 foreach (UUID uuid in ids.Keys) 474 foreach (UUID uuid in uuidGatherer.GatheredUuids.Keys)
476 { 475 {
477 if (!existSet.Contains(uuid.ToString())) 476 if (!existSet.Contains(uuid.ToString()))
478 { 477 {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs
index b7d7c26..d67bdce 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
219 219
220 private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids) 220 private void ArchiveOneRegion(Scene scene, string regionDir, Dictionary<UUID, sbyte> assetUuids)
221 { 221 {
222 m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.RegionInfo.RegionName); 222 m_log.InfoFormat("[ARCHIVER]: Writing region {0}", scene.Name);
223 223
224 EntityBase[] entities = scene.GetEntities(); 224 EntityBase[] entities = scene.GetEntities();
225 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); 225 List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
@@ -253,13 +253,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
253 253
254 if (SaveAssets) 254 if (SaveAssets)
255 { 255 {
256 UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService); 256 UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids);
257 int prevAssets = assetUuids.Count; 257 int prevAssets = assetUuids.Count;
258 258
259 foreach (SceneObjectGroup sceneObject in sceneObjects) 259 foreach (SceneObjectGroup sceneObject in sceneObjects)
260 { 260 assetGatherer.AddForInspection(sceneObject);
261 assetGatherer.GatherAssetUuids(sceneObject, assetUuids); 261
262 } 262 assetGatherer.GatherAll();
263 263
264 m_log.DebugFormat( 264 m_log.DebugFormat(
265 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", 265 "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets",