Delay loading scripts until the scene has finished loading

remove-scene-viewer
Oren Hurvitz 2011-09-05 12:45:02 +03:00 committed by Justin Clark-Casey (justincc)
parent 7cafc2e46e
commit 1dd904b78e
4 changed files with 32 additions and 2 deletions

View File

@ -411,6 +411,8 @@ namespace OpenSim
scene.StartTimer();
scene.StartScripts();
return clientServer;
}

View File

@ -52,5 +52,10 @@ namespace OpenSim.Region.Framework.Interfaces
ArrayList GetScriptErrors(UUID itemID);
void SaveAllState();
/// <summary>
/// Starts the processing threads.
/// </summary>
void StartProcessing();
}
}

View File

@ -57,11 +57,11 @@ namespace OpenSim.Region.Framework.Scenes
protected AsyncInventorySender m_asyncInventorySender;
/// <summary>
/// Start all the scripts in the scene which should be started.
/// Creates all the scripts in the scene which should be started.
/// </summary>
public void CreateScriptInstances()
{
m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
m_log.Info("[PRIM INVENTORY]: Creating scripts in scene");
EntityBase[] entities = Entities.GetEntities();
foreach (EntityBase group in entities)
@ -74,6 +74,26 @@ namespace OpenSim.Region.Framework.Scenes
}
}
/// <summary>
/// Lets the script engines start processing scripts.
/// </summary>
public void StartScripts()
{
m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>();
if (engines != null)
{
foreach (IScriptModule engine in engines)
{
if (engine != null)
{
engine.StartProcessing();
}
}
}
}
public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
{
IMoneyModule money = RequestModuleInterface<IMoneyModule>();

View File

@ -339,7 +339,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoBackup),
new Object[] { m_SaveTime });
}
}
public void StartProcessing()
{
m_ThreadPool.Start();
}