private void AssetReceived(string id, Object sender, AssetBase asset) { // m_log.DebugFormat( // "[J2KIMAGE]: Received asset {0} ({1} bytes)", id, asset != null ? asset.Data.Length.ToString() : "n/a"); UUID assetID = UUID.Zero; if (asset != null) { assetID = asset.FullID; } else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) { // Unfortunately we need this here, there's no other way. // This is due to the fact that textures opened directly from the agent's inventory // don't have any distinguishing feature. As such, in order to serve those when the // foreign user is visiting, we need to try again after the first fail to the local // asset service. string assetServerURL = string.Empty; if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL) && !string.IsNullOrEmpty(assetServerURL)) { if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) { assetServerURL = assetServerURL + "/"; } // m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); return; } } AssetDataCallback(assetID, asset); }
private void AssetReceived(string id, Object sender, AssetBase asset) { UUID assetID = UUID.Zero; if (asset != null) { assetID = asset.ID; } else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) { // Unfortunately we need this here, there's no other way. // This is due to the fact that textures opened directly from the agent's inventory // don't have any distinguishing feature. As such, in order to serve those when the // foreign user is visiting, we need to try again after the first fail to the local // asset service. string assetServerURL = string.Empty; if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) { MainConsole.Instance.DebugFormat( "[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); return; } } AssetDataCallback(assetID, asset); }