OpenSim.Region.CoreModules.World.Archiver.AssetsRequest.AssetRequestCallback C# (CSharp) Méthode

AssetRequestCallback() public méthode

Called back by the asset cache when it has the asset
public AssetRequestCallback ( string id, object sender, OpenSim.Framework.AssetBase asset ) : void
id string
sender object
asset OpenSim.Framework.AssetBase
Résultat void
        public void AssetRequestCallback(string id, object sender, AssetBase asset)
        {
            try
            {
                lock (this)
                {
                    //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id);
                    
                    m_requestCallbackTimer.Stop();
                    
                    if (m_requestState == RequestState.Aborted)
                    {
                        m_log.WarnFormat(
                            "[ARCHIVER]: Received information about asset {0} after archive save abortion.  Ignoring.", 
                            id);

                        return;
                    }
                                                           
                    if (asset != null)
                    {
//                        m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id);
                        m_foundAssetUuids.Add(asset.FullID);
                        m_assetsArchiver.WriteAsset(asset);
                    }
                    else
                    {
//                        m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id);
                        m_notFoundAssetUuids.Add(new UUID(id));
                    }
        
                    if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired)
                    {
                        m_requestState = RequestState.Completed;
                        
                        m_log.DebugFormat(
                            "[ARCHIVER]: Successfully added {0} assets ({1} assets notified missing)", 
                            m_foundAssetUuids.Count, m_notFoundAssetUuids.Count);
                        
                        // We want to stop using the asset cache thread asap 
                        // as we now need to do the work of producing the rest of the archive
                        Util.FireAndForget(PerformAssetsRequestCallback);
                    }
                    else
                    {
                        m_requestCallbackTimer.Start();
                    }
                }
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[ARCHIVER]: AssetRequestCallback failed with {0}", e);
            }
        }