mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
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...
This commit is contained in:
@@ -56,6 +56,27 @@ namespace OpenSim.Framework.Communications
|
||||
/// system.
|
||||
/// </remarks>
|
||||
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";
|
||||
try
|
||||
@@ -98,13 +119,7 @@ namespace OpenSim.Framework.Communications
|
||||
_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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor, uses OpenSim.ini.
|
||||
/// </summary>
|
||||
public GridInfoService() : this(new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini")))
|
||||
{
|
||||
}
|
||||
|
||||
private void IssueWarning()
|
||||
|
||||
Reference in New Issue
Block a user