* 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.

ThreadPoolClientBranch
Teravus Ovares 2008-02-06 09:38:14 +00:00
parent 4ec4e2cb32
commit 9d6ea497e2
4 changed files with 76 additions and 4 deletions

View File

@ -137,7 +137,7 @@ namespace OpenSim.Region.Communications.OGS1
try
{
GridReq = new XmlRpcRequest("simulator_login", SendParams);
GridResp = GridReq.Send(serversInfo.GridURL, 10000);
GridResp = GridReq.Send(serversInfo.GridURL, 16000);
} catch (Exception ex)
{
m_log.Error("Unable to connect to grid. Grid server not running?");

View File

@ -237,6 +237,26 @@ namespace OpenSim.Region.Environment
bool scripted = convertParamStringToBool(packet.ParamList[0].Parameter);
bool collisionEvents = convertParamStringToBool(packet.ParamList[1].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);
}

View File

@ -283,6 +283,23 @@ namespace OpenSim.Region.Environment.Scenes
httpListener = httpServer;
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.OnSendStatsResult += SendSimStatsPackets;
}
@ -483,6 +500,37 @@ namespace OpenSim.Region.Environment.Scenes
if (m_scripts_enabled != !ScriptEngine)
{
// 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");
}
if (m_physics_enabled != !PhysicsEngine)

View File

@ -88,10 +88,14 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void StartScripts()
{
foreach (SceneObjectPart part in m_parts.Values)
// Don't start scripts if they're turned off in the region!
if (!((m_scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
{
part.StartScripts();
}
foreach (SceneObjectPart part in m_parts.Values)
{
part.StartScripts();
}
}
}
public void StopScripts()