aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-07 05:48:44 +0000
committerMelanie Thielker2008-11-07 05:48:44 +0000
commit48c6d052d94a7ab57c5264f09e989fa717c730f5 (patch)
tree2af23487a496bc60c0ca3839783e57bfac1ce3de /OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
parent* Fix half of the issue behind the long standing 'UseCircuitCode' packet spam... (diff)
downloadopensim-SC_OLD-48c6d052d94a7ab57c5264f09e989fa717c730f5.zip
opensim-SC_OLD-48c6d052d94a7ab57c5264f09e989fa717c730f5.tar.gz
opensim-SC_OLD-48c6d052d94a7ab57c5264f09e989fa717c730f5.tar.bz2
opensim-SC_OLD-48c6d052d94a7ab57c5264f09e989fa717c730f5.tar.xz
Attachments, attachments, and, did I say attachments?
Too many fixes to list.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs60
1 files changed, 40 insertions, 20 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 2f25478..a19564f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -227,7 +227,7 @@ namespace OpenSim.Region.Environment.Scenes
227 227
228 if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !IsAttachment) 228 if ((val.X > 257f || val.X < -1f || val.Y > 257f || val.Y < -1f) && !IsAttachment)
229 { 229 {
230 m_scene.CrossPrimGroupIntoNewRegion(val, this); 230 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
231 } 231 }
232 232
233 lock (m_parts) 233 lock (m_parts)
@@ -319,7 +319,7 @@ namespace OpenSim.Region.Environment.Scenes
319 { 319 {
320 m_isSelected = value; 320 m_isSelected = value;
321 // Tell physics engine that group is selected 321 // Tell physics engine that group is selected
322 if (m_rootPart.PhysActor != null) 322 if (m_rootPart != null && m_rootPart.PhysActor != null)
323 { 323 {
324 m_rootPart.PhysActor.Selected = value; 324 m_rootPart.PhysActor.Selected = value;
325 // Pass it on to the children. 325 // Pass it on to the children.
@@ -746,7 +746,7 @@ namespace OpenSim.Region.Environment.Scenes
746 /// <param name="agentID"></param> 746 /// <param name="agentID"></param>
747 /// <param name="attachmentpoint"></param> 747 /// <param name="attachmentpoint"></param>
748 /// <param name="AttachOffset"></param> 748 /// <param name="AttachOffset"></param>
749 public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset) 749 public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent)
750 { 750 {
751 ScenePresence avatar = m_scene.GetScenePresence(agentID); 751 ScenePresence avatar = m_scene.GetScenePresence(agentID);
752 if (avatar != null) 752 if (avatar != null)
@@ -777,19 +777,24 @@ namespace OpenSim.Region.Environment.Scenes
777 SetAttachmentPoint(Convert.ToByte(attachmentpoint)); 777 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
778 778
779 avatar.AddAttachment(this); 779 avatar.AddAttachment(this);
780 // Killing it here will cause the client to deselect it 780
781 // It then reappears on the avatar, deselected 781 if(!silent)
782 // through the full update below
783 //
784 if (IsSelected)
785 { 782 {
786 m_scene.SendKillObject(m_rootPart.LocalId); 783 // Killing it here will cause the client to deselect it
787 } 784 // It then reappears on the avatar, deselected
785 // through the full update below
786 //
787 if (IsSelected)
788 {
789 m_scene.SendKillObject(m_rootPart.LocalId);
790 }
788 791
789 IsSelected = false; // fudge.... 792 IsSelected = false; // fudge....
790 ScheduleGroupForFullUpdate(); 793 ScheduleGroupForFullUpdate();
794 }
791 } 795 }
792 } 796 }
797
793 public byte GetAttachmentPoint() 798 public byte GetAttachmentPoint()
794 { 799 {
795 if (m_rootPart != null) 800 if (m_rootPart != null)
@@ -994,7 +999,7 @@ namespace OpenSim.Region.Environment.Scenes
994 /// <summary> 999 /// <summary>
995 /// Delete this group from its scene and tell all the scene presences about that deletion. 1000 /// Delete this group from its scene and tell all the scene presences about that deletion.
996 /// </summary> 1001 /// </summary>
997 public void DeleteGroup() 1002 public void DeleteGroup(bool silent)
998 { 1003 {
999 // We need to keep track of this state in case this group is still queued for backup. 1004 // We need to keep track of this state in case this group is still queued for backup.
1000 // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race 1005 // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race
@@ -1018,8 +1023,11 @@ namespace OpenSim.Region.Environment.Scenes
1018 avatars[i].StandUp(); 1023 avatars[i].StandUp();
1019 } 1024 }
1020 1025
1021 if (m_rootPart != null && part == m_rootPart) 1026 if (!silent)
1022 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); 1027 {
1028 if (m_rootPart != null && part == m_rootPart)
1029 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
1030 }
1023 } 1031 }
1024 } 1032 }
1025 1033
@@ -1257,13 +1265,16 @@ namespace OpenSim.Region.Environment.Scenes
1257 1265
1258 #region Client Updating 1266 #region Client Updating
1259 1267
1260 public void SendFullUpdateToClient(IClientAPI remoteClient, uint clientFlags) 1268 public void SendFullUpdateToClient(IClientAPI remoteClient)
1261 { 1269 {
1270 SendPartFullUpdate(remoteClient, RootPart, m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
1271
1262 lock (m_parts) 1272 lock (m_parts)
1263 { 1273 {
1264 foreach (SceneObjectPart part in m_parts.Values) 1274 foreach (SceneObjectPart part in m_parts.Values)
1265 { 1275 {
1266 SendPartFullUpdate(remoteClient, part, clientFlags); 1276 if (part != RootPart)
1277 SendPartFullUpdate(remoteClient, part, m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(remoteClient.AgentId, part.UUID));
1267 } 1278 }
1268 } 1279 }
1269 } 1280 }
@@ -1626,11 +1637,14 @@ namespace OpenSim.Region.Environment.Scenes
1626 1637
1627 public void ScheduleFullUpdateToAvatar(ScenePresence presence) 1638 public void ScheduleFullUpdateToAvatar(ScenePresence presence)
1628 { 1639 {
1640 RootPart.AddFullUpdateToAvatar(presence);
1641
1629 lock (m_parts) 1642 lock (m_parts)
1630 { 1643 {
1631 foreach (SceneObjectPart part in m_parts.Values) 1644 foreach (SceneObjectPart part in m_parts.Values)
1632 { 1645 {
1633 part.AddFullUpdateToAvatar(presence); 1646 if (part != RootPart)
1647 part.AddFullUpdateToAvatar(presence);
1634 } 1648 }
1635 } 1649 }
1636 } 1650 }
@@ -1652,11 +1666,14 @@ namespace OpenSim.Region.Environment.Scenes
1652 public void ScheduleGroupForFullUpdate() 1666 public void ScheduleGroupForFullUpdate()
1653 { 1667 {
1654 checkAtTargets(); 1668 checkAtTargets();
1669 RootPart.ScheduleFullUpdate();
1670
1655 lock (m_parts) 1671 lock (m_parts)
1656 { 1672 {
1657 foreach (SceneObjectPart part in m_parts.Values) 1673 foreach (SceneObjectPart part in m_parts.Values)
1658 { 1674 {
1659 part.ScheduleFullUpdate(); 1675 if (part != RootPart)
1676 part.ScheduleFullUpdate();
1660 } 1677 }
1661 } 1678 }
1662 } 1679 }
@@ -1680,11 +1697,14 @@ namespace OpenSim.Region.Environment.Scenes
1680 /// </summary> 1697 /// </summary>
1681 public void SendGroupFullUpdate() 1698 public void SendGroupFullUpdate()
1682 { 1699 {
1700 RootPart.SendFullUpdateToAllClients();
1701
1683 lock (m_parts) 1702 lock (m_parts)
1684 { 1703 {
1685 foreach (SceneObjectPart part in m_parts.Values) 1704 foreach (SceneObjectPart part in m_parts.Values)
1686 { 1705 {
1687 part.SendFullUpdateToAllClients(); 1706 if (part != RootPart)
1707 part.SendFullUpdateToAllClients();
1688 } 1708 }
1689 } 1709 }
1690 } 1710 }