diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b3690b4711..4da393d2db 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -65,8 +65,17 @@ namespace OpenSim.Region.Framework.Scenes #region Fields public bool EmergencyMonitoring = false; + + /// + /// Show debug information about teleports. + /// public bool DebugTeleporting { get; private set; } + /// + /// Show debug information about the scene loop. + /// + public bool DebugUpdates { get; private set; } + public SynchronizeSceneHandler SynchronizeScene; public SimStatsReporter StatsReporter; public List NorthBorders = new List(); @@ -1070,13 +1079,24 @@ namespace OpenSim.Region.Framework.Scenes if (options.ContainsKey("physics")) { - bool enablePhysics = false; - if (bool.TryParse(options["physics"], out enablePhysics) && m_physics_enabled != enablePhysics) + bool enablePhysics; + if (bool.TryParse(options["physics"], out enablePhysics)) m_physics_enabled = enablePhysics; } if (options.ContainsKey("teleport")) - DebugTeleporting = true; + { + bool enableTeleportDebugging; + if (bool.TryParse(options["teleport"], out enableTeleportDebugging)) + DebugTeleporting = enableTeleportDebugging; + } + + if (options.ContainsKey("updates")) + { + bool enableUpdateDebugging; + if (bool.TryParse(options["updates"], out enableUpdateDebugging)) + DebugUpdates = enableUpdateDebugging; + } } public int GetInaccurateNeighborCount() @@ -1398,7 +1418,7 @@ namespace OpenSim.Region.Framework.Scenes // Tell the watchdog that this thread is still alive Watchdog.UpdateThread(); -// previousFrameTick = m_lastFrameTick; + previousFrameTick = m_lastFrameTick; m_lastFrameTick = Util.EnvironmentTickCount(); maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); maintc = (int)(MinFrameTime * 1000) - maintc; @@ -1407,12 +1427,14 @@ namespace OpenSim.Region.Framework.Scenes Thread.Sleep(maintc); // Optionally warn if a frame takes double the amount of time that it should. -// if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) -// m_log.WarnFormat( -// "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", -// Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), -// MinFrameTime * 1000, -// RegionInfo.RegionName); + if (DebugUpdates + && Util.EnvironmentTickCountSubtract( + m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) + m_log.WarnFormat( + "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", + Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), + MinFrameTime * 1000, + RegionInfo.RegionName); } }