aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionConsole.cs39
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs6
-rw-r--r--OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs54
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs19
8 files changed, 128 insertions, 28 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 11a13e1..90a13a7 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Framework.Interfaces
84 /// <param name="AttachmentPt"></param> 84 /// <param name="AttachmentPt"></param>
85 /// <param name="silent"></param> 85 /// <param name="silent"></param>
86 /// <returns>true if the object was successfully attached, false otherwise</returns> 86 /// <returns>true if the object was successfully attached, false otherwise</returns>
87 bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo); 87 bool AttachObject(IScenePresence sp, SceneObjectGroup grp, uint AttachmentPt, bool silent, bool useAttachmentInfo, bool temp);
88 88
89 /// <summary> 89 /// <summary>
90 /// Rez an attachment from user inventory and change inventory status to match. 90 /// Rez an attachment from user inventory and change inventory status to match.
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs b/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs
new file mode 100644
index 0000000..4d261d6
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IRegionConsole.cs
@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using OpenMetaverse;
29using OpenSim.Framework;
30
31namespace OpenSim.Region.Framework.Interfaces
32{
33 public interface IRegionConsole
34 {
35 bool RunCommand(string command, UUID invokerID);
36 void SendConsoleOutput(UUID agentID, string message);
37 void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn);
38 }
39}
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
index ccb583d..3e97a7a 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs
@@ -117,5 +117,11 @@ namespace OpenSim.Region.Framework.Interfaces
117 void RemoveRegionEnvironmentSettings(UUID regionUUID); 117 void RemoveRegionEnvironmentSettings(UUID regionUUID);
118 118
119 UUID[] GetObjectIDs(UUID regionID); 119 UUID[] GetObjectIDs(UUID regionID);
120
121 void SaveExtra(UUID regionID, string name, string value);
122
123 void RemoveExtra(UUID regionID, string name);
124
125 Dictionary<string, string> GetExtra(UUID regionID);
120 } 126 }
121} 127}
diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
index d7c80f7..17bd48b 100644
--- a/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
+++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs
@@ -128,6 +128,12 @@ namespace OpenSim.Region.Framework.Interfaces
128 /// <param name="regionUUID">the region UUID</param> 128 /// <param name="regionUUID">the region UUID</param>
129 void RemoveRegionEnvironmentSettings(UUID regionUUID); 129 void RemoveRegionEnvironmentSettings(UUID regionUUID);
130 130
131 void SaveExtra(UUID regionID, string name, string val);
132
133 void RemoveExtra(UUID regionID, string name);
134
135 Dictionary<string, string> GetExtra(UUID regionID);
136
131 void Shutdown(); 137 void Shutdown();
132 } 138 }
133} 139}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 7cb3811..eee5960 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -217,6 +217,9 @@ namespace OpenSim.Region.Framework.Scenes
217 /// </remarks> 217 /// </remarks>
218 public event NewScript OnNewScript; 218 public event NewScript OnNewScript;
219 219
220 public delegate void ExtraSettingChangedDelegate(Scene scene, string name, string value);
221 public event ExtraSettingChangedDelegate OnExtraSettingChanged;
222
220 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) 223 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
221 { 224 {
222 NewScript handlerNewScript = OnNewScript; 225 NewScript handlerNewScript = OnNewScript;
@@ -2616,5 +2619,25 @@ namespace OpenSim.Region.Framework.Scenes
2616 } 2619 }
2617 } 2620 }
2618 2621
2622 public void TriggerExtraSettingChanged(Scene scene, string name, string val)
2623 {
2624 ExtraSettingChangedDelegate handler = OnExtraSettingChanged;
2625
2626 if (handler != null)
2627 {
2628 foreach (ExtraSettingChangedDelegate d in handler.GetInvocationList())
2629 {
2630 try
2631 {
2632 d(scene, name, val);
2633 }
2634 catch (Exception e)
2635 {
2636 m_log.ErrorFormat("[EVENT MANAGER]: Delegate for ExtraSettingChanged failed - continuing {0} - {1}",
2637 e.Message, e.StackTrace);
2638 }
2639 }
2640 }
2641 }
2619 } 2642 }
2620} 2643}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3db7c7d..a5f0bff 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -177,6 +177,8 @@ namespace OpenSim.Region.Framework.Scenes
177 protected ICapabilitiesModule m_capsModule; 177 protected ICapabilitiesModule m_capsModule;
178 protected IGroupsModule m_groupsModule; 178 protected IGroupsModule m_groupsModule;
179 179
180 private Dictionary<string, string> m_extraSettings;
181
180 /// <summary> 182 /// <summary>
181 /// Current scene frame number 183 /// Current scene frame number
182 /// </summary> 184 /// </summary>
@@ -658,6 +660,8 @@ namespace OpenSim.Region.Framework.Scenes
658 // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new 660 // FIXME: It shouldn't be up to the database plugins to create this data - we should do it when a new
659 // region is set up and avoid these gyrations. 661 // region is set up and avoid these gyrations.
660 RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID); 662 RegionSettings rs = simDataService.LoadRegionSettings(RegionInfo.RegionID);
663 m_extraSettings = simDataService.GetExtra(RegionInfo.RegionID);
664
661 bool updatedTerrainTextures = false; 665 bool updatedTerrainTextures = false;
662 if (rs.TerrainTexture1 == UUID.Zero) 666 if (rs.TerrainTexture1 == UUID.Zero)
663 { 667 {
@@ -842,7 +846,6 @@ namespace OpenSim.Region.Framework.Scenes
842 m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences); 846 m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
843 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); 847 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
844 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning); 848 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
845 SendPeriodicAppearanceUpdates = startupConfig.GetBoolean("SendPeriodicAppearanceUpdates", SendPeriodicAppearanceUpdates);
846 } 849 }
847 } 850 }
848 catch (Exception e) 851 catch (Exception e)
@@ -850,6 +853,14 @@ namespace OpenSim.Region.Framework.Scenes
850 m_log.Error("[SCENE]: Failed to load StartupConfig: " + e.ToString()); 853 m_log.Error("[SCENE]: Failed to load StartupConfig: " + e.ToString());
851 } 854 }
852 855
856 // FIXME: Ultimately this should be in a module.
857 IConfig appearanceConfig = m_config.Configs["Appearance"];
858 if (appearanceConfig != null)
859 {
860 SendPeriodicAppearanceUpdates
861 = appearanceConfig.GetBoolean("ResendAppearanceUpdates", SendPeriodicAppearanceUpdates);
862 }
863
853 #endregion Region Config 864 #endregion Region Config
854 865
855 #region Interest Management 866 #region Interest Management
@@ -2748,7 +2759,7 @@ namespace OpenSim.Region.Framework.Scenes
2748 RootPrim.RemFlag(PrimFlags.TemporaryOnRez); 2759 RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
2749 2760
2750 if (AttachmentsModule != null) 2761 if (AttachmentsModule != null)
2751 AttachmentsModule.AttachObject(sp, grp, 0, false, false); 2762 AttachmentsModule.AttachObject(sp, grp, 0, false, false, false);
2752 } 2763 }
2753 else 2764 else
2754 { 2765 {
@@ -5843,5 +5854,44 @@ Environment.Exit(1);
5843 5854
5844 callback(asset); 5855 callback(asset);
5845 } 5856 }
5857
5858 public string GetExtraSetting(string name)
5859 {
5860 string val;
5861
5862 if (!m_extraSettings.TryGetValue(name, out val))
5863 return String.Empty;
5864
5865 return val;
5866 }
5867
5868 public void StoreExtraSetting(string name, string val)
5869 {
5870 string oldVal;
5871
5872 if (m_extraSettings.TryGetValue(name, out oldVal))
5873 {
5874 if (oldVal == val)
5875 return;
5876 }
5877
5878 m_extraSettings[name] = val;
5879
5880 m_SimulationDataService.SaveExtra(RegionInfo.RegionID, name, val);
5881
5882 m_eventManager.TriggerExtraSettingChanged(this, name, val);
5883 }
5884
5885 public void RemoveExtraSetting(string name)
5886 {
5887 if (!m_extraSettings.ContainsKey(name))
5888 return;
5889
5890 m_extraSettings.Remove(name);
5891
5892 m_SimulationDataService.RemoveExtra(RegionInfo.RegionID, name);
5893
5894 m_eventManager.TriggerExtraSettingChanged(this, name, String.Empty);
5895 }
5846 } 5896 }
5847} 5897}
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index e0260e2..e29b2c1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1793,7 +1793,6 @@ namespace OpenSim.Region.Framework.Scenes
1793 1793
1794 try 1794 try
1795 { 1795 {
1796 parentGroup.areUpdatesSuspended = true;
1797 1796
1798 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); 1797 List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
1799 1798
@@ -1850,7 +1849,6 @@ namespace OpenSim.Region.Framework.Scenes
1850 SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup; 1849 SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup;
1851 } 1850 }
1852 1851
1853 parentGroup.areUpdatesSuspended = false;
1854 parentGroup.HasGroupChanged = true; 1852 parentGroup.HasGroupChanged = true;
1855 parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); 1853 parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);
1856 parentGroup.ScheduleGroupForFullUpdate(); 1854 parentGroup.ScheduleGroupForFullUpdate();
@@ -1896,7 +1894,6 @@ namespace OpenSim.Region.Framework.Scenes
1896 SceneObjectGroup group = part.ParentGroup; 1894 SceneObjectGroup group = part.ParentGroup;
1897 if (!affectedGroups.Contains(group)) 1895 if (!affectedGroups.Contains(group))
1898 { 1896 {
1899 group.areUpdatesSuspended = true;
1900 affectedGroups.Add(group); 1897 affectedGroups.Add(group);
1901 } 1898 }
1902 } 1899 }
@@ -1922,7 +1919,6 @@ namespace OpenSim.Region.Framework.Scenes
1922 // However, editing linked parts and unlinking may be different 1919 // However, editing linked parts and unlinking may be different
1923 // 1920 //
1924 SceneObjectGroup group = root.ParentGroup; 1921 SceneObjectGroup group = root.ParentGroup;
1925 group.areUpdatesSuspended = true;
1926 1922
1927 List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts); 1923 List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts);
1928 int numChildren = newSet.Count; 1924 int numChildren = newSet.Count;
@@ -1945,7 +1941,6 @@ namespace OpenSim.Region.Framework.Scenes
1945 group.DelinkFromGroup(p, sendEventsToRemainder); 1941 group.DelinkFromGroup(p, sendEventsToRemainder);
1946 if (numChildren > 2) 1942 if (numChildren > 2)
1947 { 1943 {
1948 p.ParentGroup.areUpdatesSuspended = true;
1949 } 1944 }
1950 else 1945 else
1951 { 1946 {
@@ -1980,7 +1975,6 @@ namespace OpenSim.Region.Framework.Scenes
1980 foreach (SceneObjectPart newChild in newSet) 1975 foreach (SceneObjectPart newChild in newSet)
1981 newChild.ClearUpdateSchedule(); 1976 newChild.ClearUpdateSchedule();
1982 1977
1983 newRoot.ParentGroup.areUpdatesSuspended = true;
1984 LinkObjects(newRoot, newSet); 1978 LinkObjects(newRoot, newSet);
1985 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1979 if (!affectedGroups.Contains(newRoot.ParentGroup))
1986 affectedGroups.Add(newRoot.ParentGroup); 1980 affectedGroups.Add(newRoot.ParentGroup);
@@ -1998,7 +1992,6 @@ namespace OpenSim.Region.Framework.Scenes
1998 m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID); 1992 m_parentScene.SimulationDataService.RemoveObject(g.UUID, m_parentScene.RegionInfo.RegionID);
1999 g.TriggerScriptChangedEvent(Changed.LINK); 1993 g.TriggerScriptChangedEvent(Changed.LINK);
2000 g.HasGroupChanged = true; // Persist 1994 g.HasGroupChanged = true; // Persist
2001 g.areUpdatesSuspended = false;
2002 g.ScheduleGroupForFullUpdate(); 1995 g.ScheduleGroupForFullUpdate();
2003 } 1996 }
2004 } 1997 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d51281d..6104c66 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -113,25 +113,8 @@ namespace OpenSim.Region.Framework.Scenes
113 private long m_maxPersistTime = 0; 113 private long m_maxPersistTime = 0;
114 private long m_minPersistTime = 0; 114 private long m_minPersistTime = 0;
115 private Random m_rand; 115 private Random m_rand;
116 private bool m_suspendUpdates;
117 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>(); 116 private List<ScenePresence> m_linkedAvatars = new List<ScenePresence>();
118 117
119 public bool areUpdatesSuspended
120 {
121 get
122 {
123 return m_suspendUpdates;
124 }
125 set
126 {
127 m_suspendUpdates = value;
128 if (!value)
129 {
130 QueueForUpdateCheck();
131 }
132 }
133 }
134
135 /// <summary> 118 /// <summary>
136 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage 119 /// This indicates whether the object has changed such that it needs to be repersisted to permenant storage
137 /// (the database). 120 /// (the database).
@@ -951,7 +934,7 @@ namespace OpenSim.Region.Framework.Scenes
951 /// its existing localID and UUID. 934 /// its existing localID and UUID.
952 /// </summary> 935 /// </summary>
953 /// <param name='part'>Root part for this scene object.</param> 936 /// <param name='part'>Root part for this scene object.</param>
954 public SceneObjectGroup(SceneObjectPart part) 937 public SceneObjectGroup(SceneObjectPart part) : this()
955 { 938 {
956 SetRootPart(part); 939 SetRootPart(part);
957 } 940 }