diff options
author | UbitUmarov | 2012-05-04 11:32:37 +0100 |
---|---|---|
committer | UbitUmarov | 2012-05-04 11:32:37 +0100 |
commit | 58a1a0710c971b83142bf21fa6259c95aa9d99dd (patch) | |
tree | da360e49c23c33e40c219eddd1af53c14247a3e3 /OpenSim/Region/Framework/Scenes | |
parent | Stabilize sit position on region crossing (diff) | |
download | opensim-SC-58a1a0710c971b83142bf21fa6259c95aa9d99dd.zip opensim-SC-58a1a0710c971b83142bf21fa6259c95aa9d99dd.tar.gz opensim-SC-58a1a0710c971b83142bf21fa6259c95aa9d99dd.tar.bz2 opensim-SC-58a1a0710c971b83142bf21fa6259c95aa9d99dd.tar.xz |
SOG copy bug fix, now new group has own empty list of sitted avatars. Also changed crossing code to restore sitting avas in case of group cross fail
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 66 |
1 files changed, 54 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8e1f447..7e6b077 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -465,7 +465,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
465 | { | 465 | { |
466 | return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); | 466 | return (IsAttachment || (m_rootPart.Shape.PCode == 9 && m_rootPart.Shape.State != 0)); |
467 | } | 467 | } |
468 | 468 | ||
469 | |||
470 | |||
471 | private struct avtocrossInfo | ||
472 | { | ||
473 | public ScenePresence av; | ||
474 | public uint ParentID; | ||
475 | } | ||
476 | |||
469 | /// <summary> | 477 | /// <summary> |
470 | /// The absolute position of this scene object in the scene | 478 | /// The absolute position of this scene object in the scene |
471 | /// </summary> | 479 | /// </summary> |
@@ -517,15 +525,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
517 | { | 525 | { |
518 | // We unparent the SP quietly so that it won't | 526 | // We unparent the SP quietly so that it won't |
519 | // be made to stand up | 527 | // be made to stand up |
528 | |||
529 | List<avtocrossInfo> avsToCross = new List<avtocrossInfo>(); | ||
530 | |||
520 | foreach (ScenePresence av in m_linkedAvatars) | 531 | foreach (ScenePresence av in m_linkedAvatars) |
521 | { | 532 | { |
533 | avtocrossInfo avinfo = new avtocrossInfo(); | ||
522 | SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID); | 534 | SceneObjectPart parentPart = m_scene.GetSceneObjectPart(av.ParentID); |
523 | if (parentPart != null) | 535 | if (parentPart != null) |
524 | av.ParentUUID = parentPart.UUID; | 536 | av.ParentUUID = parentPart.UUID; |
525 | 537 | ||
538 | avinfo.av = av; | ||
539 | avinfo.ParentID = av.ParentID; | ||
540 | avsToCross.Add(avinfo); | ||
541 | |||
526 | av.ParentID = 0; | 542 | av.ParentID = 0; |
527 | } | 543 | } |
528 | 544 | ||
545 | // m_linkedAvatars.Clear(); | ||
529 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); | 546 | m_scene.CrossPrimGroupIntoNewRegion(val, this, true); |
530 | 547 | ||
531 | // Normalize | 548 | // Normalize |
@@ -541,18 +558,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
541 | // If it's deleted, crossing was successful | 558 | // If it's deleted, crossing was successful |
542 | if (IsDeleted) | 559 | if (IsDeleted) |
543 | { | 560 | { |
544 | foreach (ScenePresence av in m_linkedAvatars) | 561 | // foreach (ScenePresence av in m_linkedAvatars) |
562 | foreach (avtocrossInfo avinfo in avsToCross) | ||
545 | { | 563 | { |
546 | m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); | 564 | ScenePresence av = avinfo.av; |
547 | 565 | if (!av.IsInTransit) // just in case... | |
548 | av.IsInTransit = true; | 566 | { |
549 | 567 | m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); | |
550 | CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; | 568 | |
551 | d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); | 569 | av.IsInTransit = true; |
570 | |||
571 | CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; | ||
572 | d.BeginInvoke(av, val, x, y, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); | ||
573 | } | ||
574 | else | ||
575 | m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar alreasy in transit {0} to {1}", av.Name, val); | ||
552 | } | 576 | } |
553 | 577 | avsToCross.Clear(); | |
554 | return; | 578 | return; |
555 | } | 579 | } |
580 | else // cross failed, put avas back ?? | ||
581 | { | ||
582 | foreach (avtocrossInfo avinfo in avsToCross) | ||
583 | { | ||
584 | ScenePresence av = avinfo.av; | ||
585 | av.ParentUUID = UUID.Zero; | ||
586 | av.ParentID = avinfo.ParentID; | ||
587 | // m_linkedAvatars.Add(av); | ||
588 | } | ||
589 | } | ||
590 | avsToCross.Clear(); | ||
591 | |||
556 | } | 592 | } |
557 | else if (RootPart.PhysActor != null) | 593 | else if (RootPart.PhysActor != null) |
558 | { | 594 | { |
@@ -565,6 +601,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
565 | val.Z = Util.Clamp<float>(oldp.Z, 0.5f, 4096.0f); | 601 | val.Z = Util.Clamp<float>(oldp.Z, 0.5f, 4096.0f); |
566 | } | 602 | } |
567 | } | 603 | } |
604 | |||
568 | /* don't see the need but worse don't see where is restored to false if things stay in | 605 | /* don't see the need but worse don't see where is restored to false if things stay in |
569 | foreach (SceneObjectPart part in m_parts.GetArray()) | 606 | foreach (SceneObjectPart part in m_parts.GetArray()) |
570 | { | 607 | { |
@@ -640,9 +677,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
640 | { | 677 | { |
641 | agent.ParentPart = null; | 678 | agent.ParentPart = null; |
642 | agent.ParentPosition = Vector3.Zero; | 679 | agent.ParentPosition = Vector3.Zero; |
680 | // agent.ParentUUID = UUID.Zero; | ||
643 | } | 681 | } |
644 | } | 682 | } |
645 | 683 | ||
684 | agent.ParentUUID = UUID.Zero; | ||
685 | |||
646 | // agent.Reset(); | 686 | // agent.Reset(); |
647 | // else // Not successful | 687 | // else // Not successful |
648 | // agent.RestoreInCurrentScene(); | 688 | // agent.RestoreInCurrentScene(); |
@@ -1779,15 +1819,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1779 | part.ClearUpdateSchedule(); | 1819 | part.ClearUpdateSchedule(); |
1780 | if (part == m_rootPart) | 1820 | if (part == m_rootPart) |
1781 | { | 1821 | { |
1782 | if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || | 1822 | if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || |
1783 | (AttachmentPoint < 31) || (AttachmentPoint > 38)) | 1823 | (AttachmentPoint < 31) || (AttachmentPoint > 38)) |
1784 | avatar.ControllingClient.SendKillObject(m_regionHandle, new List<uint> { part.LocalId }); | 1824 | avatar.ControllingClient.SendKillObject(m_regionHandle, new List<uint> { part.LocalId }); |
1785 | } | 1825 | } |
1786 | } | 1826 | } |
1787 | }); | 1827 | }); |
1788 | } | 1828 | } |
1789 | 1829 | ||
1790 | |||
1791 | } | 1830 | } |
1792 | 1831 | ||
1793 | public void AddScriptLPS(int count) | 1832 | public void AddScriptLPS(int count) |
@@ -2069,6 +2108,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2069 | dupe.m_isBackedUp = false; | 2108 | dupe.m_isBackedUp = false; |
2070 | dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>(); | 2109 | dupe.m_parts = new MapAndArray<OpenMetaverse.UUID, SceneObjectPart>(); |
2071 | 2110 | ||
2111 | // new group as no sitting avatars | ||
2112 | dupe.m_linkedAvatars = new List<ScenePresence>(); | ||
2113 | |||
2072 | // Warning, The following code related to previousAttachmentStatus is needed so that clones of | 2114 | // Warning, The following code related to previousAttachmentStatus is needed so that clones of |
2073 | // attachments do not bordercross while they're being duplicated. This is hacktastic! | 2115 | // attachments do not bordercross while they're being duplicated. This is hacktastic! |
2074 | // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region! | 2116 | // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region! |