avoid ethernal references

master
UbitUmarov 2020-07-23 19:39:45 +01:00
parent c077cfdd78
commit 6fafb7462d
1 changed files with 18 additions and 17 deletions

View File

@ -642,12 +642,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!so.IsAttachmentCheckFull()) if (!so.IsAttachmentCheckFull())
return base.HandleIncomingSceneObject(so, newPosition); return base.HandleIncomingSceneObject(so, newPosition);
UUID OwnerID = so.OwnerID;
// Equally, we can't use so.AttachedAvatar here. // Equally, we can't use so.AttachedAvatar here.
if (so.OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(so.OwnerID)) if (OwnerID == UUID.Zero || Scene.UserManagementModule.IsLocalGridUser(OwnerID))
return base.HandleIncomingSceneObject(so, newPosition); return base.HandleIncomingSceneObject(so, newPosition);
// foreign user // foreign user
AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.OwnerID); AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(OwnerID);
if (aCircuit != null) if (aCircuit != null)
{ {
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) == 0) if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) == 0)
@ -659,8 +660,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{ {
if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
{ {
SceneObjectGroup defso = so;
m_incomingSceneObjectEngine.QueueJob( m_incomingSceneObjectEngine.QueueJob(
string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), string.Format("HG UUID Gather for attachment {0} for {1}", defso.Name, aCircuit.Name),
() => () =>
{ {
string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); string url = aCircuit.ServiceURLs["AssetServerURI"].ToString();
@ -669,15 +671,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// so.Name, so.AttachedAvatar, url); // so.Name, so.AttachedAvatar, url);
IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>(); IDictionary<UUID, sbyte> ids = new Dictionary<UUID, sbyte>();
HGUuidGatherer uuidGatherer HGUuidGatherer uuidGatherer = new HGUuidGatherer(Scene.AssetService, url, ids);
= new HGUuidGatherer(Scene.AssetService, url, ids); uuidGatherer.AddForInspection(defso);
uuidGatherer.AddForInspection(so);
while (!uuidGatherer.Complete) while (!uuidGatherer.Complete)
{ {
int tickStart = Util.EnvironmentTickCount(); int tickStart = Util.EnvironmentTickCount();
UUID? nextUuid = uuidGatherer.NextUuidToInspect;
uuidGatherer.GatherNext(); uuidGatherer.GatherNext();
// m_log.DebugFormat( // m_log.DebugFormat(
@ -692,8 +691,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as gather of {1} from {2} took {3} ms to respond (> {4} ms)", "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as gather of {1} from {2} took {3} ms to respond (> {4} ms)",
so.OwnerID, so.Name, url, ticksElapsed, 30000); so.OwnerID, so.Name, url, ticksElapsed, 30000);
RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); RemoveIncomingSceneObjectJobs(OwnerID.ToString());
return; return;
} }
} }
@ -702,11 +700,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}",
// ids.Count, so.Name, so.OwnerID, url); // ids.Count, so.Name, so.OwnerID, url);
foreach (KeyValuePair<UUID, sbyte> kvp in ids) foreach (UUID id in ids.Keys)
{ {
int tickStart = Util.EnvironmentTickCount(); int tickStart = Util.EnvironmentTickCount();
uuidGatherer.FetchAsset(kvp.Key); uuidGatherer.FetchAsset(id);
int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart);
@ -714,21 +712,24 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as fetch of {1} from {2} took {3} ms to respond (> {4} ms)", "[HG ENTITY TRANSFER]: Removing incoming scene object jobs for HG user {0} as fetch of {1} from {2} took {3} ms to respond (> {4} ms)",
so.OwnerID, kvp.Key, url, ticksElapsed, 30000); so.OwnerID, id, url, ticksElapsed, 30000);
RemoveIncomingSceneObjectJobs(so.OwnerID.ToString());
RemoveIncomingSceneObjectJobs(OwnerID.ToString());
return; return;
} }
} }
base.HandleIncomingSceneObject(so, newPosition); base.HandleIncomingSceneObject(defso, newPosition);
defso = null;
aCircuit = null;
uuidGatherer = null;
// m_log.DebugFormat( // m_log.DebugFormat(
// "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}",
// so.Name, so.OwnerID, url); // so.Name, so.OwnerID, url);
}, },
so.OwnerID.ToString()); OwnerID.ToString());
} }
} }
} }