mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
This commit is contained in:
@@ -85,16 +85,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
if (modulesConfig == null)
|
||||
modulesConfig = m_openSim.ConfigSource.Source.AddConfig("Modules");
|
||||
|
||||
Dictionary<RuntimeAddin, IList<int>> loadedModules = new Dictionary<RuntimeAddin, IList<int>>();
|
||||
|
||||
// Scan modules and load all that aren't disabled
|
||||
foreach (TypeExtensionNode node in
|
||||
AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
|
||||
{
|
||||
IList<int> loadedModuleData;
|
||||
|
||||
if (!loadedModules.ContainsKey(node.Addin))
|
||||
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
|
||||
|
||||
loadedModuleData = loadedModules[node.Addin];
|
||||
|
||||
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_sharedModules.Add(node);
|
||||
loadedModuleData[0]++;
|
||||
}
|
||||
}
|
||||
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
|
||||
@@ -103,14 +113,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_nonSharedModules.Add(node);
|
||||
loadedModuleData[1]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
|
||||
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
|
||||
loadedModuleData[2]++;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<RuntimeAddin, IList<int>> loadedModuleData in loadedModules)
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[REGIONMODULES]: From plugin {0}, (version {1}), loaded {2} modules, {3} shared, {4} non-shared {5} unknown",
|
||||
loadedModuleData.Key.Id,
|
||||
loadedModuleData.Key.Version,
|
||||
loadedModuleData.Value[0] + loadedModuleData.Value[1] + loadedModuleData.Value[2],
|
||||
loadedModuleData.Value[0], loadedModuleData.Value[1], loadedModuleData.Value[2]);
|
||||
}
|
||||
|
||||
// Load and init the module. We try a constructor with a port
|
||||
// if a port was given, fall back to one without if there is
|
||||
// no port or the more specific constructor fails.
|
||||
|
||||
@@ -932,7 +932,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
string grant = startupConfig.GetString("AllowedClients", String.Empty);
|
||||
string[] possibleAccessControlConfigSections = new string[] { "AccessControl", "Startup" };
|
||||
|
||||
string grant
|
||||
= Util.GetConfigVarFromSections<string>(
|
||||
config, "AllowedClients", possibleAccessControlConfigSections, "");
|
||||
|
||||
if (grant.Length > 0)
|
||||
{
|
||||
foreach (string viewer in grant.Split('|'))
|
||||
@@ -941,7 +946,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
grant = startupConfig.GetString("BannedClients", String.Empty);
|
||||
grant
|
||||
= Util.GetConfigVarFromSections<string>(
|
||||
config, "BannedClients", possibleAccessControlConfigSections, "");
|
||||
|
||||
if (grant.Length > 0)
|
||||
{
|
||||
foreach (string viewer in grant.Split('|'))
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule
|
||||
public class WebSocketEchoModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool enabled;
|
||||
public string Name { get { return "WebSocketEchoModule"; } }
|
||||
|
||||
@@ -55,9 +56,9 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule
|
||||
|
||||
public void Initialise(IConfigSource pConfig)
|
||||
{
|
||||
enabled =(pConfig.Configs["WebSocketEcho"] != null);
|
||||
if (enabled)
|
||||
m_log.DebugFormat("[WebSocketEchoModule]: INITIALIZED MODULE");
|
||||
enabled = (pConfig.Configs["WebSocketEcho"] != null);
|
||||
// if (enabled)
|
||||
// m_log.DebugFormat("[WebSocketEchoModule]: INITIALIZED MODULE");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -158,17 +159,17 @@ namespace OpenSim.Region.OptionalModules.WebSocketEchoModule
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} ADDED", scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} ADDED", scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} LOADED", scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[WebSocketEchoModule]: REGION {0} LOADED", scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user