aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Application/OpenSim.cs19
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs55
3 files changed, 45 insertions, 37 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index e955a58..169efbd 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -919,7 +919,7 @@ namespace OpenSim
919 break; 919 break;
920 920
921 case "scene": 921 case "scene":
922 if (args.Length == 5) 922 if (args.Length == 4)
923 { 923 {
924 if (m_sceneManager.CurrentScene == null) 924 if (m_sceneManager.CurrentScene == null)
925 { 925 {
@@ -927,20 +927,17 @@ namespace OpenSim
927 } 927 }
928 else 928 else
929 { 929 {
930 bool scriptingOn = !Convert.ToBoolean(args[2]); 930 string key = args[2];
931 bool collisionsOn = !Convert.ToBoolean(args[3]); 931 string value = args[3];
932 bool physicsOn = !Convert.ToBoolean(args[4]); 932 m_sceneManager.CurrentScene.SetSceneCoreDebug(
933 m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); 933 new Dictionary<string, string>() { { key, value } });
934 934
935 MainConsole.Instance.Output( 935 MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value);
936 String.Format(
937 "Set debug scene scripting = {0}, collisions = {1}, physics = {2}",
938 !scriptingOn, !collisionsOn, !physicsOn));
939 } 936 }
940 } 937 }
941 else 938 else
942 { 939 {
943 MainConsole.Instance.Output("Usage: debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); 940 MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics true|false");
944 } 941 }
945 942
946 break; 943 break;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 1adeb88..fc217b0 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -670,7 +670,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
670 Scene.RegionInfo.RegionSettings.Save(); 670 Scene.RegionInfo.RegionSettings.Save();
671 TriggerRegionInfoChange(); 671 TriggerRegionInfoChange();
672 672
673 Scene.SetSceneCoreDebug(disableScripts, disableCollisions, disablePhysics); 673 Scene.SetSceneCoreDebug(
674 new Dictionary<string, string>() {
675 { "scripting", (!disableScripts).ToString() },
676 { "collisions", (!disableCollisions).ToString() },
677 { "physics", (!disablePhysics).ToString() }
678 }
679 );
674 } 680 }
675 681
676 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) 682 private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 790ec63..f2200da 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1020,44 +1020,49 @@ namespace OpenSim.Region.Framework.Scenes
1020 } 1020 }
1021 } 1021 }
1022 1022
1023 public void SetSceneCoreDebug(bool ScriptEngine, bool CollisionEvents, bool PhysicsEngine) 1023 public void SetSceneCoreDebug(Dictionary<string, string> options)
1024 { 1024 {
1025 if (m_scripts_enabled != !ScriptEngine) 1025 if (options.ContainsKey("scripting"))
1026 { 1026 {
1027 if (ScriptEngine) 1027 bool enableScripts = true;
1028 if (bool.TryParse(options["scripting"], out enableScripts) && m_scripts_enabled != enableScripts)
1028 { 1029 {
1029 m_log.Info("Stopping all Scripts in Scene"); 1030 if (!enableScripts)
1030
1031 EntityBase[] entities = Entities.GetEntities();
1032 foreach (EntityBase ent in entities)
1033 { 1031 {
1034 if (ent is SceneObjectGroup) 1032 m_log.Info("Stopping all Scripts in Scene");
1035 ((SceneObjectGroup)ent).RemoveScriptInstances(false); 1033
1034 EntityBase[] entities = Entities.GetEntities();
1035 foreach (EntityBase ent in entities)
1036 {
1037 if (ent is SceneObjectGroup)
1038 ((SceneObjectGroup)ent).RemoveScriptInstances(false);
1039 }
1036 } 1040 }
1037 } 1041 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 { 1042 {
1045 if (ent is SceneObjectGroup) 1043 m_log.Info("Starting all Scripts in Scene");
1044
1045 EntityBase[] entities = Entities.GetEntities();
1046 foreach (EntityBase ent in entities)
1046 { 1047 {
1047 SceneObjectGroup sog = (SceneObjectGroup)ent; 1048 if (ent is SceneObjectGroup)
1048 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); 1049 {
1049 sog.ResumeScripts(); 1050 SceneObjectGroup sog = (SceneObjectGroup)ent;
1051 sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0);
1052 sog.ResumeScripts();
1053 }
1050 } 1054 }
1051 } 1055 }
1052 }
1053 1056
1054 m_scripts_enabled = !ScriptEngine; 1057 m_scripts_enabled = enableScripts;
1055 m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); 1058 }
1056 } 1059 }
1057 1060
1058 if (m_physics_enabled != !PhysicsEngine) 1061 if (options.ContainsKey("physics"))
1059 { 1062 {
1060 m_physics_enabled = !PhysicsEngine; 1063 bool enablePhysics = false;
1064 if (bool.TryParse(options["physics"], out enablePhysics) && m_physics_enabled != enablePhysics)
1065 m_physics_enabled = enablePhysics;
1061 } 1066 }
1062 } 1067 }
1063 1068