aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
diff options
context:
space:
mode:
authorOren Hurvitz2014-03-31 11:53:12 +0300
committerOren Hurvitz2014-04-02 06:30:57 +0100
commitd1c3f8eef58b29eb8760eeb1ac03852a2387f927 (patch)
treeb8686f4ea01b6dac3740b9685734686e2178dd2d /OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
parentfix orphaned code in sun module per mantis 7068 (diff)
downloadopensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.zip
opensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.gz
opensim-SC-d1c3f8eef58b29eb8760eeb1ac03852a2387f927.tar.bz2
opensim-SC-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 '')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 8b04d7f..32415e9 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -254,6 +254,27 @@ namespace OpenSim.Services.Connectors
254 return true; 254 return true;
255 } 255 }
256 256
257 public virtual bool[] AssetsExist(string[] ids)
258 {
259 string uri = m_ServerURI + "/get_assets_exist";
260
261 bool[] exist = null;
262 try
263 {
264 exist = SynchronousRestObjectRequester.MakeRequest<string[], bool[]>("POST", uri, ids);
265 }
266 catch (Exception)
267 {
268 // This is most likely to happen because the server doesn't support this function,
269 // so just silently return "doesn't exist" for all the assets.
270 }
271
272 if (exist == null)
273 exist = new bool[ids.Length];
274
275 return exist;
276 }
277
257 public string Store(AssetBase asset) 278 public string Store(AssetBase asset)
258 { 279 {
259 if (asset.Local) 280 if (asset.Local)