* Added the ability to start and stop all scripts in the simulator using the debug tab on the estate tools. This along with the disable physics via the debug tab are persistant across reboots. That means that if it's disabled when you shut down the simulator, the simulator will come up again when you start it up without loading the scripts. Turning them back on is as simple as unchecking 'disable scripts' in the debug tab of the estate tools.
parent
4ec4e2cb32
commit
9d6ea497e2
|
@ -137,7 +137,7 @@ namespace OpenSim.Region.Communications.OGS1
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
||||||
GridResp = GridReq.Send(serversInfo.GridURL, 10000);
|
GridResp = GridReq.Send(serversInfo.GridURL, 16000);
|
||||||
} catch (Exception ex)
|
} catch (Exception ex)
|
||||||
{
|
{
|
||||||
m_log.Error("Unable to connect to grid. Grid server not running?");
|
m_log.Error("Unable to connect to grid. Grid server not running?");
|
||||||
|
|
|
@ -237,6 +237,26 @@ namespace OpenSim.Region.Environment
|
||||||
bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter);
|
bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter);
|
||||||
bool collisionEvents = convertParamStringToBool(packet.ParamList[1].Parameter);
|
bool collisionEvents = convertParamStringToBool(packet.ParamList[1].Parameter);
|
||||||
bool physics = convertParamStringToBool(packet.ParamList[2].Parameter);
|
bool physics = convertParamStringToBool(packet.ParamList[2].Parameter);
|
||||||
|
|
||||||
|
if (physics)
|
||||||
|
{
|
||||||
|
m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipPhysics;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipPhysics;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scripted)
|
||||||
|
{
|
||||||
|
m_scene.RegionInfo.EstateSettings.regionFlags |= Simulator.RegionFlags.SkipScripts;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_scene.RegionInfo.EstateSettings.regionFlags &= ~Simulator.RegionFlags.SkipScripts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
|
m_scene.SetSceneCoreDebug(scripted, collisionEvents, physics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -283,6 +283,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
httpListener = httpServer;
|
httpListener = httpServer;
|
||||||
m_dumpAssetsToFile = dumpAssetsToFile;
|
m_dumpAssetsToFile = dumpAssetsToFile;
|
||||||
|
|
||||||
|
if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)
|
||||||
|
{
|
||||||
|
m_scripts_enabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_scripts_enabled = true;
|
||||||
|
}
|
||||||
|
if ((RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipPhysics) == Simulator.RegionFlags.SkipPhysics)
|
||||||
|
{
|
||||||
|
m_physics_enabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_physics_enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_statsReporter = new SimStatsReporter(regInfo);
|
m_statsReporter = new SimStatsReporter(regInfo);
|
||||||
m_statsReporter.OnSendStatsResult += SendSimStatsPackets;
|
m_statsReporter.OnSendStatsResult += SendSimStatsPackets;
|
||||||
}
|
}
|
||||||
|
@ -483,6 +500,37 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (m_scripts_enabled != !ScriptEngine)
|
if (m_scripts_enabled != !ScriptEngine)
|
||||||
{
|
{
|
||||||
// Tedd! Here's the method to disable the scripting engine!
|
// Tedd! Here's the method to disable the scripting engine!
|
||||||
|
if (ScriptEngine)
|
||||||
|
{
|
||||||
|
m_log.Info("Stopping all Scripts in Scene");
|
||||||
|
lock (Entities)
|
||||||
|
{
|
||||||
|
foreach (EntityBase ent in Entities.Values)
|
||||||
|
{
|
||||||
|
if (ent is SceneObjectGroup)
|
||||||
|
{
|
||||||
|
((SceneObjectGroup)ent).StopScripts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.Info("Starting all Scripts in Scene");
|
||||||
|
lock (Entities)
|
||||||
|
{
|
||||||
|
foreach (EntityBase ent in Entities.Values)
|
||||||
|
{
|
||||||
|
if (ent is SceneObjectGroup)
|
||||||
|
{
|
||||||
|
((SceneObjectGroup)ent).StartScripts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
m_scripts_enabled = !ScriptEngine;
|
||||||
m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
|
m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
|
||||||
}
|
}
|
||||||
if (m_physics_enabled != !PhysicsEngine)
|
if (m_physics_enabled != !PhysicsEngine)
|
||||||
|
|
|
@ -87,12 +87,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// Start the scripts contained in all the prims in this group.
|
/// Start the scripts contained in all the prims in this group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StartScripts()
|
public void StartScripts()
|
||||||
|
{
|
||||||
|
// Don't start scripts if they're turned off in the region!
|
||||||
|
if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.StartScripts();
|
part.StartScripts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void StopScripts()
|
public void StopScripts()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue