From 0fa303b1cf244b3066395413e640318b2122c19f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 20 Jun 2012 00:10:19 +0100
Subject: Log how many scripts are candidates for starting and how many are
actually started.
Adds DebugLevel infrastructure to XEngine though currently commented out and unused.
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index b59fd05..e413281 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -60,19 +60,32 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Creates all the scripts in the scene which should be started.
///
- public void CreateScriptInstances()
+ ///
+ /// Number of scripts that were valid for starting. This does not guarantee that all these scripts
+ /// were actually started, but just that the start could be attempt (e.g. the asset data for the script could be found)
+ ///
+ public int CreateScriptInstances()
{
- m_log.Info("[PRIM INVENTORY]: Creating scripts in scene");
+ m_log.InfoFormat("[SCENE]: Initializing script instances in {0}", RegionInfo.RegionName);
+
+ int scriptsValidForStarting = 0;
EntityBase[] entities = Entities.GetEntities();
foreach (EntityBase group in entities)
{
if (group is SceneObjectGroup)
{
- ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0);
+ scriptsValidForStarting
+ += ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0);
((SceneObjectGroup) group).ResumeScripts();
}
}
+
+ m_log.InfoFormat(
+ "[SCENE]: Initialized {0} script instances in {1}",
+ scriptsValidForStarting, RegionInfo.RegionName);
+
+ return scriptsValidForStarting;
}
///
@@ -80,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void StartScripts()
{
- m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
+ m_log.InfoFormat("[SCENE]: Starting scripts in {0}, please wait.", RegionInfo.RegionName);
IScriptModule[] engines = RequestModuleInterfaces();
--
cgit v1.1