From 8616230fcffbc5c8a919e4ee721be7f871d9f698 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sun, 6 Sep 2009 20:04:18 +0100 Subject: refactor: replace some uses of iar module reference with scene instead --- .../Archiver/InventoryArchiveWriteRequest.cs | 22 ++++++++++++++++------ .../Inventory/Archiver/InventoryArchiverModule.cs | 4 ++-- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 6653516..da54469 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -39,6 +39,7 @@ using OpenSim.Framework.Serialization.External; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Communications.Osp; +using OpenSim.Region.Framework.Scenes; using OpenSim.Region.CoreModules.World.Archiver; using OpenSim.Region.Framework.Scenes; @@ -60,6 +61,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected UuidGatherer m_assetGatherer; /// + /// We only use this to request modules + /// + protected Scene m_scene; + + /// /// ID of this request /// protected Guid m_id; @@ -83,10 +89,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// Constructor /// public InventoryArchiveWriteRequest( - Guid id, InventoryArchiverModule module, CachedUserInfo userInfo, string invPath, string savePath) + Guid id, InventoryArchiverModule module, Scene scene, + CachedUserInfo userInfo, string invPath, string savePath) : this( id, module, + scene, userInfo, invPath, new GZipStream(new FileStream(savePath, FileMode.Create), CompressionMode.Compress)) @@ -97,10 +105,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// Constructor /// public InventoryArchiveWriteRequest( - Guid id, InventoryArchiverModule module, CachedUserInfo userInfo, string invPath, Stream saveStream) + Guid id, InventoryArchiverModule module, Scene scene, + CachedUserInfo userInfo, string invPath, Stream saveStream) { m_id = id; m_module = module; + m_scene = scene; m_userInfo = userInfo; m_invPath = invPath; m_saveStream = saveStream; @@ -135,7 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; InventoryItemBase saveItem = (InventoryItemBase)inventoryItem.Clone(); - saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); + saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_scene.CommsManager); string serialization = UserInventoryItemSerializer.Serialize(saveItem); m_archiveWriter.WriteFile(filename, serialization); @@ -222,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might // use a remote inventory service, though this is vanishingly rare at the moment. - if (null == m_module.CommsManager.UserAdminService) + if (null == m_scene.CommsManager.UserAdminService) { m_log.ErrorFormat( "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", @@ -313,7 +323,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver SaveUsers(); new AssetsRequest( new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, - m_module.AssetService, ReceivedAllAssets).Execute(); + m_scene.AssetService, ReceivedAllAssets).Execute(); } /// @@ -327,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { // Record the creator of this item CachedUserInfo creator - = m_module.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); + = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(creatorId); if (creator != null) { diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 55d7997..36e17b4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver CachedUserInfo userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) - new InventoryArchiveWriteRequest(id, this, userInfo, invPath, saveStream).Execute(); + new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(); } } @@ -137,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver CachedUserInfo userInfo = GetUserInfo(firstName, lastName); if (userInfo != null) - new InventoryArchiveWriteRequest(id, this, userInfo, invPath, savePath).Execute(); + new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(); } } -- cgit v1.1