Delay loading scripts until the scene has finished loading
parent
7cafc2e46e
commit
1dd904b78e
|
@ -411,6 +411,8 @@ namespace OpenSim
|
|||
|
||||
scene.StartTimer();
|
||||
|
||||
scene.StartScripts();
|
||||
|
||||
return clientServer;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,5 +52,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
ArrayList GetScriptErrors(UUID itemID);
|
||||
|
||||
void SaveAllState();
|
||||
|
||||
/// <summary>
|
||||
/// Starts the processing threads.
|
||||
/// </summary>
|
||||
void StartProcessing();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue