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/Services/Connectors/SimianGrid | |
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/Services/Connectors/SimianGrid')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 6f8d9ed..01cbf91 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -231,6 +231,26 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
231 | return true; | 231 | return true; |
232 | } | 232 | } |
233 | 233 | ||
234 | public bool[] AssetsExist(string[] ids) | ||
235 | { | ||
236 | if (String.IsNullOrEmpty(m_serverUrl)) | ||
237 | { | ||
238 | m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); | ||
239 | throw new InvalidOperationException(); | ||
240 | } | ||
241 | |||
242 | bool[] exist = new bool[ids.Length]; | ||
243 | |||
244 | for (int i = 0; i < ids.Length; i++) | ||
245 | { | ||
246 | AssetMetadata metadata = GetMetadata(ids[i]); | ||
247 | if (metadata != null) | ||
248 | exist[i] = true; | ||
249 | } | ||
250 | |||
251 | return exist; | ||
252 | } | ||
253 | |||
234 | /// <summary> | 254 | /// <summary> |
235 | /// Creates a new asset | 255 | /// Creates a new asset |
236 | /// </summary> | 256 | /// </summary> |