diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 118 |
1 files changed, 63 insertions, 55 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 7e356ea..97267c1 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -583,81 +583,89 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
583 | 583 | ||
584 | // foreign user | 584 | // foreign user |
585 | AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.OwnerID); | 585 | AgentCircuitData aCircuit = Scene.AuthenticateHandler.GetAgentCircuitData(so.OwnerID); |
586 | if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) | 586 | if (aCircuit != null) |
587 | { | 587 | { |
588 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) | 588 | if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) == 0) |
589 | { | 589 | { |
590 | m_incomingSceneObjectEngine.QueueRequest( | 590 | // We have already pulled the necessary attachments from the source grid. |
591 | string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), | 591 | base.HandleIncomingSceneObject(so, newPosition); |
592 | so.OwnerID.ToString(), | 592 | } |
593 | o => | 593 | else |
594 | { | 594 | { |
595 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | 595 | if (aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI")) |
596 | // m_log.DebugFormat( | 596 | { |
597 | // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", | 597 | m_incomingSceneObjectEngine.QueueRequest( |
598 | // so.Name, so.AttachedAvatar, url); | 598 | string.Format("HG UUID Gather for attachment {0} for {1}", so.Name, aCircuit.Name), |
599 | so.OwnerID.ToString(), | ||
600 | o => | ||
601 | { | ||
602 | string url = aCircuit.ServiceURLs["AssetServerURI"].ToString(); | ||
603 | // m_log.DebugFormat( | ||
604 | // "[HG ENTITY TRANSFER MODULE]: Incoming attachment {0} for HG user {1} with asset service {2}", | ||
605 | // so.Name, so.AttachedAvatar, url); | ||
599 | 606 | ||
600 | IteratingHGUuidGatherer uuidGatherer = new IteratingHGUuidGatherer(Scene.AssetService, url); | 607 | IteratingHGUuidGatherer uuidGatherer = new IteratingHGUuidGatherer(Scene.AssetService, url); |
601 | uuidGatherer.RecordAssetUuids(so); | 608 | uuidGatherer.RecordAssetUuids(so); |
602 | 609 | ||
603 | while (!uuidGatherer.Complete) | 610 | while (!uuidGatherer.Complete) |
604 | { | 611 | { |
605 | int tickStart = Util.EnvironmentTickCount(); | 612 | int tickStart = Util.EnvironmentTickCount(); |
606 | 613 | ||
607 | UUID? nextUuid = uuidGatherer.NextUuidToInspect; | 614 | UUID? nextUuid = uuidGatherer.NextUuidToInspect; |
608 | uuidGatherer.GatherNext(); | 615 | uuidGatherer.GatherNext(); |
609 | 616 | ||
610 | // m_log.DebugFormat( | 617 | // m_log.DebugFormat( |
611 | // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", | 618 | // "[HG ENTITY TRANSFER]: Gathered attachment asset uuid {0} for object {1} for HG user {2} took {3} ms with asset service {4}", |
612 | // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); | 619 | // nextUuid, so.Name, so.OwnerID, Util.EnvironmentTickCountSubtract(tickStart), url); |
613 | 620 | ||
614 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); | 621 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); |
615 | 622 | ||
616 | if (ticksElapsed > 30000) | 623 | if (ticksElapsed > 30000) |
617 | { | 624 | { |
618 | m_log.WarnFormat( | 625 | m_log.WarnFormat( |
619 | "[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)", | 626 | "[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)", |
620 | so.OwnerID, so.Name, url, ticksElapsed, 30000); | 627 | so.OwnerID, so.Name, url, ticksElapsed, 30000); |
621 | 628 | ||
622 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | 629 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); |
623 | 630 | ||
624 | return; | 631 | return; |
625 | } | 632 | } |
626 | } | 633 | } |
627 | 634 | ||
628 | IDictionary<UUID, sbyte> ids = uuidGatherer.GetGatheredUuids(); | 635 | IDictionary<UUID, sbyte> ids = uuidGatherer.GetGatheredUuids(); |
629 | 636 | ||
630 | // m_log.DebugFormat( | 637 | // m_log.DebugFormat( |
631 | // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", | 638 | // "[HG ENTITY TRANSFER]: Fetching {0} assets for attachment {1} for HG user {2} with asset service {3}", |
632 | // ids.Count, so.Name, so.OwnerID, url); | 639 | // ids.Count, so.Name, so.OwnerID, url); |
633 | 640 | ||
634 | foreach (KeyValuePair<UUID, sbyte> kvp in ids) | 641 | foreach (KeyValuePair<UUID, sbyte> kvp in ids) |
635 | { | 642 | { |
636 | int tickStart = Util.EnvironmentTickCount(); | 643 | int tickStart = Util.EnvironmentTickCount(); |
637 | 644 | ||
638 | uuidGatherer.FetchAsset(kvp.Key); | 645 | uuidGatherer.FetchAsset(kvp.Key); |
639 | 646 | ||
640 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); | 647 | int ticksElapsed = Util.EnvironmentTickCountSubtract(tickStart); |
641 | 648 | ||
642 | if (ticksElapsed > 30000) | 649 | if (ticksElapsed > 30000) |
643 | { | 650 | { |
644 | m_log.WarnFormat( | 651 | m_log.WarnFormat( |
645 | "[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)", | 652 | "[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)", |
646 | so.OwnerID, kvp.Key, url, ticksElapsed, 30000); | 653 | so.OwnerID, kvp.Key, url, ticksElapsed, 30000); |
647 | 654 | ||
648 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); | 655 | RemoveIncomingSceneObjectJobs(so.OwnerID.ToString()); |
649 | 656 | ||
650 | return; | 657 | return; |
651 | } | 658 | } |
652 | } | 659 | } |
653 | 660 | ||
654 | base.HandleIncomingSceneObject(so, newPosition); | 661 | base.HandleIncomingSceneObject(so, newPosition); |
655 | 662 | ||
656 | // m_log.DebugFormat( | 663 | // m_log.DebugFormat( |
657 | // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", | 664 | // "[HG ENTITY TRANSFER MODULE]: Completed incoming attachment {0} for HG user {1} with asset server {2}", |
658 | // so.Name, so.OwnerID, url); | 665 | // so.Name, so.OwnerID, url); |
659 | }, | 666 | }, |
660 | null); | 667 | null); |
668 | } | ||
661 | } | 669 | } |
662 | } | 670 | } |
663 | 671 | ||