diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 7871eda..d4fb1ba 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -73,6 +73,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
73 | 73 | ||
74 | private AssetMetadata FetchMetadata(string url, UUID assetID) | 74 | private AssetMetadata FetchMetadata(string url, UUID assetID) |
75 | { | 75 | { |
76 | if (string.IsNullOrEmpty(url)) | ||
77 | return null; | ||
78 | |||
76 | if (!url.EndsWith("/") && !url.EndsWith("=")) | 79 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
77 | url = url + "/"; | 80 | url = url + "/"; |
78 | 81 | ||
@@ -92,6 +95,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
92 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); | 95 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); |
93 | if (asset == null) | 96 | if (asset == null) |
94 | { | 97 | { |
98 | if (string.IsNullOrEmpty(url)) | ||
99 | return null; | ||
100 | |||
95 | if (!url.EndsWith("/") && !url.EndsWith("=")) | 101 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
96 | url = url + "/"; | 102 | url = url + "/"; |
97 | 103 | ||
@@ -109,6 +115,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
109 | 115 | ||
110 | public bool PostAsset(string url, AssetBase asset) | 116 | public bool PostAsset(string url, AssetBase asset) |
111 | { | 117 | { |
118 | if (string.IsNullOrEmpty(url)) | ||
119 | return false; | ||
120 | |||
112 | if (asset != null) | 121 | if (asset != null) |
113 | { | 122 | { |
114 | if (!url.EndsWith("/") && !url.EndsWith("=")) | 123 | if (!url.EndsWith("/") && !url.EndsWith("=")) |
@@ -165,7 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
165 | 174 | ||
166 | private void AdjustIdentifiers(AssetMetadata meta) | 175 | private void AdjustIdentifiers(AssetMetadata meta) |
167 | { | 176 | { |
168 | if (meta.CreatorID != null && meta.CreatorID != string.Empty) | 177 | if (!string.IsNullOrEmpty(meta.CreatorID)) |
169 | { | 178 | { |
170 | UUID uuid = UUID.Zero; | 179 | UUID uuid = UUID.Zero; |
171 | UUID.TryParse(meta.CreatorID, out uuid); | 180 | UUID.TryParse(meta.CreatorID, out uuid); |
@@ -251,9 +260,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
251 | 260 | ||
252 | // The act of gathering UUIDs downloads some assets from the remote server | 261 | // The act of gathering UUIDs downloads some assets from the remote server |
253 | // but not all... | 262 | // but not all... |
254 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 263 | Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); |
255 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); | 264 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, userAssetURL); |
256 | uuidGatherer.GatherAssetUuids(assetID, (AssetType)meta.Type, ids); | 265 | uuidGatherer.GatherAssetUuids(assetID, meta.Type, ids); |
257 | m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", ids.Count); | 266 | m_log.DebugFormat("[HG ASSET MAPPER]: Preparing to get {0} assets", ids.Count); |
258 | bool success = true; | 267 | bool success = true; |
259 | foreach (UUID uuid in ids.Keys) | 268 | foreach (UUID uuid in ids.Keys) |
@@ -277,9 +286,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
277 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); | 286 | AssetBase asset = m_scene.AssetService.Get(assetID.ToString()); |
278 | if (asset != null) | 287 | if (asset != null) |
279 | { | 288 | { |
280 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 289 | Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); |
281 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); | 290 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(m_scene.AssetService, string.Empty); |
282 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | 291 | uuidGatherer.GatherAssetUuids(asset.FullID, asset.Type, ids); |
283 | bool success = false; | 292 | bool success = false; |
284 | foreach (UUID uuid in ids.Keys) | 293 | foreach (UUID uuid in ids.Keys) |
285 | { | 294 | { |