diff options
Diffstat (limited to 'OpenSim/Region')
4 files changed, 35 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index d901b54..985b939 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -132,7 +132,12 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
132 | part.CreatorID = masterAvatarId; | 132 | part.CreatorID = masterAvatarId; |
133 | part.OwnerID = masterAvatarId; | 133 | part.OwnerID = masterAvatarId; |
134 | part.LastOwnerID = masterAvatarId; | 134 | part.LastOwnerID = masterAvatarId; |
135 | } | 135 | |
136 | // For now, give all incoming scene objects new uuids. This will allow scenes to be cloned | ||
137 | // on the same region server and multiple examples a single object archive to be imported | ||
138 | // to the same scene (when this is possible). | ||
139 | //part.UUID = LLUUID.Random(); | ||
140 | } | ||
136 | 141 | ||
137 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) | 142 | if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) |
138 | { | 143 | { |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index e980650..0341a70 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
44 | /// <summary> | 44 | /// <summary> |
45 | /// Method called when all the necessary assets for an archive request have been received. | 45 | /// Method called when all the necessary assets for an archive request have been received. |
46 | /// </summary> | 46 | /// </summary> |
47 | public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assets); | 47 | public delegate void AssetsRequestCallback(IDictionary<LLUUID, AssetBase> assetsFound, ICollection<LLUUID> assetsNotFoundUuids); |
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Execute the write of an archive once we have received all the necessary data | 50 | /// Execute the write of an archive once we have received all the necessary data |
@@ -73,9 +73,15 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
73 | m_savePath = savePath; | 73 | m_savePath = savePath; |
74 | } | 74 | } |
75 | 75 | ||
76 | protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assets) | 76 | protected internal void ReceivedAllAssets(IDictionary<LLUUID, AssetBase> assetsFound, ICollection<LLUUID> assetsNotFoundUuids) |
77 | { | 77 | { |
78 | m_log.DebugFormat("[ARCHIVER]: Received all {0} assets required", assets.Count); | 78 | foreach (LLUUID uuid in assetsNotFoundUuids) |
79 | { | ||
80 | m_log.DebugFormat("[ARCHIVER]: Could not find asset {0}", uuid); | ||
81 | } | ||
82 | |||
83 | m_log.InfoFormat( | ||
84 | "[ARCHIVER]: Received {0} of {1} assets requested", assetsFound.Count, assetsFound.Count + assetsNotFoundUuids.Count); | ||
79 | 85 | ||
80 | TarArchiveWriter archive = new TarArchiveWriter(); | 86 | TarArchiveWriter archive = new TarArchiveWriter(); |
81 | 87 | ||
@@ -108,7 +114,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
108 | } | 114 | } |
109 | 115 | ||
110 | // Write out assets | 116 | // Write out assets |
111 | AssetsArchiver assetsArchiver = new AssetsArchiver(assets); | 117 | AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); |
112 | assetsArchiver.Archive(archive); | 118 | assetsArchiver.Archive(archive); |
113 | 119 | ||
114 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); | 120 | archive.WriteTar(new GZipStream(new FileStream(m_savePath, FileMode.Create), CompressionMode.Compress)); |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs index 9a1b560..81d85d2 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsArchiver.cs | |||
@@ -121,23 +121,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
121 | { | 121 | { |
122 | AssetBase asset = m_assets[uuid]; | 122 | AssetBase asset = m_assets[uuid]; |
123 | 123 | ||
124 | if (asset != null) | 124 | string extension = string.Empty; |
125 | { | 125 | |
126 | string extension = string.Empty; | 126 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) |
127 | |||
128 | if (ArchiveConstants.ASSET_TYPE_TO_EXTENSION.ContainsKey(asset.Type)) | ||
129 | { | ||
130 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; | ||
131 | } | ||
132 | |||
133 | archive.AddFile( | ||
134 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | ||
135 | asset.Data); | ||
136 | } | ||
137 | else | ||
138 | { | 127 | { |
139 | m_log.WarnFormat("[ARCHIVER]: Could not find asset {0} to archive", uuid); | 128 | extension = ArchiveConstants.ASSET_TYPE_TO_EXTENSION[asset.Type]; |
140 | } | 129 | } |
130 | |||
131 | archive.AddFile( | ||
132 | ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, | ||
133 | asset.Data); | ||
141 | } | 134 | } |
142 | } | 135 | } |
143 | } | 136 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs index ebcbcc7..2fd79b1 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/AssetsRequest.cs | |||
@@ -54,6 +54,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
54 | /// Assets retrieved in this request | 54 | /// Assets retrieved in this request |
55 | /// </summary> | 55 | /// </summary> |
56 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); | 56 | protected Dictionary<LLUUID, AssetBase> m_assets = new Dictionary<LLUUID, AssetBase>(); |
57 | |||
58 | /// <summary> | ||
59 | /// Maintain a list of assets that could not be found. This will be passed back to the requester. | ||
60 | /// </summary> | ||
61 | protected List<LLUUID> m_notFoundAssetUuids = new List<LLUUID>(); | ||
57 | 62 | ||
58 | /// <summary> | 63 | /// <summary> |
59 | /// Record the number of asset replies required so we know when we've finished | 64 | /// Record the number of asset replies required so we know when we've finished |
@@ -77,7 +82,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
77 | { | 82 | { |
78 | // We can stop here if there are no assets to fetch | 83 | // We can stop here if there are no assets to fetch |
79 | if (m_repliesRequired == 0) | 84 | if (m_repliesRequired == 0) |
80 | m_assetsRequestCallback(m_assets); | 85 | m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); |
81 | 86 | ||
82 | foreach (LLUUID uuid in m_uuids) | 87 | foreach (LLUUID uuid in m_uuids) |
83 | { | 88 | { |
@@ -92,7 +97,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
92 | /// <param name="asset"></param> | 97 | /// <param name="asset"></param> |
93 | public void AssetRequestCallback(LLUUID assetID, AssetBase asset) | 98 | public void AssetRequestCallback(LLUUID assetID, AssetBase asset) |
94 | { | 99 | { |
95 | m_assets[assetID] = asset; | 100 | if (asset != null) |
101 | m_assets[assetID] = asset; | ||
102 | else | ||
103 | m_notFoundAssetUuids.Add(assetID); | ||
96 | 104 | ||
97 | if (m_assets.Count == m_repliesRequired) | 105 | if (m_assets.Count == m_repliesRequired) |
98 | { | 106 | { |
@@ -108,7 +116,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
108 | /// </summary> | 116 | /// </summary> |
109 | protected void PerformAssetsRequestCallback() | 117 | protected void PerformAssetsRequestCallback() |
110 | { | 118 | { |
111 | m_assetsRequestCallback(m_assets); | 119 | m_assetsRequestCallback(m_assets, m_notFoundAssetUuids); |
112 | } | 120 | } |
113 | } | 121 | } |
114 | } | 122 | } |