diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 98 |
1 files changed, 41 insertions, 57 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5443c28..6c4b39d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -377,6 +377,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
377 | RootPart.ScriptSetPhysicsStatus(false); | 377 | RootPart.ScriptSetPhysicsStatus(false); |
378 | Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), | 378 | Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), |
379 | ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); | 379 | ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); |
380 | lockPartsForRead(false); | ||
380 | return; | 381 | return; |
381 | } | 382 | } |
382 | } | 383 | } |
@@ -489,8 +490,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
489 | private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>(); | 490 | private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>(); |
490 | public List<SceneObjectPart> PlaySoundSlavePrims | 491 | public List<SceneObjectPart> PlaySoundSlavePrims |
491 | { | 492 | { |
492 | get { return m_LoopSoundSlavePrims; } | 493 | get { return m_PlaySoundSlavePrims; } |
493 | set { m_LoopSoundSlavePrims = value; } | 494 | set { m_PlaySoundSlavePrims = value; } |
494 | } | 495 | } |
495 | 496 | ||
496 | private SceneObjectPart m_LoopSoundMasterPrim = null; | 497 | private SceneObjectPart m_LoopSoundMasterPrim = null; |
@@ -642,8 +643,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
642 | } | 643 | } |
643 | 644 | ||
644 | ApplyPhysics(m_scene.m_physicalPrim); | 645 | ApplyPhysics(m_scene.m_physicalPrim); |
645 | 646 | ||
646 | ScheduleGroupForFullUpdate(); | 647 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled |
648 | // for the same object with very different properties. The caller must schedule the update. | ||
649 | //ScheduleGroupForFullUpdate(); | ||
647 | } | 650 | } |
648 | 651 | ||
649 | public Vector3 GroupScale() | 652 | public Vector3 GroupScale() |
@@ -1045,10 +1048,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1045 | // don't attach attachments to child agents | 1048 | // don't attach attachments to child agents |
1046 | if (avatar.IsChildAgent) return; | 1049 | if (avatar.IsChildAgent) return; |
1047 | 1050 | ||
1051 | // m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name); | ||
1052 | |||
1048 | DetachFromBackup(); | 1053 | DetachFromBackup(); |
1049 | 1054 | ||
1050 | // Remove from database and parcel prim count | 1055 | // Remove from database and parcel prim count |
1051 | // | ||
1052 | m_scene.DeleteFromStorage(UUID); | 1056 | m_scene.DeleteFromStorage(UUID); |
1053 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | 1057 | m_scene.EventManager.TriggerParcelPrimCountTainted(); |
1054 | 1058 | ||
@@ -1074,7 +1078,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1074 | SetAttachmentPoint(Convert.ToByte(attachmentpoint)); | 1078 | SetAttachmentPoint(Convert.ToByte(attachmentpoint)); |
1075 | 1079 | ||
1076 | avatar.AddAttachment(this); | 1080 | avatar.AddAttachment(this); |
1077 | m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID); | ||
1078 | 1081 | ||
1079 | if (!silent) | 1082 | if (!silent) |
1080 | { | 1083 | { |
@@ -1091,6 +1094,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1091 | ScheduleGroupForFullUpdate(); | 1094 | ScheduleGroupForFullUpdate(); |
1092 | } | 1095 | } |
1093 | } | 1096 | } |
1097 | else | ||
1098 | { | ||
1099 | m_log.WarnFormat( | ||
1100 | "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present", | ||
1101 | UUID, agentID, Scene.RegionInfo.RegionName); | ||
1102 | } | ||
1094 | } | 1103 | } |
1095 | 1104 | ||
1096 | public byte GetAttachmentPoint() | 1105 | public byte GetAttachmentPoint() |
@@ -1597,11 +1606,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1597 | 1606 | ||
1598 | #endregion | 1607 | #endregion |
1599 | 1608 | ||
1600 | #region Client Updating | ||
1601 | |||
1602 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 1609 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
1603 | { | 1610 | { |
1604 | SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); | 1611 | RootPart.SendFullUpdate( |
1612 | remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); | ||
1605 | 1613 | ||
1606 | lockPartsForRead(true); | 1614 | lockPartsForRead(true); |
1607 | { | 1615 | { |
@@ -1609,42 +1617,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1609 | { | 1617 | { |
1610 | 1618 | ||
1611 | if (part != RootPart) | 1619 | if (part != RootPart) |
1612 | SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); | 1620 | part.SendFullUpdate( |
1613 | 1621 | remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); | |
1614 | } | ||
1615 | } | ||
1616 | lockPartsForRead(false); | ||
1617 | } | ||
1618 | |||
1619 | /// <summary> | ||
1620 | /// Send a full update to the client for the given part | ||
1621 | /// </summary> | ||
1622 | /// <param name="remoteClient"></param> | ||
1623 | /// <param name="part"></param> | ||
1624 | internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags) | ||
1625 | { | ||
1626 | // m_log.DebugFormat( | ||
1627 | // "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId); | ||
1628 | |||
1629 | if (m_rootPart.UUID == part.UUID) | ||
1630 | { | ||
1631 | if (IsAttachment) | ||
1632 | { | ||
1633 | part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags); | ||
1634 | } | ||
1635 | else | ||
1636 | { | ||
1637 | part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); | ||
1638 | } | 1622 | } |
1639 | } | 1623 | } |
1640 | else | ||
1641 | { | ||
1642 | part.SendFullUpdateToClient(remoteClient, clientFlags); | ||
1643 | } | ||
1644 | } | 1624 | } |
1645 | 1625 | ||
1646 | #endregion | ||
1647 | |||
1648 | #region Copying | 1626 | #region Copying |
1649 | 1627 | ||
1650 | /// <summary> | 1628 | /// <summary> |
@@ -2136,6 +2114,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2136 | 2114 | ||
2137 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) | 2115 | public void ScheduleFullUpdateToAvatar(ScenePresence presence) |
2138 | { | 2116 | { |
2117 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); | ||
2118 | |||
2139 | RootPart.AddFullUpdateToAvatar(presence); | 2119 | RootPart.AddFullUpdateToAvatar(presence); |
2140 | 2120 | ||
2141 | lockPartsForRead(true); | 2121 | lockPartsForRead(true); |
@@ -2154,14 +2134,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2154 | public void ScheduleTerseUpdateToAvatar(ScenePresence presence) | 2134 | public void ScheduleTerseUpdateToAvatar(ScenePresence presence) |
2155 | { | 2135 | { |
2156 | lockPartsForRead(true); | 2136 | lockPartsForRead(true); |
2137 | |||
2138 | foreach (SceneObjectPart part in m_parts.Values) | ||
2157 | { | 2139 | { |
2158 | foreach (SceneObjectPart part in m_parts.Values) | 2140 | part.AddTerseUpdateToAvatar(presence); |
2159 | { | ||
2160 | |||
2161 | part.AddTerseUpdateToAvatar(presence); | ||
2162 | |||
2163 | } | ||
2164 | } | 2141 | } |
2142 | |||
2165 | lockPartsForRead(false); | 2143 | lockPartsForRead(false); |
2166 | } | 2144 | } |
2167 | 2145 | ||
@@ -2170,6 +2148,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2170 | /// </summary> | 2148 | /// </summary> |
2171 | public void ScheduleGroupForFullUpdate() | 2149 | public void ScheduleGroupForFullUpdate() |
2172 | { | 2150 | { |
2151 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID); | ||
2152 | |||
2173 | checkAtTargets(); | 2153 | checkAtTargets(); |
2174 | RootPart.ScheduleFullUpdate(); | 2154 | RootPart.ScheduleFullUpdate(); |
2175 | 2155 | ||
@@ -2192,14 +2172,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2192 | public void ScheduleGroupForTerseUpdate() | 2172 | public void ScheduleGroupForTerseUpdate() |
2193 | { | 2173 | { |
2194 | lockPartsForRead(true); | 2174 | lockPartsForRead(true); |
2175 | |||
2176 | foreach (SceneObjectPart part in m_parts.Values) | ||
2195 | { | 2177 | { |
2196 | foreach (SceneObjectPart part in m_parts.Values) | 2178 | part.ScheduleTerseUpdate(); |
2197 | { | ||
2198 | |||
2199 | part.ScheduleTerseUpdate(); | ||
2200 | |||
2201 | } | ||
2202 | } | 2179 | } |
2180 | |||
2203 | lockPartsForRead(false); | 2181 | lockPartsForRead(false); |
2204 | } | 2182 | } |
2205 | 2183 | ||
@@ -2207,9 +2185,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2207 | /// Immediately send a full update for this scene object. | 2185 | /// Immediately send a full update for this scene object. |
2208 | /// </summary> | 2186 | /// </summary> |
2209 | public void SendGroupFullUpdate() | 2187 | public void SendGroupFullUpdate() |
2210 | { | 2188 | { |
2211 | if (IsDeleted) | 2189 | if (IsDeleted) |
2212 | return; | 2190 | return; |
2191 | |||
2192 | // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); | ||
2213 | 2193 | ||
2214 | RootPart.SendFullUpdateToAllClients(); | 2194 | RootPart.SendFullUpdateToAllClients(); |
2215 | 2195 | ||
@@ -2229,7 +2209,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2229 | /// <summary> | 2209 | /// <summary> |
2230 | /// Immediately send an update for this scene object's root prim only. | 2210 | /// Immediately send an update for this scene object's root prim only. |
2231 | /// This is for updates regarding the object as a whole, and none of its parts in particular. | 2211 | /// This is for updates regarding the object as a whole, and none of its parts in particular. |
2232 | /// Note: this may not be cused by opensim (it probably should) but it's used by | 2212 | /// Note: this may not be used by opensim (it probably should) but it's used by |
2233 | /// external modules. | 2213 | /// external modules. |
2234 | /// </summary> | 2214 | /// </summary> |
2235 | public void SendGroupRootTerseUpdate() | 2215 | public void SendGroupRootTerseUpdate() |
@@ -2244,6 +2224,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2244 | { | 2224 | { |
2245 | if (m_scene == null) // Need to check here as it's null during object creation | 2225 | if (m_scene == null) // Need to check here as it's null during object creation |
2246 | return; | 2226 | return; |
2227 | |||
2247 | m_scene.SceneGraph.AddToUpdateList(this); | 2228 | m_scene.SceneGraph.AddToUpdateList(this); |
2248 | } | 2229 | } |
2249 | 2230 | ||
@@ -3050,8 +3031,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3050 | { | 3031 | { |
3051 | if (obPart.UUID != m_rootPart.UUID) | 3032 | if (obPart.UUID != m_rootPart.UUID) |
3052 | { | 3033 | { |
3053 | obPart.IgnoreUndoUpdate = true; | ||
3054 | Vector3 oldSize = new Vector3(obPart.Scale); | 3034 | Vector3 oldSize = new Vector3(obPart.Scale); |
3035 | obPart.IgnoreUndoUpdate = true; | ||
3055 | 3036 | ||
3056 | float f = 1.0f; | 3037 | float f = 1.0f; |
3057 | float a = 1.0f; | 3038 | float a = 1.0f; |
@@ -3745,7 +3726,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3745 | HasGroupChanged = true; | 3726 | HasGroupChanged = true; |
3746 | } | 3727 | } |
3747 | lockPartsForRead(false); | 3728 | lockPartsForRead(false); |
3748 | ScheduleGroupForFullUpdate(); | 3729 | |
3730 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled | ||
3731 | // for the same object with very different properties. The caller must schedule the update. | ||
3732 | //ScheduleGroupForFullUpdate(); | ||
3749 | } | 3733 | } |
3750 | 3734 | ||
3751 | public void TriggerScriptChangedEvent(Changed val) | 3735 | public void TriggerScriptChangedEvent(Changed val) |