cleaning up: coding style guidelines violation in RestPlugin.cs.

adding support for enabled = true|false for IRCBridgeModule
0.6.0-stable
Dr Scofield 2008-05-27 12:24:29 +00:00
parent 077c6b816b
commit 34f1741866
2 changed files with 25 additions and 1 deletions

View File

@ -194,7 +194,8 @@ namespace OpenSim.ApplicationPlugins.Rest
try try
{ {
if ((_config = openSim.ConfigSource.Configs["RestPlugins"]) == null) { if ((_config = openSim.ConfigSource.Configs["RestPlugins"]) == null)
{
m_log.WarnFormat("{0} Rest Plugins not configured", MsgID); m_log.WarnFormat("{0} Rest Plugins not configured", MsgID);
return; return;
} }

View File

@ -60,12 +60,35 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
internal object m_syncInit = new object(); internal object m_syncInit = new object();
internal object m_syncLogout = new object(); internal object m_syncLogout = new object();
private IConfig m_config;
#region IRegionModule Members #region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
{ {
try
{
if ((m_config = config.Configs["IRC"]) == null)
{
m_log.InfoFormat("[IRC] module not configured");
return;
}
if (!m_config.GetBoolean("enabled", false))
{
m_log.InfoFormat("[IRC] module disabled in configuration");
return;
}
}
catch (Exception)
{
m_log.Info("[IRC] module not configured");
return;
}
lock (m_syncInit) lock (m_syncInit)
{ {
if (!m_scenes.Contains(scene)) if (!m_scenes.Contains(scene))
{ {
m_scenes.Add(scene); m_scenes.Add(scene);