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.cs53
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs71
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs8
5 files changed, 116 insertions, 46 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 569c235..6ff2a6f 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -138,8 +138,11 @@ namespace OpenSim.Region.Framework.Scenes
138 public event OnPermissionErrorDelegate OnPermissionError; 138 public event OnPermissionErrorDelegate OnPermissionError;
139 139
140 /// <summary> 140 /// <summary>
141 /// Fired when a new script is created. 141 /// Fired when a script is run.
142 /// </summary> 142 /// </summary>
143 /// <remarks>
144 /// Occurs after OnNewScript.
145 /// </remarks>
143 public event NewRezScript OnRezScript; 146 public event NewRezScript OnRezScript;
144 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource); 147 public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
145 148
@@ -187,10 +190,16 @@ namespace OpenSim.Region.Framework.Scenes
187 190
188 public event ClientClosed OnClientClosed; 191 public event ClientClosed OnClientClosed;
189 192
190 // Fired when a script is created
191 // The indication that a new script exists in this region.
192 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); 193 public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
194
195 /// <summary>
196 /// Fired when a script is created.
197 /// </summary>
198 /// <remarks>
199 /// Occurs before OnRezScript
200 /// </remarks>
193 public event NewScript OnNewScript; 201 public event NewScript OnNewScript;
202
194 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID) 203 public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
195 { 204 {
196 NewScript handlerNewScript = OnNewScript; 205 NewScript handlerNewScript = OnNewScript;
@@ -212,10 +221,16 @@ namespace OpenSim.Region.Framework.Scenes
212 } 221 }
213 } 222 }
214 223
215 //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
216 // An indication that the script has changed.
217 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); 224 public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
225
226 /// <summary>
227 /// An indication that the script has changed.
228 /// </summary>
229 /// <remarks>
230 /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
231 /// </remarks>
218 public event UpdateScript OnUpdateScript; 232 public event UpdateScript OnUpdateScript;
233
219 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID) 234 public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
220 { 235 {
221 UpdateScript handlerUpdateScript = OnUpdateScript; 236 UpdateScript handlerUpdateScript = OnUpdateScript;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a01b851..9e59d50 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes
596 596
597 #endregion Region Settings 597 #endregion Region Settings
598 598
599 MainConsole.Instance.Commands.AddCommand("region", false, "reload estate", 599 MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate",
600 "reload estate", 600 "reload estate",
601 "Reload the estate data", HandleReloadEstate); 601 "Reload the estate data", HandleReloadEstate);
602 602
@@ -628,10 +628,10 @@ namespace OpenSim.Region.Framework.Scenes
628 628
629 #region Region Config 629 #region Region Config
630 630
631 try 631 // Region config overrides global config
632 //
633 if (m_config.Configs["Startup"] != null)
632 { 634 {
633 // Region config overrides global config
634 //
635 IConfig startupConfig = m_config.Configs["Startup"]; 635 IConfig startupConfig = m_config.Configs["Startup"];
636 636
637 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); 637 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
@@ -721,46 +721,39 @@ namespace OpenSim.Region.Framework.Scenes
721 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); 721 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
722 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning); 722 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
723 } 723 }
724 catch
725 {
726 m_log.Warn("[SCENE]: Failed to load StartupConfig");
727 }
728 724
729 #endregion Region Config 725 #endregion Region Config
730 726
731 #region Interest Management 727 #region Interest Management
732 728
733 if (m_config != null) 729 IConfig interestConfig = m_config.Configs["InterestManagement"];
730 if (interestConfig != null)
734 { 731 {
735 IConfig interestConfig = m_config.Configs["InterestManagement"]; 732 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
736 if (interestConfig != null)
737 {
738 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
739 733
740 try 734 try
741 { 735 {
742 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); 736 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
743 }
744 catch (Exception)
745 {
746 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
747 m_priorityScheme = UpdatePrioritizationSchemes.Time;
748 }
749
750 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
751 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
752 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
753 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
754 } 737 }
738 catch (Exception)
739 {
740 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
741 m_priorityScheme = UpdatePrioritizationSchemes.Time;
742 }
743
744 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
745 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
746 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
747 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
755 } 748 }
756 749
757 m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme); 750 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
758 751
759 #endregion Interest Management 752 #endregion Interest Management
760 753
761 StatsReporter = new SimStatsReporter(this); 754 StatsReporter = new SimStatsReporter(this);
762 StatsReporter.OnSendStatsResult += SendSimStatsPackets; 755 StatsReporter.OnSendStatsResult += SendSimStatsPackets;
763 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 756 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
764 } 757 }
765 758
766 /// <summary> 759 /// <summary>
@@ -1076,6 +1069,8 @@ namespace OpenSim.Region.Framework.Scenes
1076 { 1069 {
1077 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName); 1070 m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
1078 1071
1072 StatsReporter.Close();
1073
1079 m_restartTimer.Stop(); 1074 m_restartTimer.Stop();
1080 m_restartTimer.Close(); 1075 m_restartTimer.Close();
1081 1076
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 712e094..495cede 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -472,6 +472,63 @@ namespace OpenSim.Region.Framework.Scenes
472 /// <summary> 472 /// <summary>
473 /// Call this from a region module to add a command to the OpenSim console. 473 /// Call this from a region module to add a command to the OpenSim console.
474 /// </summary> 474 /// </summary>
475 /// <param name="mod">
476 /// The use of IRegionModuleBase is a cheap trick to get a different method signature,
477 /// though all new modules should be using interfaces descended from IRegionModuleBase anyway.
478 /// </param>
479 /// <param name="category">
480 /// Category of the command. This is the section under which it will appear when the user asks for help
481 /// </param>
482 /// <param name="command"></param>
483 /// <param name="shorthelp"></param>
484 /// <param name="longhelp"></param>
485 /// <param name="callback"></param>
486 public void AddCommand(
487 string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
488 {
489 AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback);
490 }
491
492 /// <summary>
493 /// Call this from a region module to add a command to the OpenSim console.
494 /// </summary>
495 /// <param name="mod"></param>
496 /// <param name="command"></param>
497 /// <param name="shorthelp"></param>
498 /// <param name="longhelp"></param>
499 /// <param name="descriptivehelp"></param>
500 /// <param name="callback"></param>
501 public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
502 {
503 string moduleName = "";
504
505 if (mod != null)
506 {
507 if (mod is IRegionModule)
508 {
509 IRegionModule module = (IRegionModule)mod;
510 moduleName = module.Name;
511 }
512 else if (mod is IRegionModuleBase)
513 {
514 IRegionModuleBase module = (IRegionModuleBase)mod;
515 moduleName = module.Name;
516 }
517 else
518 {
519 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
520 }
521 }
522
523 AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback);
524 }
525
526 /// <summary>
527 /// Call this from a region module to add a command to the OpenSim console.
528 /// </summary>
529 /// <param name="category">
530 /// Category of the command. This is the section under which it will appear when the user asks for help
531 /// </param>
475 /// <param name="mod"></param> 532 /// <param name="mod"></param>
476 /// <param name="command"></param> 533 /// <param name="command"></param>
477 /// <param name="shorthelp"></param> 534 /// <param name="shorthelp"></param>
@@ -479,12 +536,12 @@ namespace OpenSim.Region.Framework.Scenes
479 /// <param name="descriptivehelp"></param> 536 /// <param name="descriptivehelp"></param>
480 /// <param name="callback"></param> 537 /// <param name="callback"></param>
481 public void AddCommand( 538 public void AddCommand(
482 object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) 539 string category, object mod, string command,
540 string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
483 { 541 {
484 if (MainConsole.Instance == null) 542 if (MainConsole.Instance == null)
485 return; 543 return;
486 544
487 string modulename = String.Empty;
488 bool shared = false; 545 bool shared = false;
489 546
490 if (mod != null) 547 if (mod != null)
@@ -492,20 +549,20 @@ namespace OpenSim.Region.Framework.Scenes
492 if (mod is IRegionModule) 549 if (mod is IRegionModule)
493 { 550 {
494 IRegionModule module = (IRegionModule)mod; 551 IRegionModule module = (IRegionModule)mod;
495 modulename = module.Name;
496 shared = module.IsSharedModule; 552 shared = module.IsSharedModule;
497 } 553 }
498 else if (mod is IRegionModuleBase) 554 else if (mod is IRegionModuleBase)
499 { 555 {
500 IRegionModuleBase module = (IRegionModuleBase)mod;
501 modulename = module.Name;
502 shared = mod is ISharedRegionModule; 556 shared = mod is ISharedRegionModule;
503 } 557 }
504 else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase"); 558 else
559 {
560 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
561 }
505 } 562 }
506 563
507 MainConsole.Instance.Commands.AddCommand( 564 MainConsole.Instance.Commands.AddCommand(
508 modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback); 565 category, shared, command, shorthelp, longhelp, descriptivehelp, callback);
509 } 566 }
510 567
511 public virtual ISceneObject DeserializeObject(string representation) 568 public virtual ISceneObject DeserializeObject(string representation)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 65905a0..439b718 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1546,10 +1546,7 @@ namespace OpenSim.Region.Framework.Scenes
1546 if (userExposed) 1546 if (userExposed)
1547 dupe.UUID = UUID.Random(); 1547 dupe.UUID = UUID.Random();
1548 1548
1549 //memberwiseclone means it also clones the physics actor reference 1549 dupe.PhysActor = null;
1550 // This will make physical prim 'bounce' if not set to null.
1551 if (!userExposed)
1552 dupe.PhysActor = null;
1553 1550
1554 dupe.OwnerID = AgentID; 1551 dupe.OwnerID = AgentID;
1555 dupe.GroupID = GroupID; 1552 dupe.GroupID = GroupID;
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;