aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs34
1 files changed, 28 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 8277f39..db2e4b8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1615,7 +1615,9 @@ namespace OpenSim.Region.Environment.Scenes
1615 /// <param name="message"></param> 1615 /// <param name="message"></param>
1616 public void SendGeneralAlert(string message) 1616 public void SendGeneralAlert(string message)
1617 { 1617 {
1618 foreach (ScenePresence presence in m_scenePresences.Values) 1618 List<ScenePresence> presenceList = GetScenePresences();
1619
1620 foreach (ScenePresence presence in presenceList)
1619 { 1621 {
1620 presence.ControllingClient.SendAlertMessage(message); 1622 presence.ControllingClient.SendAlertMessage(message);
1621 } 1623 }
@@ -1776,7 +1778,9 @@ namespace OpenSim.Region.Environment.Scenes
1776 /// <param name="modal"></param> 1778 /// <param name="modal"></param>
1777 public void SendAlertToUser(string firstName, string lastName, string message, bool modal) 1779 public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
1778 { 1780 {
1779 foreach (ScenePresence presence in m_scenePresences.Values) 1781 List<ScenePresence> presenceList = GetScenePresences();
1782
1783 foreach (ScenePresence presence in presenceList)
1780 { 1784 {
1781 if ((presence.Firstname == firstName) && (presence.Lastname == lastName)) 1785 if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
1782 { 1786 {
@@ -1821,7 +1825,9 @@ namespace OpenSim.Region.Environment.Scenes
1821 /// </summary> 1825 /// </summary>
1822 public void ForceClientUpdate() 1826 public void ForceClientUpdate()
1823 { 1827 {
1824 foreach (EntityBase ent in Entities.Values) 1828 List<EntityBase> EntitieList = GetEntities();
1829
1830 foreach (EntityBase ent in EntitieList)
1825 { 1831 {
1826 if (ent is SceneObjectGroup) 1832 if (ent is SceneObjectGroup)
1827 { 1833 {
@@ -1838,7 +1844,10 @@ namespace OpenSim.Region.Environment.Scenes
1838 public void HandleEditCommand(string[] cmdparams) 1844 public void HandleEditCommand(string[] cmdparams)
1839 { 1845 {
1840 Console.WriteLine("Searching for Primitive: '" + cmdparams[0] + "'"); 1846 Console.WriteLine("Searching for Primitive: '" + cmdparams[0] + "'");
1841 foreach (EntityBase ent in Entities.Values) 1847
1848 List<EntityBase> EntitieList = GetEntities();
1849
1850 foreach (EntityBase ent in EntitieList)
1842 { 1851 {
1843 if (ent is SceneObjectGroup) 1852 if (ent is SceneObjectGroup)
1844 { 1853 {
@@ -2017,7 +2026,8 @@ namespace OpenSim.Region.Environment.Scenes
2017 if (!(m_scenePresences.Equals(null))) 2026 if (!(m_scenePresences.Equals(null)))
2018 { 2027 {
2019 try { 2028 try {
2020 foreach (ScenePresence presence in m_scenePresences.Values) 2029 List<ScenePresence> presenceList = GetScenePresences();
2030 foreach (ScenePresence presence in presenceList)
2021 { 2031 {
2022 action(presence); 2032 action(presence);
2023 } 2033 }
@@ -2033,7 +2043,14 @@ namespace OpenSim.Region.Environment.Scenes
2033 /// <param name="action"></param> 2043 /// <param name="action"></param>
2034 public void ForEachObject(Action<SceneObjectGroup> action) 2044 public void ForEachObject(Action<SceneObjectGroup> action)
2035 { 2045 {
2036 foreach (SceneObjectGroup presence in m_sceneObjects.Values) 2046 List<SceneObjectGroup> presenceList;
2047
2048 lock (m_sceneObjects)
2049 {
2050 presenceList = new List<SceneObjectGroup>(m_sceneObjects.Values);
2051 }
2052
2053 foreach (SceneObjectGroup presence in presenceList)
2037 { 2054 {
2038 action(presence); 2055 action(presence);
2039 } 2056 }
@@ -2074,6 +2091,11 @@ namespace OpenSim.Region.Environment.Scenes
2074 m_innerScene.ForEachClient(action); 2091 m_innerScene.ForEachClient(action);
2075 } 2092 }
2076 2093
2094 public List<EntityBase> GetEntities()
2095 {
2096 return m_innerScene.GetEntities();
2097 }
2098
2077 #endregion 2099 #endregion
2078 } 2100 }
2079} 2101}