Client.network.getCurrentSim().Caps.CapabilityURI("GetMesh") != null)
{
// Do we have this mesh asset in the cache?
if (Client.assets.Cache.hasAsset(meshID))
{
callback.execute(new MeshDownloadCallbackArgs(true, new AssetMesh(meshID, Client.assets.Cache.getCachedAssetBytes(meshID))));
return;
}
URI url = Client.network.getCurrentSim().Caps.CapabilityURI("GetMesh");
MethodDelegate<Void,HttpBaseRequestCompletedArg> downloadCompletedCallback = new MethodDelegate<Void,HttpBaseRequestCompletedArg>()
{
public Void execute(HttpBaseRequestCompletedArg e) {
// HttpRequestBase request = e.getRequest();
// HttpResponse response = e.getResponse();
byte[] responseData = e.getResponseData();
Exception error = e.getError();
if (error == null && responseData != null) // success
{
callback.execute(new MeshDownloadCallbackArgs(true, new AssetMesh(meshID, responseData)));
Client.assets.Cache.saveAssetToCache(meshID, responseData);
}
else // download failed
{
JLogger.warn(