aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
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 /OpenSim/Region/Framework/Scenes/Scene.cs
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs40
1 files changed, 37 insertions, 3 deletions
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