aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-02-24 02:13:43 +0000
committerUbitUmarov2012-02-24 02:13:43 +0000
commit5145980c7432cfb7b42835e408015cd906c656b5 (patch)
tree5563d88e40cf2b0aded2c5f0ba44c46ff301d3cb
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parentPrevent a nullref when nonphysical motion objects cross sim boundaries (diff)
downloadopensim-SC_OLD-5145980c7432cfb7b42835e408015cd906c656b5.zip
opensim-SC_OLD-5145980c7432cfb7b42835e408015cd906c656b5.tar.gz
opensim-SC_OLD-5145980c7432cfb7b42835e408015cd906c656b5.tar.bz2
opensim-SC_OLD-5145980c7432cfb7b42835e408015cd906c656b5.tar.xz
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs28
4 files changed, 33 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 1ac3b76..f835e56 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3774,6 +3774,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3774 // doesn't seem to be attached, skip 3774 // doesn't seem to be attached, skip
3775 if (!found) 3775 if (!found)
3776 continue; 3776 continue;
3777
3778 // On vehicle crossing, the attachments are received
3779 // while the avatar is still a child. Don't send
3780 // updates here because the LocalId has not yet
3781 // been updated and the viewer will derender the
3782 // attachments until the avatar becomes root.
3783 if (sp.IsChildAgent)
3784 continue;
3777 } 3785 }
3778 if (part.ParentGroup.IsAttachment && m_disableFacelights) 3786 if (part.ParentGroup.IsAttachment && m_disableFacelights)
3779 { 3787 {
@@ -4837,7 +4845,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4837 if (part != null && part != part.ParentGroup.RootPart) 4845 if (part != null && part != part.ParentGroup.RootPart)
4838 { 4846 {
4839 position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset; 4847 position = part.OffsetPosition + presence.OffsetPosition * part.RotationOffset;
4840 rotation = presence.Rotation * part.RotationOffset; 4848 rotation = part.RotationOffset * presence.Rotation;
4841 } 4849 }
4842 } 4850 }
4843 4851
@@ -4966,7 +4974,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4966 if (part != null && part != part.ParentGroup.RootPart) 4974 if (part != null && part != part.ParentGroup.RootPart)
4967 { 4975 {
4968 offsetPosition = part.OffsetPosition + data.OffsetPosition * part.RotationOffset; 4976 offsetPosition = part.OffsetPosition + data.OffsetPosition * part.RotationOffset;
4969 rotation = data.Rotation * part.RotationOffset; 4977 rotation = part.RotationOffset * data.Rotation;
4970 parentID = part.ParentGroup.RootPart.LocalId; 4978 parentID = part.ParentGroup.RootPart.LocalId;
4971 } 4979 }
4972 } 4980 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b7162da..fcbed9f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5472,7 +5472,7 @@ Environment.Exit(1);
5472// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget); 5472// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
5473 5473
5474 Vector3 agent_control_v3 = new Vector3(); 5474 Vector3 agent_control_v3 = new Vector3();
5475 presence.HandleMoveToTargetUpdate(ref agent_control_v3); 5475 presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
5476 presence.AddNewMovement(agent_control_v3); 5476 presence.AddNewMovement(agent_control_v3);
5477 } 5477 }
5478 } 5478 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index cf8637f..248d4c6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -582,7 +582,7 @@ namespace OpenSim.Region.Framework.Scenes
582 foreach (ScenePresence av in m_linkedAvatars) 582 foreach (ScenePresence av in m_linkedAvatars)
583 { 583 {
584 SceneObjectPart p = m_scene.GetSceneObjectPart(av.ParentID); 584 SceneObjectPart p = m_scene.GetSceneObjectPart(av.ParentID);
585 if (m_parts.TryGetValue(p.UUID, out p)) 585 if (p != null && m_parts.TryGetValue(p.UUID, out p))
586 { 586 {
587 Vector3 offset = p.GetWorldPosition() - av.ParentPosition; 587 Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
588 av.AbsolutePosition += offset; 588 av.AbsolutePosition += offset;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a3839c2..26fa6c0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -874,6 +874,8 @@ namespace OpenSim.Region.Framework.Scenes
874 "[SCENE]: Upgrading child to root agent for {0} in {1}", 874 "[SCENE]: Upgrading child to root agent for {0} in {1}",
875 Name, m_scene.RegionInfo.RegionName); 875 Name, m_scene.RegionInfo.RegionName);
876 876
877 bool wasChild = IsChildAgent;
878
877 if (ParentUUID != UUID.Zero) 879 if (ParentUUID != UUID.Zero)
878 { 880 {
879 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID); 881 m_log.DebugFormat("[SCENE PRESENCE]: Sitting avatar back on prim {0}", ParentUUID);
@@ -893,10 +895,16 @@ namespace OpenSim.Region.Framework.Scenes
893 pos = ParentPosition; 895 pos = ParentPosition;
894 } 896 }
895 ParentUUID = UUID.Zero; 897 ParentUUID = UUID.Zero;
898
899 IsChildAgent = false;
900
901 Animator.TrySetMovementAnimation("SIT");
902 }
903 else
904 {
905 IsChildAgent = false;
896 } 906 }
897 907
898 bool wasChild = IsChildAgent;
899 IsChildAgent = false;
900 908
901 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 909 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
902 if (gm != null) 910 if (gm != null)
@@ -984,6 +992,7 @@ namespace OpenSim.Region.Framework.Scenes
984 Util.FireAndForget(delegate(object x) { 992 Util.FireAndForget(delegate(object x) {
985 foreach (SceneObjectGroup sog in m_attachments) 993 foreach (SceneObjectGroup sog in m_attachments)
986 { 994 {
995 sog.ScheduleGroupForFullUpdate();
987 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); 996 sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
988 sog.ResumeScripts(); 997 sog.ResumeScripts();
989 } 998 }
@@ -991,6 +1000,8 @@ namespace OpenSim.Region.Framework.Scenes
991 } 1000 }
992 } 1001 }
993 1002
1003 SendAvatarDataToAllAgents();
1004
994 // send the animations of the other presences to me 1005 // send the animations of the other presences to me
995 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence) 1006 m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
996 { 1007 {
@@ -1084,7 +1095,7 @@ namespace OpenSim.Region.Framework.Scenes
1084 } 1095 }
1085 1096
1086 /// <summary> 1097 /// <summary>
1087 /// 1098 /// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
1088 /// </summary> 1099 /// </summary>
1089 /// <param name="pos"></param> 1100 /// <param name="pos"></param>
1090 public void Teleport(Vector3 pos) 1101 public void Teleport(Vector3 pos)
@@ -1558,7 +1569,10 @@ namespace OpenSim.Region.Framework.Scenes
1558 } 1569 }
1559 else if (bAllowUpdateMoveToPosition) 1570 else if (bAllowUpdateMoveToPosition)
1560 { 1571 {
1561 if (HandleMoveToTargetUpdate(ref agent_control_v3)) 1572 // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
1573 // certain position. It's only check for tolerance on returning to that position is 0.2
1574 // rather than 1, at which point it removes its force target.
1575 if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
1562 update_movementflag = true; 1576 update_movementflag = true;
1563 } 1577 }
1564 } 1578 }
@@ -1620,7 +1634,7 @@ namespace OpenSim.Region.Framework.Scenes
1620 /// </remarks> 1634 /// </remarks>
1621 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param> 1635 /// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
1622 /// <returns>True if movement has been updated in some way. False otherwise.</returns> 1636 /// <returns>True if movement has been updated in some way. False otherwise.</returns>
1623 public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3) 1637 public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
1624 { 1638 {
1625// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name); 1639// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
1626 1640
@@ -1637,7 +1651,7 @@ namespace OpenSim.Region.Framework.Scenes
1637// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); 1651// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
1638 1652
1639 // Check the error term of the current position in relation to the target position 1653 // Check the error term of the current position in relation to the target position
1640 if (distanceToTarget <= 1) 1654 if (distanceToTarget <= tolerance)
1641 { 1655 {
1642 // We are close enough to the target 1656 // We are close enough to the target
1643 AbsolutePosition = MoveToPositionTarget; 1657 AbsolutePosition = MoveToPositionTarget;
@@ -1813,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes
1813// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation); 1827// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
1814 1828
1815 Vector3 agent_control_v3 = new Vector3(); 1829 Vector3 agent_control_v3 = new Vector3();
1816 HandleMoveToTargetUpdate(ref agent_control_v3); 1830 HandleMoveToTargetUpdate(1, ref agent_control_v3);
1817 AddNewMovement(agent_control_v3); 1831 AddNewMovement(agent_control_v3);
1818 } 1832 }
1819 1833