mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Introduce an IteratingUuidGatherer where each fetch from the asset service (iteration) can be controlled by the caller.
This is to enable an imminent change where incoming HG scene object fetching can assess the time taken by each request rather than being forced to perform all requests in one call. Soon, this will replace the existing UuidGatherer since it is both simpler and more flexible.
This commit is contained in:
@@ -571,9 +571,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset server {2}",
|
||||
so.Name, so.AttachedAvatar, url);
|
||||
|
||||
Dictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
|
||||
HGUuidGatherer uuidGatherer = new HGUuidGatherer(Scene.AssetService, url);
|
||||
uuidGatherer.GatherAssetUuids(so, ids);
|
||||
IteratingHGUuidGatherer uuidGatherer = new IteratingHGUuidGatherer(Scene.AssetService, url);
|
||||
uuidGatherer.RecordAssetUuids(so);
|
||||
|
||||
// XXX: We will shortly use this iterating mechanism to check if a fetch is taking too long
|
||||
// but just for now we will simply fetch everything. If this was permanent could use
|
||||
// GatherAll()
|
||||
while (uuidGatherer.GatherNext())
|
||||
m_log.DebugFormat(
|
||||
"[HG ENTITY TRANSFER]: Gathered attachment {0} for HG user {1} with asset server {2}",
|
||||
so.Name, so.OwnerID, url);
|
||||
|
||||
IDictionary<UUID, sbyte> ids = uuidGatherer.GetGatheredUuids();
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset server {3}",
|
||||
ids.Count, so.Name, so.OwnerID, url);
|
||||
|
||||
foreach (KeyValuePair<UUID, sbyte> kvp in ids)
|
||||
uuidGatherer.FetchAsset(kvp.Key);
|
||||
|
||||
Reference in New Issue
Block a user