this fixes the crash reported by mantis #2046: user server crashing if
no OpenSim.ini file found by GridInfoService. GridInfoService now will just issue a warning that GridInfo will NOT be available to your users if no OpenSim.ini file is available. due to the static nature of UserConfig (configuration options hardcoded) i don't think it's currently an option to move GridInfo into user_server.xml but if anyone wants to look into this i'd be delighted...0.6.0-stable
parent
49f9bd8b68
commit
4a3523bc67
|
@ -56,6 +56,27 @@ namespace OpenSim.Framework.Communications
|
||||||
/// system.
|
/// system.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public GridInfoService(IConfigSource configSource)
|
public GridInfoService(IConfigSource configSource)
|
||||||
|
{
|
||||||
|
loadGridInfo(configSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor, uses OpenSim.ini.
|
||||||
|
/// </summary>
|
||||||
|
public GridInfoService()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IConfigSource configSource = new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini"));
|
||||||
|
loadGridInfo(configSource);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
_log.Warn("[GridInfoService] no OpenSim.ini file found --- GridInfoServices WILL NOT BE AVAILABLE to your users");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadGridInfo(IConfigSource configSource)
|
||||||
{
|
{
|
||||||
_info["platform"] = "OpenSim";
|
_info["platform"] = "OpenSim";
|
||||||
try
|
try
|
||||||
|
@ -98,13 +119,7 @@ namespace OpenSim.Framework.Communications
|
||||||
_log.Debug("[GridInfoService] cannot get grid info from config source, using minimal defaults");
|
_log.Debug("[GridInfoService] cannot get grid info from config source, using minimal defaults");
|
||||||
}
|
}
|
||||||
_log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count);
|
_log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count);
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Default constructor, uses OpenSim.ini.
|
|
||||||
/// </summary>
|
|
||||||
public GridInfoService() : this(new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini")))
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void IssueWarning()
|
private void IssueWarning()
|
||||||
|
|
Loading…
Reference in New Issue