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.
This commit is contained in:
Oren Hurvitz
2014-03-31 11:53:12 +03:00
parent ac16a667e1
commit d1c3f8eef5
25 changed files with 579 additions and 179 deletions

View File

@@ -312,6 +312,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
}
}
public virtual bool[] AssetsExist(string[] ids)
{
int numHG = 0;
foreach (string id in ids)
{
if (IsHG(id))
++numHG;
}
if (numHG == 0)
return m_GridService.AssetsExist(ids);
else if (numHG == ids.Length)
return m_HGService.AssetsExist(ids);
else
throw new Exception("[HG ASSET CONNECTOR]: AssetsExist: all the assets must be either local or foreign");
}
public string Store(AssetBase asset)
{
bool isHG = IsHG(asset.ID);

View File

@@ -253,6 +253,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
});
}
public bool[] AssetsExist(string[] ids)
{
return m_AssetService.AssetsExist(ids);
}
public string Store(AssetBase asset)
{
if (m_Cache != null)