aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorMelanie2010-03-04 11:02:01 +0000
committerMelanie2010-03-04 11:02:01 +0000
commit107a0a49053e5c6776ab81ca6120bf24f0441c8e (patch)
tree85f74d8519d6c148ce3371bfd66da34c044f1dc3 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-107a0a49053e5c6776ab81ca6120bf24f0441c8e.zip
opensim-SC-107a0a49053e5c6776ab81ca6120bf24f0441c8e.tar.gz
opensim-SC-107a0a49053e5c6776ab81ca6120bf24f0441c8e.tar.bz2
opensim-SC-107a0a49053e5c6776ab81ca6120bf24f0441c8e.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs95
1 files changed, 39 insertions, 56 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2a4e5a2..8c5a9a6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -488,8 +488,8 @@ namespace OpenSim.Region.Framework.Scenes
488 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>(); 488 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
489 public List<SceneObjectPart> PlaySoundSlavePrims 489 public List<SceneObjectPart> PlaySoundSlavePrims
490 { 490 {
491 get { return m_LoopSoundSlavePrims; } 491 get { return m_PlaySoundSlavePrims; }
492 set { m_LoopSoundSlavePrims = value; } 492 set { m_PlaySoundSlavePrims = value; }
493 } 493 }
494 494
495 private SceneObjectPart m_LoopSoundMasterPrim = null; 495 private SceneObjectPart m_LoopSoundMasterPrim = null;
@@ -641,8 +641,10 @@ namespace OpenSim.Region.Framework.Scenes
641 } 641 }
642 642
643 ApplyPhysics(m_scene.m_physicalPrim); 643 ApplyPhysics(m_scene.m_physicalPrim);
644 644
645 ScheduleGroupForFullUpdate(); 645 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
646 // for the same object with very different properties. The caller must schedule the update.
647 //ScheduleGroupForFullUpdate();
646 } 648 }
647 649
648 public Vector3 GroupScale() 650 public Vector3 GroupScale()
@@ -1044,10 +1046,11 @@ namespace OpenSim.Region.Framework.Scenes
1044 // don't attach attachments to child agents 1046 // don't attach attachments to child agents
1045 if (avatar.IsChildAgent) return; 1047 if (avatar.IsChildAgent) return;
1046 1048
1049// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
1050
1047 DetachFromBackup(); 1051 DetachFromBackup();
1048 1052
1049 // Remove from database and parcel prim count 1053 // Remove from database and parcel prim count
1050 //
1051 m_scene.DeleteFromStorage(UUID); 1054 m_scene.DeleteFromStorage(UUID);
1052 m_scene.EventManager.TriggerParcelPrimCountTainted(); 1055 m_scene.EventManager.TriggerParcelPrimCountTainted();
1053 1056
@@ -1073,7 +1076,6 @@ namespace OpenSim.Region.Framework.Scenes
1073 SetAttachmentPoint(Convert.ToByte(attachmentpoint)); 1076 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
1074 1077
1075 avatar.AddAttachment(this); 1078 avatar.AddAttachment(this);
1076 m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
1077 1079
1078 if (!silent) 1080 if (!silent)
1079 { 1081 {
@@ -1090,6 +1092,12 @@ namespace OpenSim.Region.Framework.Scenes
1090 ScheduleGroupForFullUpdate(); 1092 ScheduleGroupForFullUpdate();
1091 } 1093 }
1092 } 1094 }
1095 else
1096 {
1097 m_log.WarnFormat(
1098 "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
1099 UUID, agentID, Scene.RegionInfo.RegionName);
1100 }
1093 } 1101 }
1094 1102
1095 public byte GetAttachmentPoint() 1103 public byte GetAttachmentPoint()
@@ -1596,11 +1604,10 @@ namespace OpenSim.Region.Framework.Scenes
1596 1604
1597 #endregion 1605 #endregion
1598 1606
1599 #region Client Updating
1600
1601 public void SendFullUpdateToClient(IClientAPI remoteClient) 1607 public void SendFullUpdateToClient(IClientAPI remoteClient)
1602 { 1608 {
1603 SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); 1609 RootPart.SendFullUpdate(
1610 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
1604 1611
1605 lockPartsForRead(true); 1612 lockPartsForRead(true);
1606 { 1613 {
@@ -1608,42 +1615,12 @@ namespace OpenSim.Region.Framework.Scenes
1608 { 1615 {
1609 1616
1610 if (part != RootPart) 1617 if (part != RootPart)
1611 SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); 1618 part.SendFullUpdate(
1612 1619 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
1613 } 1620 }
1614 } 1621 }
1615 lockPartsForRead(false);
1616 } 1622 }
1617 1623
1618 /// <summary>
1619 /// Send a full update to the client for the given part
1620 /// </summary>
1621 /// <param name="remoteClient"></param>
1622 /// <param name="part"></param>
1623 internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
1624 {
1625// m_log.DebugFormat(
1626// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
1627
1628 if (m_rootPart.UUID == part.UUID)
1629 {
1630 if (IsAttachment)
1631 {
1632 part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags);
1633 }
1634 else
1635 {
1636 part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
1637 }
1638 }
1639 else
1640 {
1641 part.SendFullUpdateToClient(remoteClient, clientFlags);
1642 }
1643 }
1644
1645 #endregion
1646
1647 #region Copying 1624 #region Copying
1648 1625
1649 /// <summary> 1626 /// <summary>
@@ -2108,6 +2085,8 @@ namespace OpenSim.Region.Framework.Scenes
2108 2085
2109 public void ScheduleFullUpdateToAvatar(ScenePresence presence) 2086 public void ScheduleFullUpdateToAvatar(ScenePresence presence)
2110 { 2087 {
2088// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
2089
2111 RootPart.AddFullUpdateToAvatar(presence); 2090 RootPart.AddFullUpdateToAvatar(presence);
2112 2091
2113 lockPartsForRead(true); 2092 lockPartsForRead(true);
@@ -2126,14 +2105,12 @@ namespace OpenSim.Region.Framework.Scenes
2126 public void ScheduleTerseUpdateToAvatar(ScenePresence presence) 2105 public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
2127 { 2106 {
2128 lockPartsForRead(true); 2107 lockPartsForRead(true);
2108
2109 foreach (SceneObjectPart part in m_parts.Values)
2129 { 2110 {
2130 foreach (SceneObjectPart part in m_parts.Values) 2111 part.AddTerseUpdateToAvatar(presence);
2131 {
2132
2133 part.AddTerseUpdateToAvatar(presence);
2134
2135 }
2136 } 2112 }
2113
2137 lockPartsForRead(false); 2114 lockPartsForRead(false);
2138 } 2115 }
2139 2116
@@ -2142,6 +2119,8 @@ namespace OpenSim.Region.Framework.Scenes
2142 /// </summary> 2119 /// </summary>
2143 public void ScheduleGroupForFullUpdate() 2120 public void ScheduleGroupForFullUpdate()
2144 { 2121 {
2122// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
2123
2145 checkAtTargets(); 2124 checkAtTargets();
2146 RootPart.ScheduleFullUpdate(); 2125 RootPart.ScheduleFullUpdate();
2147 2126
@@ -2164,14 +2143,12 @@ namespace OpenSim.Region.Framework.Scenes
2164 public void ScheduleGroupForTerseUpdate() 2143 public void ScheduleGroupForTerseUpdate()
2165 { 2144 {
2166 lockPartsForRead(true); 2145 lockPartsForRead(true);
2146
2147 foreach (SceneObjectPart part in m_parts.Values)
2167 { 2148 {
2168 foreach (SceneObjectPart part in m_parts.Values) 2149 part.ScheduleTerseUpdate();
2169 {
2170
2171 part.ScheduleTerseUpdate();
2172
2173 }
2174 } 2150 }
2151
2175 lockPartsForRead(false); 2152 lockPartsForRead(false);
2176 } 2153 }
2177 2154
@@ -2179,9 +2156,11 @@ namespace OpenSim.Region.Framework.Scenes
2179 /// Immediately send a full update for this scene object. 2156 /// Immediately send a full update for this scene object.
2180 /// </summary> 2157 /// </summary>
2181 public void SendGroupFullUpdate() 2158 public void SendGroupFullUpdate()
2182 { 2159 {
2183 if (IsDeleted) 2160 if (IsDeleted)
2184 return; 2161 return;
2162
2163// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
2185 2164
2186 RootPart.SendFullUpdateToAllClients(); 2165 RootPart.SendFullUpdateToAllClients();
2187 2166
@@ -2201,7 +2180,7 @@ namespace OpenSim.Region.Framework.Scenes
2201 /// <summary> 2180 /// <summary>
2202 /// Immediately send an update for this scene object's root prim only. 2181 /// Immediately send an update for this scene object's root prim only.
2203 /// This is for updates regarding the object as a whole, and none of its parts in particular. 2182 /// This is for updates regarding the object as a whole, and none of its parts in particular.
2204 /// Note: this may not be cused by opensim (it probably should) but it's used by 2183 /// Note: this may not be used by opensim (it probably should) but it's used by
2205 /// external modules. 2184 /// external modules.
2206 /// </summary> 2185 /// </summary>
2207 public void SendGroupRootTerseUpdate() 2186 public void SendGroupRootTerseUpdate()
@@ -2216,6 +2195,7 @@ namespace OpenSim.Region.Framework.Scenes
2216 { 2195 {
2217 if (m_scene == null) // Need to check here as it's null during object creation 2196 if (m_scene == null) // Need to check here as it's null during object creation
2218 return; 2197 return;
2198
2219 m_scene.SceneGraph.AddToUpdateList(this); 2199 m_scene.SceneGraph.AddToUpdateList(this);
2220 } 2200 }
2221 2201
@@ -3718,7 +3698,10 @@ namespace OpenSim.Region.Framework.Scenes
3718 HasGroupChanged = true; 3698 HasGroupChanged = true;
3719 } 3699 }
3720 lockPartsForRead(false); 3700 lockPartsForRead(false);
3721 ScheduleGroupForFullUpdate(); 3701
3702 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
3703 // for the same object with very different properties. The caller must schedule the update.
3704 //ScheduleGroupForFullUpdate();
3722 } 3705 }
3723 3706
3724 public void TriggerScriptChangedEvent(Changed val) 3707 public void TriggerScriptChangedEvent(Changed val)