From 1dd904b78e723af8cb4340415a8f41dcd1054541 Mon Sep 17 00:00:00 2001
From: Oren Hurvitz
Date: Mon, 5 Sep 2011 12:45:02 +0300
Subject: Delay loading scripts until the scene has finished loading
---
.../Region/Framework/Interfaces/IScriptModule.cs | 5 +++++
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 24 ++++++++++++++++++++--
2 files changed, 27 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index d9752e6..b27b7da 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -52,5 +52,10 @@ namespace OpenSim.Region.Framework.Interfaces
ArrayList GetScriptErrors(UUID itemID);
void SaveAllState();
+
+ ///
+ /// Starts the processing threads.
+ ///
+ void StartProcessing();
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 4700c3b..9dcd10a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -57,11 +57,11 @@ namespace OpenSim.Region.Framework.Scenes
protected AsyncInventorySender m_asyncInventorySender;
///
- /// Start all the scripts in the scene which should be started.
+ /// Creates all the scripts in the scene which should be started.
///
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
}
}
+ ///
+ /// Lets the script engines start processing scripts.
+ ///
+ public void StartScripts()
+ {
+ m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
+
+ IScriptModule[] engines = RequestModuleInterfaces();
+ if (engines != null)
+ {
+ foreach (IScriptModule engine in engines)
+ {
+ if (engine != null)
+ {
+ engine.StartProcessing();
+ }
+ }
+ }
+ }
+
public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
{
IMoneyModule money = RequestModuleInterface();
--
cgit v1.1