aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-12 02:52:08 +0100
committerJustin Clark-Casey (justincc)2012-10-12 02:52:08 +0100
commitb5a3c74a5cbd1634d021923124a997fc4945e5ef (patch)
tree30e1f1557ade5031c59600b003c840c7f9886f93
parentminor: Use && instead of & when deciding whether to print Improve/ObjectUpdat... (diff)
downloadopensim-SC_OLD-b5a3c74a5cbd1634d021923124a997fc4945e5ef.zip
opensim-SC_OLD-b5a3c74a5cbd1634d021923124a997fc4945e5ef.tar.gz
opensim-SC_OLD-b5a3c74a5cbd1634d021923124a997fc4945e5ef.tar.bz2
opensim-SC_OLD-b5a3c74a5cbd1634d021923124a997fc4945e5ef.tar.xz
Add "active true|false" to "debug scene" console command.
This allows the scene update and maintenance loops to be started and stopped for debug purposes.
-rw-r--r--OpenSim/Region/Application/OpenSim.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs40
2 files changed, 47 insertions, 6 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index c3c612f..b24641a 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -254,8 +254,14 @@ namespace OpenSim
254 m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); 254 m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
255 255
256 m_console.Commands.AddCommand("Debug", false, "debug scene", 256 m_console.Commands.AddCommand("Debug", false, "debug scene",
257 "debug scene <scripting> <collisions> <physics>", 257 "debug scene active|collisions|physics|scripting|teleport true|false",
258 "Turn on scene debugging", Debug); 258 "Turn on scene debugging.",
259 "If active is false then main scene update and maintenance loops are suspended.\n"
260 + "If collisions is false then collisions with other objects are turned off.\n"
261 + "If physics is false then all physics objects are non-physical.\n"
262 + "If scripting is false then no scripting operations happen.\n"
263 + "If teleport is true then some extra teleport debug information is logged.",
264 Debug);
259 265
260 m_console.Commands.AddCommand("General", false, "change region", 266 m_console.Commands.AddCommand("General", false, "change region",
261 "change region <region name>", 267 "change region <region name>",
@@ -930,7 +936,8 @@ namespace OpenSim
930 } 936 }
931 else 937 else
932 { 938 {
933 MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false"); 939 MainConsole.Instance.Output(
940 "Usage: debug scene active|scripting|collisions|physics|teleport true|false");
934 } 941 }
935 942
936 break; 943 break;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fb2decc..7f4f7e5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -306,6 +306,30 @@ namespace OpenSim.Region.Framework.Scenes
306 } 306 }
307 private volatile bool m_shuttingDown; 307 private volatile bool m_shuttingDown;
308 308
309 /// <summary>
310 /// Is the scene active?
311 /// </summary>
312 /// <remarks>
313 /// If false, maintenance and update loops are not run.
314 /// </remarks>
315 public bool Active
316 {
317 get { return m_active; }
318 set
319 {
320 if (value)
321 {
322 if (!m_active)
323 Start();
324 }
325 else
326 {
327 m_active = false;
328 }
329 }
330 }
331 private volatile bool m_active;
332
309// private int m_lastUpdate; 333// private int m_lastUpdate;
310// private bool m_firstHeartbeat = true; 334// private bool m_firstHeartbeat = true;
311 335
@@ -1159,6 +1183,14 @@ namespace OpenSim.Region.Framework.Scenes
1159 1183
1160 public void SetSceneCoreDebug(Dictionary<string, string> options) 1184 public void SetSceneCoreDebug(Dictionary<string, string> options)
1161 { 1185 {
1186 if (options.ContainsKey("active"))
1187 {
1188 bool active;
1189
1190 if (bool.TryParse(options["active"], out active))
1191 Active = active;
1192 }
1193
1162 if (options.ContainsKey("scripting")) 1194 if (options.ContainsKey("scripting"))
1163 { 1195 {
1164 bool enableScripts = true; 1196 bool enableScripts = true;
@@ -1298,6 +1330,8 @@ namespace OpenSim.Region.Framework.Scenes
1298 /// </summary> 1330 /// </summary>
1299 public void Start() 1331 public void Start()
1300 { 1332 {
1333 m_active = true;
1334
1301// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName); 1335// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
1302 1336
1303 //m_heartbeatTimer.Enabled = true; 1337 //m_heartbeatTimer.Enabled = true;
@@ -1339,7 +1373,7 @@ namespace OpenSim.Region.Framework.Scenes
1339 #region Update Methods 1373 #region Update Methods
1340 1374
1341 /// <summary> 1375 /// <summary>
1342 /// Performs per-frame updates regularly 1376 /// Activate the various loops necessary to continually update the scene.
1343 /// </summary> 1377 /// </summary>
1344 private void Heartbeat() 1378 private void Heartbeat()
1345 { 1379 {
@@ -1396,7 +1430,7 @@ namespace OpenSim.Region.Framework.Scenes
1396 List<Vector3> coarseLocations; 1430 List<Vector3> coarseLocations;
1397 List<UUID> avatarUUIDs; 1431 List<UUID> avatarUUIDs;
1398 1432
1399 while (!m_shuttingDown && (endRun == null || MaintenanceRun < endRun)) 1433 while (Active && !m_shuttingDown && (endRun == null || MaintenanceRun < endRun))
1400 { 1434 {
1401 runtc = Util.EnvironmentTickCount(); 1435 runtc = Util.EnvironmentTickCount();
1402 ++MaintenanceRun; 1436 ++MaintenanceRun;
@@ -1455,7 +1489,7 @@ namespace OpenSim.Region.Framework.Scenes
1455 int previousFrameTick, tmpMS; 1489 int previousFrameTick, tmpMS;
1456 int maintc = Util.EnvironmentTickCount(); 1490 int maintc = Util.EnvironmentTickCount();
1457 1491
1458 while (!m_shuttingDown && (endFrame == null || Frame < endFrame)) 1492 while (Active && !m_shuttingDown && (endFrame == null || Frame < endFrame))
1459 { 1493 {
1460 ++Frame; 1494 ++Frame;
1461 1495