aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RegionModulesController
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-03-02 00:56:53 +0000
committerJustin Clark-Casey (justincc)2013-03-02 00:56:53 +0000
commitc91753c065ec67491b94386b06d742a328ccffd4 (patch)
treefe4ce541d8e89243057c681af1134ff5f4f86347 /OpenSim/ApplicationPlugins/RegionModulesController
parentMoved permissions config vars out of [Startup] into [Permissions]. Backwards ... (diff)
downloadopensim-SC_OLD-c91753c065ec67491b94386b06d742a328ccffd4.zip
opensim-SC_OLD-c91753c065ec67491b94386b06d742a328ccffd4.tar.gz
opensim-SC_OLD-c91753c065ec67491b94386b06d742a328ccffd4.tar.bz2
opensim-SC_OLD-c91753c065ec67491b94386b06d742a328ccffd4.tar.xz
minor: Log number of region modules loaded from each plugin
Diffstat (limited to 'OpenSim/ApplicationPlugins/RegionModulesController')
-rw-r--r--OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
index 633d005..510be37 100644
--- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
@@ -85,16 +85,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
85 if (modulesConfig == null) 85 if (modulesConfig == null)
86 modulesConfig = m_openSim.ConfigSource.Source.AddConfig("Modules"); 86 modulesConfig = m_openSim.ConfigSource.Source.AddConfig("Modules");
87 87
88 Dictionary<RuntimeAddin, IList<int>> loadedModules = new Dictionary<RuntimeAddin, IList<int>>();
89
88 // Scan modules and load all that aren't disabled 90 // Scan modules and load all that aren't disabled
89 foreach (TypeExtensionNode node in 91 foreach (TypeExtensionNode node in
90 AddinManager.GetExtensionNodes("/OpenSim/RegionModules")) 92 AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
91 { 93 {
94 IList<int> loadedModuleData;
95
96 if (!loadedModules.ContainsKey(node.Addin))
97 loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
98
99 loadedModuleData = loadedModules[node.Addin];
100
92 if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null) 101 if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
93 { 102 {
94 if (CheckModuleEnabled(node, modulesConfig)) 103 if (CheckModuleEnabled(node, modulesConfig))
95 { 104 {
96 m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type); 105 m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
97 m_sharedModules.Add(node); 106 m_sharedModules.Add(node);
107 loadedModuleData[0]++;
98 } 108 }
99 } 109 }
100 else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null) 110 else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
@@ -103,14 +113,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
103 { 113 {
104 m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type); 114 m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
105 m_nonSharedModules.Add(node); 115 m_nonSharedModules.Add(node);
116 loadedModuleData[1]++;
106 } 117 }
107 } 118 }
108 else 119 else
109 { 120 {
110 m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type); 121 m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
122 loadedModuleData[2]++;
111 } 123 }
112 } 124 }
113 125
126 foreach (KeyValuePair<RuntimeAddin, IList<int>> loadedModuleData in loadedModules)
127 {
128 m_log.InfoFormat(
129 "[REGIONMODULES]: From plugin {0}, (version {1}), loaded {2} modules, {3} shared, {4} non-shared {5} unknown",
130 loadedModuleData.Key.Id,
131 loadedModuleData.Key.Version,
132 loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2],
133 loadedModuleData.Value[0], loadedModuleData.Value[1], loadedModuleData.Value[2]);
134 }
135
114 // Load and init the module. We try a constructor with a port 136 // Load and init the module. We try a constructor with a port
115 // if a port was given, fall back to one without if there is 137 // if a port was given, fall back to one without if there is
116 // no port or the more specific constructor fails. 138 // no port or the more specific constructor fails.