aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AssetService/XAssetService.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/AssetService/XAssetService.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/AssetService/XAssetService.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs
index 6047616..f58b769 100644
--- a/OpenSim/Services/AssetService/XAssetService.cs
+++ b/OpenSim/Services/AssetService/XAssetService.cs
@@ -175,9 +175,16 @@ namespace OpenSim.Services.AssetService
175 return true; 175 return true;
176 } 176 }
177 177
178 public virtual bool[] AssetsExist(string[] ids)
179 {
180 UUID[] uuid = Array.ConvertAll(ids, id => UUID.Parse(id));
181 return m_Database.AssetsExist(uuid);
182 }
183
178 public virtual string Store(AssetBase asset) 184 public virtual string Store(AssetBase asset)
179 { 185 {
180 if (!m_Database.ExistsAsset(asset.FullID)) 186 bool exists = m_Database.AssetsExist(new[] { asset.FullID })[0];
187 if (!exists)
181 { 188 {
182// m_log.DebugFormat( 189// m_log.DebugFormat(
183// "[XASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); 190// "[XASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
@@ -217,4 +224,4 @@ namespace OpenSim.Services.AssetService
217 m_ChainedAssetService.Delete(asset.ID); 224 m_ChainedAssetService.Delete(asset.ID);
218 } 225 }
219 } 226 }
220} \ No newline at end of file 227}