aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-10 05:21:51 +0000
committerMelanie Thielker2008-11-10 05:21:51 +0000
commitfc6f3edec60c391bbd986ee021bff0e5fa4991c0 (patch)
treedf3c3704c39be31cd314918d8fa52dc344978f11 /OpenSim/Region
parentThank you, idb, for a patch that fixes avatar height calculation (diff)
downloadopensim-SC_OLD-fc6f3edec60c391bbd986ee021bff0e5fa4991c0.zip
opensim-SC_OLD-fc6f3edec60c391bbd986ee021bff0e5fa4991c0.tar.gz
opensim-SC_OLD-fc6f3edec60c391bbd986ee021bff0e5fa4991c0.tar.bz2
opensim-SC_OLD-fc6f3edec60c391bbd986ee021bff0e5fa4991c0.tar.xz
Stop attachments from causing an update to be sent on every frame in which
an avatar moves.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs6
4 files changed, 13 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index b0bac42..ff4abc7 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -2356,9 +2356,9 @@ namespace OpenSim.Region.Environment.Scenes
2356 return att.UUID; 2356 return att.UUID;
2357 } 2357 }
2358 2358
2359 public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos) 2359 public void AttachObject(IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent)
2360 { 2360 {
2361 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, false); 2361 m_innerScene.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
2362 } 2362 }
2363 2363
2364 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 2364 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 62e6691..6634028 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2042,6 +2042,7 @@ namespace OpenSim.Region.Environment.Scenes
2042 public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent) 2042 public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent)
2043 { 2043 {
2044 bool successYN = false; 2044 bool successYN = false;
2045 grp.RootPart.UpdateFlag = 0;
2045 int primcrossingXMLmethod = 0; 2046 int primcrossingXMLmethod = 0;
2046 2047
2047 if (newRegionHandle != 0) 2048 if (newRegionHandle != 0)
@@ -2139,7 +2140,7 @@ namespace OpenSim.Region.Environment.Scenes
2139 2140
2140 grp.SetFromAssetID(grp.RootPart.LastOwnerID); 2141 grp.SetFromAssetID(grp.RootPart.LastOwnerID);
2141 m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString()); 2142 m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString());
2142 AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition); 2143 AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
2143 } 2144 }
2144 else 2145 else
2145 { 2146 {
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index a59047b..c17e4a7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1575,6 +1575,8 @@ namespace OpenSim.Region.Environment.Scenes
1575 1575
1576 lock (m_parts) 1576 lock (m_parts)
1577 { 1577 {
1578 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
1579
1578 //if (IsAttachment) 1580 //if (IsAttachment)
1579 //{ 1581 //{
1580 //foreach (SceneObjectPart part in m_parts.Values) 1582 //foreach (SceneObjectPart part in m_parts.Values)
@@ -1584,7 +1586,7 @@ namespace OpenSim.Region.Environment.Scenes
1584 //return; 1586 //return;
1585 //} 1587 //}
1586 1588
1587 if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) 1589 if ((Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) && UsePhysics)
1588 { 1590 {
1589 m_rootPart.UpdateFlag = 1; 1591 m_rootPart.UpdateFlag = 1;
1590 lastPhysGroupPos = AbsolutePosition; 1592 lastPhysGroupPos = AbsolutePosition;
@@ -1596,10 +1598,11 @@ namespace OpenSim.Region.Environment.Scenes
1596 1598
1597 checkAtTargets(); 1599 checkAtTargets();
1598 1600
1599 if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) 1601 if (((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1)
1600 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) 1602 || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1)
1601 || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) 1603 || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1)
1602 || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) 1604 || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))
1605 && UsePhysics)
1603 { 1606 {
1604 m_rootPart.UpdateFlag = 1; 1607 m_rootPart.UpdateFlag = 1;
1605 1608
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index b90dd72..0efe6e1 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -646,7 +646,8 @@ namespace OpenSim.Region.Environment.Scenes
646 // We deal with the possibility that two updates occur at 646 // We deal with the possibility that two updates occur at
647 // the same unix time at the update point itself. 647 // the same unix time at the update point itself.
648 648
649 if (update.LastFullUpdateTime < part.TimeStampFull) 649 if ((update.LastFullUpdateTime < part.TimeStampFull) ||
650 part.IsAttachment)
650 { 651 {
651// m_log.DebugFormat( 652// m_log.DebugFormat(
652// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}", 653// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
@@ -693,6 +694,7 @@ namespace OpenSim.Region.Environment.Scenes
693 if (part != part.ParentGroup.RootPart) 694 if (part != part.ParentGroup.RootPart)
694 continue; 695 continue;
695 696
697 System.Threading.Thread.Sleep(1000);
696 part.ParentGroup.SendFullUpdateToClient(ControllingClient); 698 part.ParentGroup.SendFullUpdateToClient(ControllingClient);
697 continue; 699 continue;
698 } 700 }
@@ -3184,7 +3186,7 @@ namespace OpenSim.Region.Environment.Scenes
3184 { 3186 {
3185 // Attach from world, if not already attached 3187 // Attach from world, if not already attached
3186 if (att.ParentGroup != null && !att.IsAttachment) 3188 if (att.ParentGroup != null && !att.IsAttachment)
3187 m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero); 3189 m_scene.AttachObject(ControllingClient, att.ParentGroup.LocalId, (uint)0, att.ParentGroup.GroupRotation, Vector3.Zero, false);
3188 } 3190 }
3189 catch (NullReferenceException) 3191 catch (NullReferenceException)
3190 { 3192 {