When module settings are not found in a file check the main settings.
If the module enable setting is not found the module will be disabled. Minor changes to info messages output while looking for configuration.pull/1/head
parent
ef2146a503
commit
1091ddeafe
|
@ -115,7 +115,7 @@ namespace Flocking
|
||||||
string moduleConfigFile = Path.Combine(m_regionConfigDir, "Regions.ini");
|
string moduleConfigFile = Path.Combine(m_regionConfigDir, "Regions.ini");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[{0}]: Checking {1} for [{2}] section containing valid config keys", m_name, moduleConfigFile, scene.RegionInfo.RegionName);
|
m_log.InfoFormat("[{0}]: Checking {1} for [{2}] section", m_name, moduleConfigFile, scene.RegionInfo.RegionName);
|
||||||
m_config = new IniConfigSource(moduleConfigFile);
|
m_config = new IniConfigSource(moduleConfigFile);
|
||||||
cnf = m_config.Configs[scene.RegionInfo.RegionName];
|
cnf = m_config.Configs[scene.RegionInfo.RegionName];
|
||||||
}
|
}
|
||||||
|
@ -126,13 +126,18 @@ namespace Flocking
|
||||||
|
|
||||||
if (cnf == null)
|
if (cnf == null)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[{0}]: No region section [{1}] found in configuration {2}. Birds in this region are set to Disabled", m_name, scene.RegionInfo.RegionName, moduleConfigFile);
|
m_log.InfoFormat("[{0}]: No region section [{1}] found in configuration {2}.", m_name, scene.RegionInfo.RegionName, moduleConfigFile);
|
||||||
m_enabled = false;
|
|
||||||
return;
|
cnf = m_config.Configs[scene.RegionInfo.RegionName];
|
||||||
|
if (cnf == null)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("[{0}]: No region section [{1}] found in main configuration. Module is disabled.", m_name, scene.RegionInfo.RegionName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_startup = cnf.GetBoolean("BirdsModuleStartup", true);
|
m_startup = cnf.GetBoolean("BirdsModuleStartup", false);
|
||||||
|
|
||||||
if (m_startup)
|
if (m_startup)
|
||||||
{
|
{
|
||||||
|
@ -208,7 +213,7 @@ namespace Flocking
|
||||||
|
|
||||||
FlockInitialise();
|
FlockInitialise();
|
||||||
}
|
}
|
||||||
else m_log.InfoFormat("[{0}] Module is disabled in Region {1}", m_name, scene.RegionInfo.RegionName);
|
else m_log.InfoFormat("[{0}] Module is disabled in region {1}", m_name, scene.RegionInfo.RegionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegionLoaded (Scene scene)
|
public void RegionLoaded (Scene scene)
|
||||||
|
|
Loading…
Reference in New Issue