From 7476b26ae77733ad2015b70946e42c39d56edca6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 2 Feb 2008 17:43:21 +0000 Subject: [PATCH] * Added a way to temporarily disable physics using the estate tools * Added a method for Tedd to hook to in scene to disable the Scripting engine that currently says, [TOTEDD] Here is the method to trigger disabling of the scripting engine. --- OpenSim/Region/Environment/EstateManager.cs | 16 ++++++++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 24 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs index 9700e6ca04..edc86e58ab 100644 --- a/OpenSim/Region/Environment/EstateManager.cs +++ b/OpenSim/Region/Environment/EstateManager.cs @@ -216,12 +216,28 @@ namespace OpenSim.Region.Environment SendEstateBlueBoxMessage(remote_client, packet); } break; + case "setregiondebug": + if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId)) + { + SetRegionDebug(remote_client, packet); + } + break; default: MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString()); break; } } + private void SetRegionDebug(IClientAPI remote_client, EstateOwnerMessagePacket packet) + { + LLUUID invoice = packet.MethodData.Invoice; + LLUUID SenderID = packet.AgentData.AgentID; + bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter); + bool collisionEvents = convertParamStringToBool(packet.ParamList[1].Parameter); + bool physics = convertParamStringToBool(packet.ParamList[2].Parameter); + m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics); + } + private void SendSimulatorBlueBoxMessage(IClientAPI remote_client, EstateOwnerMessagePacket packet) { LLUUID invoice = packet.MethodData.Invoice; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 6defe300ea..464a29ae2d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -130,6 +130,11 @@ namespace OpenSim.Region.Environment.Scenes private int physicsMS = 0; private int otherMS = 0; + private bool m_physics_enabled = true; + private bool m_physics_collisions_enabled = true; + private bool m_scripts_enabled = true; + + #endregion @@ -475,6 +480,21 @@ namespace OpenSim.Region.Environment.Scenes } } + public void SetSceneCoreDebug(bool ScriptEngine, bool CollisionEvents, bool PhysicsEngine) + { + if (m_scripts_enabled != !ScriptEngine) + { + // Tedd! Here's the method to disable the scripting engine! + MainLog.Instance.Verbose("TOTEDD", "Here is the method to trigger disabling of the scripting engine"); + } + if (m_physics_enabled != !PhysicsEngine) + { + m_physics_enabled = !PhysicsEngine; + + } + + } + // This is the method that shuts down the scene. public override void Close() { @@ -575,7 +595,7 @@ namespace OpenSim.Region.Environment.Scenes physicsMS2 = System.Environment.TickCount; - if (m_frame%m_update_physics == 0) + if ((m_frame%m_update_physics == 0) && m_physics_enabled) m_innerScene.UpdatePreparePhysics(); physicsMS2 = System.Environment.TickCount - physicsMS2; @@ -583,7 +603,7 @@ namespace OpenSim.Region.Environment.Scenes m_innerScene.UpdateEntityMovement(); physicsMS = System.Environment.TickCount; - if (m_frame%m_update_physics == 0) + if ((m_frame%m_update_physics == 0) && m_physics_enabled) physicsFPS = m_innerScene.UpdatePhysics( Math.Max(SinceLastFrame.TotalSeconds, m_timespan) );