diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 38bd149..bb40450 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -42,6 +42,7 @@ using OpenSim.Framework.Communications.Osp; | |||
42 | using OpenSim.Framework.Serialization; | 42 | using OpenSim.Framework.Serialization; |
43 | using OpenSim.Framework.Serialization.External; | 43 | using OpenSim.Framework.Serialization.External; |
44 | using OpenSim.Region.CoreModules.World.Archiver; | 44 | using OpenSim.Region.CoreModules.World.Archiver; |
45 | using OpenSim.Region.Framework.Scenes; | ||
45 | using OpenSim.Services.Interfaces; | 46 | using OpenSim.Services.Interfaces; |
46 | 47 | ||
47 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | 48 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver |
@@ -56,31 +57,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
56 | private string m_invPath; | 57 | private string m_invPath; |
57 | 58 | ||
58 | /// <value> | 59 | /// <value> |
60 | /// We only use this to request modules | ||
61 | /// </value> | ||
62 | protected Scene m_scene; | ||
63 | |||
64 | /// <value> | ||
59 | /// The stream from which the inventory archive will be loaded. | 65 | /// The stream from which the inventory archive will be loaded. |
60 | /// </value> | 66 | /// </value> |
61 | private Stream m_loadStream; | 67 | private Stream m_loadStream; |
62 | 68 | ||
63 | protected CommunicationsManager m_commsManager; | ||
64 | protected IAssetService m_assetService; | ||
65 | |||
66 | public InventoryArchiveReadRequest( | 69 | public InventoryArchiveReadRequest( |
67 | CachedUserInfo userInfo, string invPath, string loadPath, CommunicationsManager commsManager, IAssetService assetService) | 70 | Scene scene, CachedUserInfo userInfo, string invPath, string loadPath) |
68 | : this( | 71 | : this( |
72 | scene, | ||
69 | userInfo, | 73 | userInfo, |
70 | invPath, | 74 | invPath, |
71 | new GZipStream(new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress), | 75 | new GZipStream(new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress)) |
72 | commsManager, assetService) | ||
73 | { | 76 | { |
74 | } | 77 | } |
75 | 78 | ||
76 | public InventoryArchiveReadRequest( | 79 | public InventoryArchiveReadRequest( |
77 | CachedUserInfo userInfo, string invPath, Stream loadStream, CommunicationsManager commsManager, IAssetService assetService) | 80 | Scene scene, CachedUserInfo userInfo, string invPath, Stream loadStream) |
78 | { | 81 | { |
82 | m_scene = scene; | ||
79 | m_userInfo = userInfo; | 83 | m_userInfo = userInfo; |
80 | m_invPath = invPath; | 84 | m_invPath = invPath; |
81 | m_loadStream = loadStream; | 85 | m_loadStream = loadStream; |
82 | m_commsManager = commsManager; | ||
83 | m_assetService = assetService; | ||
84 | } | 86 | } |
85 | 87 | ||
86 | /// <summary> | 88 | /// <summary> |
@@ -106,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
106 | // | 108 | // |
107 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might | 109 | // FIXME: FetchInventory should probably be assumed to by async anyway, since even standalones might |
108 | // use a remote inventory service, though this is vanishingly rare at the moment. | 110 | // use a remote inventory service, though this is vanishingly rare at the moment. |
109 | if (null == m_commsManager.UserAdminService) | 111 | if (null == m_scene.CommsManager.UserAdminService) |
110 | { | 112 | { |
111 | m_log.ErrorFormat( | 113 | m_log.ErrorFormat( |
112 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", | 114 | "[INVENTORY ARCHIVER]: Have not yet received inventory info for user {0} {1}", |
@@ -167,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
167 | // Don't use the item ID that's in the file | 169 | // Don't use the item ID that's in the file |
168 | item.ID = UUID.Random(); | 170 | item.ID = UUID.Random(); |
169 | 171 | ||
170 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); | 172 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); |
171 | if (UUID.Zero != ospResolvedId) | 173 | if (UUID.Zero != ospResolvedId) |
172 | item.CreatorIdAsUuid = ospResolvedId; | 174 | item.CreatorIdAsUuid = ospResolvedId; |
173 | 175 | ||
@@ -371,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
371 | asset.Type = assetType; | 373 | asset.Type = assetType; |
372 | asset.Data = data; | 374 | asset.Data = data; |
373 | 375 | ||
374 | m_assetService.Store(asset); | 376 | m_scene.AssetService.Store(asset); |
375 | 377 | ||
376 | return true; | 378 | return true; |
377 | } | 379 | } |