aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-02-06 09:38:14 +0000
committerTeravus Ovares2008-02-06 09:38:14 +0000
commit9d6ea497e27bb2c93211fe2899e609ea9ea18623 (patch)
tree930777aa2d9cf39c8ba54dc81d89771c21b969d4
parentCleaned up some unreachable code warnings. (diff)
downloadopensim-SC-9d6ea497e27bb2c93211fe2899e609ea9ea18623.zip
opensim-SC-9d6ea497e27bb2c93211fe2899e609ea9ea18623.tar.gz
opensim-SC-9d6ea497e27bb2c93211fe2899e609ea9ea18623.tar.bz2
opensim-SC-9d6ea497e27bb2c93211fe2899e609ea9ea18623.tar.xz
* Added the ability to start and stop all scripts in the simulator using the debug tab on the estate tools. This along with the disable physics via the debug tab are persistant across reboots. That means that if it's disabled when you shut down the simulator, the simulator will come up again when you start it up without loading the scripts. Turning them back on is as simple as unchecking 'disable scripts' in the debug tab of the estate tools.
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs2
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs20
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs48
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs10
4 files changed, 76 insertions, 4 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 24d9010..fb84466 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -137,7 +137,7 @@ namespace OpenSim.Region.Communications.OGS1
137 try 137 try
138 { 138 {
139 GridReq = new XmlRpcRequest("simulator_login", SendParams); 139 GridReq = new XmlRpcRequest("simulator_login", SendParams);
140 GridResp = GridReq.Send(serversInfo.GridURL, 10000); 140 GridResp = GridReq.Send(serversInfo.GridURL, 16000);
141 } catch (Exception ex) 141 } catch (Exception ex)
142 { 142 {
143 m_log.Error("Unable to connect to grid. Grid server not running?"); 143 m_log.Error("Unable to connect to grid. Grid server not running?");
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 860bd93..96baf21 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -237,6 +237,26 @@ namespace OpenSim.Region.Environment
237 bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter); 237 bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter);
238 bool collisionEvents = convertParamStringToBool(packet.ParamList[1].Parameter); 238 bool collisionEvents = convertParamStringToBool(packet.ParamList[1].Parameter);
239 bool physics = convertParamStringToBool(packet.ParamList[2].Parameter); 239 bool physics = convertParamStringToBool(packet.ParamList[2].Parameter);
240
241 if (physics)
242 {
243 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics;
244 }
245 else
246 {
247 m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipPhysics;
248 }
249
250 if (scripted)
251 {
252 m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipScripts;
253 }
254 else
255 {
256 m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipScripts;
257 }
258
259
240 m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); 260 m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
241 } 261 }
242 262
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d0acded..40a80c4 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -283,6 +283,23 @@ namespace OpenSim.Region.Environment.Scenes
283 httpListener = httpServer; 283 httpListener = httpServer;
284 m_dumpAssetsToFile = dumpAssetsToFile; 284 m_dumpAssetsToFile = dumpAssetsToFile;
285 285
286 if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)
287 {
288 m_scripts_enabled = false;
289 }
290 else
291 {
292 m_scripts_enabled = true;
293 }
294 if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipPhysics) == Simulator.RegionFlags.SkipPhysics)
295 {
296 m_physics_enabled = false;
297 }
298 else
299 {
300 m_physics_enabled = true;
301 }
302
286 m_statsReporter = new SimStatsReporter(regInfo); 303 m_statsReporter = new SimStatsReporter(regInfo);
287 m_statsReporter.OnSendStatsResult += SendSimStatsPackets; 304 m_statsReporter.OnSendStatsResult += SendSimStatsPackets;
288 } 305 }
@@ -483,6 +500,37 @@ namespace OpenSim.Region.Environment.Scenes
483 if (m_scripts_enabled != !ScriptEngine) 500 if (m_scripts_enabled != !ScriptEngine)
484 { 501 {
485 // Tedd! Here's the method to disable the scripting engine! 502 // Tedd! Here's the method to disable the scripting engine!
503 if (ScriptEngine)
504 {
505 m_log.Info("Stopping all Scripts in Scene");
506 lock (Entities)
507 {
508 foreach (EntityBase ent in Entities.Values)
509 {
510 if (ent is SceneObjectGroup)
511 {
512 ((SceneObjectGroup)ent).StopScripts();
513 }
514 }
515 }
516 }
517 else
518 {
519 m_log.Info("Starting all Scripts in Scene");
520 lock (Entities)
521 {
522 foreach (EntityBase ent in Entities.Values)
523 {
524 if (ent is SceneObjectGroup)
525 {
526 ((SceneObjectGroup)ent).StartScripts();
527 }
528 }
529 }
530
531
532 }
533 m_scripts_enabled = !ScriptEngine;
486 m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); 534 m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
487 } 535 }
488 if (m_physics_enabled != !PhysicsEngine) 536 if (m_physics_enabled != !PhysicsEngine)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 1e99079..6bd0575 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -88,10 +88,14 @@ namespace OpenSim.Region.Environment.Scenes
88 /// </summary> 88 /// </summary>
89 public void StartScripts() 89 public void StartScripts()
90 { 90 {
91 foreach (SceneObjectPart part in m_parts.Values) 91 // Don't start scripts if they're turned off in the region!
92 if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
92 { 93 {
93 part.StartScripts(); 94 foreach (SceneObjectPart part in m_parts.Values)
94 } 95 {
96 part.StartScripts();
97 }
98 }
95 } 99 }
96 100
97 public void StopScripts() 101 public void StopScripts()