aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs85
1 files changed, 27 insertions, 58 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 13d1d4e..1c6f2d1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -418,6 +418,7 @@ namespace OpenSim.Region.Framework.Scenes
418 RootPart.ScriptSetPhysicsStatus(false); 418 RootPart.ScriptSetPhysicsStatus(false);
419 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), 419 Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
420 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); 420 ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
421 lockPartsForRead(false);
421 return; 422 return;
422 } 423 }
423 } 424 }
@@ -530,8 +531,8 @@ namespace OpenSim.Region.Framework.Scenes
530 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>(); 531 private List<SceneObjectPart> m_PlaySoundSlavePrims = new List<SceneObjectPart>();
531 public List<SceneObjectPart> PlaySoundSlavePrims 532 public List<SceneObjectPart> PlaySoundSlavePrims
532 { 533 {
533 get { return m_LoopSoundSlavePrims; } 534 get { return m_PlaySoundSlavePrims; }
534 set { m_LoopSoundSlavePrims = value; } 535 set { m_PlaySoundSlavePrims = value; }
535 } 536 }
536 537
537 private SceneObjectPart m_LoopSoundMasterPrim = null; 538 private SceneObjectPart m_LoopSoundMasterPrim = null;
@@ -686,7 +687,7 @@ namespace OpenSim.Region.Framework.Scenes
686 ApplyPhysics(m_scene.m_physicalPrim); 687 ApplyPhysics(m_scene.m_physicalPrim);
687 688
688 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 689 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
689 // for the same object with very different properties. The caller must schedule the update. 690 // for the same object with very different properties. The caller must schedule the update.
690 //ScheduleGroupForFullUpdate(); 691 //ScheduleGroupForFullUpdate();
691 } 692 }
692 693
@@ -1040,6 +1041,11 @@ namespace OpenSim.Region.Framework.Scenes
1040 1041
1041 public void SaveScriptedState(XmlTextWriter writer) 1042 public void SaveScriptedState(XmlTextWriter writer)
1042 { 1043 {
1044 SaveScriptedState(writer, false);
1045 }
1046
1047 public void SaveScriptedState(XmlTextWriter writer, bool oldIDs)
1048 {
1043 XmlDocument doc = new XmlDocument(); 1049 XmlDocument doc = new XmlDocument();
1044 Dictionary<UUID,string> states = new Dictionary<UUID,string>(); 1050 Dictionary<UUID,string> states = new Dictionary<UUID,string>();
1045 1051
@@ -1049,7 +1055,7 @@ namespace OpenSim.Region.Framework.Scenes
1049 foreach (SceneObjectPart part in m_parts.Values) 1055 foreach (SceneObjectPart part in m_parts.Values)
1050 { 1056 {
1051 1057
1052 Dictionary<UUID,string> pstates = part.Inventory.GetScriptStates(); 1058 Dictionary<UUID,string> pstates = part.Inventory.GetScriptStates(oldIDs);
1053 foreach (UUID itemid in pstates.Keys) 1059 foreach (UUID itemid in pstates.Keys)
1054 { 1060 {
1055 states.Add(itemid, pstates[itemid]); 1061 states.Add(itemid, pstates[itemid]);
@@ -1411,21 +1417,20 @@ namespace OpenSim.Region.Framework.Scenes
1411 { 1417 {
1412// part.Inventory.RemoveScriptInstances(); 1418// part.Inventory.RemoveScriptInstances();
1413 1419
1414 ScenePresence[] avatars = Scene.GetScenePresences(); 1420 Scene.ForEachScenePresence(delegate (ScenePresence sp)
1415 for (int i = 0; i < avatars.Length; i++)
1416 { 1421 {
1417 if (avatars[i].ParentID == LocalId) 1422 if (sp.ParentID == LocalId)
1418 { 1423 {
1419 avatars[i].StandUp(); 1424 sp.StandUp();
1420 } 1425 }
1421 1426
1422 if (!silent) 1427 if (!silent)
1423 { 1428 {
1424 part.UpdateFlag = 0; 1429 part.UpdateFlag = 0;
1425 if (part == m_rootPart) 1430 if (part == m_rootPart)
1426 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); 1431 sp.ControllingClient.SendKillObject(m_regionHandle, part.LocalId);
1427 } 1432 }
1428 } 1433 });
1429 1434
1430 } 1435 }
1431 1436
@@ -1647,11 +1652,10 @@ namespace OpenSim.Region.Framework.Scenes
1647 1652
1648 #endregion 1653 #endregion
1649 1654
1650 #region Client Updating
1651
1652 public void SendFullUpdateToClient(IClientAPI remoteClient) 1655 public void SendFullUpdateToClient(IClientAPI remoteClient)
1653 { 1656 {
1654 SendPartFullUpdate(remoteClient, RootPart, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); 1657 RootPart.SendFullUpdate(
1658 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID));
1655 1659
1656 lockPartsForRead(true); 1660 lockPartsForRead(true);
1657 { 1661 {
@@ -1659,42 +1663,12 @@ namespace OpenSim.Region.Framework.Scenes
1659 { 1663 {
1660 1664
1661 if (part != RootPart) 1665 if (part != RootPart)
1662 SendPartFullUpdate(remoteClient, part, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); 1666 part.SendFullUpdate(
1663 1667 remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID));
1664 } 1668 }
1665 } 1669 }
1666 lockPartsForRead(false);
1667 } 1670 }
1668 1671
1669 /// <summary>
1670 /// Send a full update to the client for the given part
1671 /// </summary>
1672 /// <param name="remoteClient"></param>
1673 /// <param name="part"></param>
1674 internal void SendPartFullUpdate(IClientAPI remoteClient, SceneObjectPart part, uint clientFlags)
1675 {
1676// m_log.DebugFormat(
1677// "[SOG]: Sendinging part full update to {0} for {1} {2}", remoteClient.Name, part.Name, part.LocalId);
1678
1679 if (m_rootPart.UUID == part.UUID)
1680 {
1681 if (IsAttachment)
1682 {
1683 part.SendFullUpdateToClient(remoteClient, m_rootPart.AttachedPos, clientFlags);
1684 }
1685 else
1686 {
1687 part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
1688 }
1689 }
1690 else
1691 {
1692 part.SendFullUpdateToClient(remoteClient, clientFlags);
1693 }
1694 }
1695
1696 #endregion
1697
1698 #region Copying 1672 #region Copying
1699 1673
1700 /// <summary> 1674 /// <summary>
@@ -2206,14 +2180,12 @@ namespace OpenSim.Region.Framework.Scenes
2206 public void ScheduleTerseUpdateToAvatar(ScenePresence presence) 2180 public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
2207 { 2181 {
2208 lockPartsForRead(true); 2182 lockPartsForRead(true);
2183
2184 foreach (SceneObjectPart part in m_parts.Values)
2209 { 2185 {
2210 foreach (SceneObjectPart part in m_parts.Values) 2186 part.AddTerseUpdateToAvatar(presence);
2211 {
2212
2213 part.AddTerseUpdateToAvatar(presence);
2214
2215 }
2216 } 2187 }
2188
2217 lockPartsForRead(false); 2189 lockPartsForRead(false);
2218 } 2190 }
2219 2191
@@ -2246,14 +2218,11 @@ namespace OpenSim.Region.Framework.Scenes
2246 public void ScheduleGroupForTerseUpdate() 2218 public void ScheduleGroupForTerseUpdate()
2247 { 2219 {
2248 lockPartsForRead(true); 2220 lockPartsForRead(true);
2221 foreach (SceneObjectPart part in m_parts.Values)
2249 { 2222 {
2250 foreach (SceneObjectPart part in m_parts.Values) 2223 part.ScheduleTerseUpdate();
2251 {
2252
2253 part.ScheduleTerseUpdate();
2254
2255 }
2256 } 2224 }
2225
2257 lockPartsForRead(false); 2226 lockPartsForRead(false);
2258 } 2227 }
2259 2228
@@ -3107,8 +3076,8 @@ namespace OpenSim.Region.Framework.Scenes
3107 { 3076 {
3108 if (obPart.UUID != m_rootPart.UUID) 3077 if (obPart.UUID != m_rootPart.UUID)
3109 { 3078 {
3110 obPart.IgnoreUndoUpdate = true;
3111 Vector3 oldSize = new Vector3(obPart.Scale); 3079 Vector3 oldSize = new Vector3(obPart.Scale);
3080 obPart.IgnoreUndoUpdate = true;
3112 3081
3113 float f = 1.0f; 3082 float f = 1.0f;
3114 float a = 1.0f; 3083 float a = 1.0f;