aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs97
1 files changed, 65 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 790ec63..76e632e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -65,7 +65,16 @@ namespace OpenSim.Region.Framework.Scenes
65 #region Fields 65 #region Fields
66 66
67 public bool EmergencyMonitoring = false; 67 public bool EmergencyMonitoring = false;
68 public bool DEBUG = false; 68
69 /// <summary>
70 /// Show debug information about teleports.
71 /// </summary>
72 public bool DebugTeleporting { get; private set; }
73
74 /// <summary>
75 /// Show debug information about the scene loop.
76 /// </summary>
77 public bool DebugUpdates { get; private set; }
69 78
70 public SynchronizeSceneHandler SynchronizeScene; 79 public SynchronizeSceneHandler SynchronizeScene;
71 public SimStatsReporter StatsReporter; 80 public SimStatsReporter StatsReporter;
@@ -1020,44 +1029,66 @@ namespace OpenSim.Region.Framework.Scenes
1020 } 1029 }
1021 } 1030 }
1022 1031
1023 public void SetSceneCoreDebug(bool ScriptEngine, bool CollisionEvents, bool PhysicsEngine) 1032 public void SetSceneCoreDebug(Dictionary<string, string> options)
1024 { 1033 {
1025 if (m_scripts_enabled != !ScriptEngine) 1034 if (options.ContainsKey("scripting"))
1026 { 1035 {
1027 if (ScriptEngine) 1036 bool enableScripts = true;
1037 if (bool.TryParse(options["scripting"], out enableScripts) && m_scripts_enabled != enableScripts)
1028 { 1038 {
1029 m_log.Info("Stopping all Scripts in Scene"); 1039 if (!enableScripts)
1030
1031 EntityBase[] entities = Entities.GetEntities();
1032 foreach (EntityBase ent in entities)
1033 { 1040 {
1034 if (ent is SceneObjectGroup) 1041 m_log.Info("Stopping all Scripts in Scene");
1035 ((SceneObjectGroup)ent).RemoveScriptInstances(false); 1042
1043 EntityBase[] entities = Entities.GetEntities();
1044 foreach (EntityBase ent in entities)
1045 {
1046 if (ent is SceneObjectGroup)
1047 ((SceneObjectGroup)ent).RemoveScriptInstances(false);
1048 }
1036 } 1049 }
1037 } 1050 else
1038 else
1039 {
1040 m_log.Info("Starting all Scripts in Scene");
1041
1042 EntityBase[] entities = Entities.GetEntities();
1043 foreach (EntityBase ent in entities)
1044 { 1051 {
1045 if (ent is SceneObjectGroup) 1052 m_log.Info("Starting all Scripts in Scene");
1053
1054 EntityBase[] entities = Entities.GetEntities();
1055 foreach (EntityBase ent in entities)
1046 { 1056 {
1047 SceneObjectGroup sog = (SceneObjectGroup)ent; 1057 if (ent is SceneObjectGroup)
1048 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); 1058 {
1049 sog.ResumeScripts(); 1059 SceneObjectGroup sog = (SceneObjectGroup)ent;
1060 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0);
1061 sog.ResumeScripts();
1062 }
1050 } 1063 }
1051 } 1064 }
1065
1066 m_scripts_enabled = enableScripts;
1052 } 1067 }
1068 }
1053 1069
1054 m_scripts_enabled = !ScriptEngine; 1070 if (options.ContainsKey("physics"))
1055 m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); 1071 {
1072 bool enablePhysics;
1073 if (bool.TryParse(options["physics"], out enablePhysics))
1074 m_physics_enabled = enablePhysics;
1075 }
1076
1077 if (options.ContainsKey("teleport"))
1078 {
1079 bool enableTeleportDebugging;
1080 if (bool.TryParse(options["teleport"], out enableTeleportDebugging))
1081 DebugTeleporting = enableTeleportDebugging;
1056 } 1082 }
1057 1083
1058 if (m_physics_enabled != !PhysicsEngine) 1084 if (options.ContainsKey("updates"))
1059 { 1085 {
1060 m_physics_enabled = !PhysicsEngine; 1086 bool enableUpdateDebugging;
1087 if (bool.TryParse(options["updates"], out enableUpdateDebugging))
1088 {
1089 DebugUpdates = enableUpdateDebugging;
1090 GcNotify.Enabled = DebugUpdates;
1091 }
1061 } 1092 }
1062 } 1093 }
1063 1094
@@ -1382,7 +1413,7 @@ namespace OpenSim.Region.Framework.Scenes
1382 // Tell the watchdog that this thread is still alive 1413 // Tell the watchdog that this thread is still alive
1383 Watchdog.UpdateThread(); 1414 Watchdog.UpdateThread();
1384 1415
1385// previousFrameTick = m_lastFrameTick; 1416 previousFrameTick = m_lastFrameTick;
1386 m_lastFrameTick = Util.EnvironmentTickCount(); 1417 m_lastFrameTick = Util.EnvironmentTickCount();
1387 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); 1418 maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
1388 maintc = (int)(MinFrameTime * 1000) - maintc; 1419 maintc = (int)(MinFrameTime * 1000) - maintc;
@@ -1391,12 +1422,14 @@ namespace OpenSim.Region.Framework.Scenes
1391 Thread.Sleep(maintc); 1422 Thread.Sleep(maintc);
1392 1423
1393 // Optionally warn if a frame takes double the amount of time that it should. 1424 // Optionally warn if a frame takes double the amount of time that it should.
1394// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) 1425 if (DebugUpdates
1395// m_log.WarnFormat( 1426 && Util.EnvironmentTickCountSubtract(
1396// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", 1427 m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2))
1397// Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), 1428 m_log.WarnFormat(
1398// MinFrameTime * 1000, 1429 "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}",
1399// RegionInfo.RegionName); 1430 Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick),
1431 MinFrameTime * 1000,
1432 RegionInfo.RegionName);
1400 } 1433 }
1401 } 1434 }
1402 1435