diff options
author | Oren Hurvitz | 2014-03-31 11:53:12 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-04-02 06:30:57 +0100 |
commit | d1c3f8eef58b29eb8760eeb1ac03852a2387f927 (patch) | |
tree | b8686f4ea01b6dac3740b9685734686e2178dd2d /OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset | |
parent | fix orphaned code in sun module per mantis 7068 (diff) | |
download | opensim-SC_OLD-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.zip opensim-SC_OLD-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.gz opensim-SC_OLD-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.bz2 opensim-SC_OLD-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.xz |
Added assets service method AssetsExist(), which returns whether the given list of assets exist.
This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 9f58175..ff8b051 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -312,6 +312,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | public virtual bool[] AssetsExist(string[] ids) | ||
316 | { | ||
317 | int numHG = 0; | ||
318 | foreach (string id in ids) | ||
319 | { | ||
320 | if (IsHG(id)) | ||
321 | ++numHG; | ||
322 | } | ||
323 | |||
324 | if (numHG == 0) | ||
325 | return m_GridService.AssetsExist(ids); | ||
326 | else if (numHG == ids.Length) | ||
327 | return m_HGService.AssetsExist(ids); | ||
328 | else | ||
329 | throw new Exception("[HG ASSET CONNECTOR]: AssetsExist: all the assets must be either local or foreign"); | ||
330 | } | ||
331 | |||
315 | public string Store(AssetBase asset) | 332 | public string Store(AssetBase asset) |
316 | { | 333 | { |
317 | bool isHG = IsHG(asset.ID); | 334 | bool isHG = IsHG(asset.ID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index 52b1039..97b7559 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -253,6 +253,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
253 | }); | 253 | }); |
254 | } | 254 | } |
255 | 255 | ||
256 | public bool[] AssetsExist(string[] ids) | ||
257 | { | ||
258 | return m_AssetService.AssetsExist(ids); | ||
259 | } | ||
260 | |||
256 | public string Store(AssetBase asset) | 261 | public string Store(AssetBase asset) |
257 | { | 262 | { |
258 | if (m_Cache != null) | 263 | if (m_Cache != null) |