mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
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:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user