aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs47
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs8
3 files changed, 50 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 9fcd5fe..605ee32 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -142,8 +142,11 @@ namespace OpenSim.Region.Framework.Scenes
142 public event OnPermissionErrorDelegate OnPermissionError; 142 public event OnPermissionErrorDelegate OnPermissionError;
143 143
144 /// <summary> 144 /// <summary>
145 /// Fired when a new script is created. 145 /// Fired when a script is run.
146 /// </summary> 146 /// </summary>
147 /// <remarks>
148 /// Occurs after OnNewScript.
149 /// </remarks>
147 public event NewRezScript OnRezScript; 150 public event NewRezScript OnRezScript;
148 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); 151 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
149 152
@@ -191,10 +194,16 @@ namespace OpenSim.Region.Framework.Scenes
191 194
192 public event ClientClosed OnClientClosed; 195 public event ClientClosed OnClientClosed;
193 196
194 // Fired when a script is created
195 // The indication that a new script exists in this region.
196 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); 197 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
198
199 /// <summary>
200 /// Fired when a script is created.
201 /// </summary>
202 /// <remarks>
203 /// Occurs before OnRezScript
204 /// </remarks>
197 public event NewScript OnNewScript; 205 public event NewScript OnNewScript;
206
198 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) 207 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
199 { 208 {
200 NewScript handlerNewScript = OnNewScript; 209 NewScript handlerNewScript = OnNewScript;
@@ -216,10 +225,16 @@ namespace OpenSim.Region.Framework.Scenes
216 } 225 }
217 } 226 }
218 227
219 //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
220 // An indication that the script has changed.
221 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); 228 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
229
230 /// <summary>
231 /// An indication that the script has changed.
232 /// </summary>
233 /// <remarks>
234 /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
235 /// </remarks>
222 public event UpdateScript OnUpdateScript; 236 public event UpdateScript OnUpdateScript;
237
223 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) 238 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
224 { 239 {
225 UpdateScript handlerUpdateScript = OnUpdateScript; 240 UpdateScript handlerUpdateScript = OnUpdateScript;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4fc59e2..fc72946 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -651,10 +651,10 @@ namespace OpenSim.Region.Framework.Scenes
651 651
652 #region Region Config 652 #region Region Config
653 653
654 try 654 // Region config overrides global config
655 //
656 if (m_config.Configs["Startup"] != null)
655 { 657 {
656 // Region config overrides global config
657 //
658 IConfig startupConfig = m_config.Configs["Startup"]; 658 IConfig startupConfig = m_config.Configs["Startup"];
659 659
660 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); 660 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
@@ -756,37 +756,34 @@ namespace OpenSim.Region.Framework.Scenes
756 756
757 #region Interest Management 757 #region Interest Management
758 758
759 if (m_config != null) 759 IConfig interestConfig = m_config.Configs["InterestManagement"];
760 if (interestConfig != null)
760 { 761 {
761 IConfig interestConfig = m_config.Configs["InterestManagement"]; 762 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
762 if (interestConfig != null)
763 {
764 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
765 763
766 try 764 try
767 { 765 {
768 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); 766 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
769 } 767 }
770 catch (Exception) 768 catch (Exception)
771 { 769 {
772 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); 770 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
773 m_priorityScheme = UpdatePrioritizationSchemes.Time; 771 m_priorityScheme = UpdatePrioritizationSchemes.Time;
774 }
775
776 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
777 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
778 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
779 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
780 } 772 }
773
774 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
775 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
776 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
777 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
781 } 778 }
782 779
783 m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme); 780 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
784 781
785 #endregion Interest Management 782 #endregion Interest Management
786 783
787 StatsReporter = new SimStatsReporter(this); 784 StatsReporter = new SimStatsReporter(this);
788 StatsReporter.OnSendStatsResult += SendSimStatsPackets; 785 StatsReporter.OnSendStatsResult += SendSimStatsPackets;
789 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 786 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
790 } 787 }
791 788
792 /// <summary> 789 /// <summary>
@@ -1102,6 +1099,8 @@ namespace OpenSim.Region.Framework.Scenes
1102 { 1099 {
1103 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); 1100 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
1104 1101
1102 StatsReporter.Close();
1103
1105 m_restartTimer.Stop(); 1104 m_restartTimer.Stop();
1106 m_restartTimer.Close(); 1105 m_restartTimer.Close();
1107 1106
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 35cd025..5c56264 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -178,13 +178,19 @@ namespace OpenSim.Region.Framework.Scenes
178 m_objectCapacity = scene.RegionInfo.ObjectCapacity; 178 m_objectCapacity = scene.RegionInfo.ObjectCapacity;
179 m_report.AutoReset = true; 179 m_report.AutoReset = true;
180 m_report.Interval = statsUpdatesEveryMS; 180 m_report.Interval = statsUpdatesEveryMS;
181 m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); 181 m_report.Elapsed += statsHeartBeat;
182 m_report.Enabled = true; 182 m_report.Enabled = true;
183 183
184 if (StatsManager.SimExtraStats != null) 184 if (StatsManager.SimExtraStats != null)
185 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket; 185 OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
186 } 186 }
187 187
188 public void Close()
189 {
190 m_report.Elapsed -= statsHeartBeat;
191 m_report.Close();
192 }
193
188 public void SetUpdateMS(int ms) 194 public void SetUpdateMS(int ms)
189 { 195 {
190 statsUpdatesEveryMS = ms; 196 statsUpdatesEveryMS = ms;