예제 #1
0
        private void AssetLoadedHandler(OpenMetaverse.Assets.Asset asset, long bytesRead, long totalBytes)
        {
            // Asynchronously filter and store the asset
            bool doRelease = m_assetLoadSemaphore.WaitOne(1000 * 10);

            if (!doRelease)
            {
                m_log.Error("Timed out waiting for the previous OAR asset load to complete");
            }

            m_scheduler.FireAndForget(
                delegate(object o)
            {
                try
                {
                    m_assetClient.StoreAsset(new Asset
                    {
                        ContentType  = LLUtil.LLAssetTypeToContentType((int)asset.AssetType),
                        CreationDate = DateTime.UtcNow,
                        CreatorID    = UUID.Zero,
                        Data         = asset.AssetData,
                        ID           = asset.AssetID
                    });

                    //m_log.DebugFormat("Loaded asset {0} ({1}), {2} bytes", asset.AssetID, asset.AssetType, asset.AssetData.Length);
                }
                finally
                {
                    if (doRelease)
                    {
                        m_assetLoadSemaphore.Release();
                    }
                }
            }, null
                );

            PrintProgress(bytesRead, totalBytes);
        }
예제 #2
0
 private void NullAssetLoadedHandler(OpenMetaverse.Assets.Asset asset, long bytesRead, long totalBytes)
 {
 }