Trying to guestimate sensible default values for GridInfoService if no
[GridInfo] section is supplied by OpenSim.ini; also adding log warning if that is the case.0.6.0-stable
parent
f69ae29e39
commit
0512895eea
|
@ -65,15 +65,35 @@ namespace OpenSim.Common.Communications
|
||||||
IConfigSource _configSource = new IniConfigSource(configPath);
|
IConfigSource _configSource = new IniConfigSource(configPath);
|
||||||
IConfig startupCfg = _configSource.Configs["Startup"];
|
IConfig startupCfg = _configSource.Configs["Startup"];
|
||||||
IConfig gridCfg = _configSource.Configs["GridInfo"];
|
IConfig gridCfg = _configSource.Configs["GridInfo"];
|
||||||
|
IConfig netCfg = _configSource.Configs["Network"];
|
||||||
|
|
||||||
if (!startupCfg.GetBoolean("gridmode", false))
|
bool grid = startupCfg.GetBoolean("gridmode", false);
|
||||||
_info["mode"] = "standalone";
|
|
||||||
else
|
if (grid)
|
||||||
_info["mode"] = "grid";
|
_info["mode"] = "grid";
|
||||||
|
else
|
||||||
|
_info["mode"] = "standalone";
|
||||||
|
|
||||||
foreach (string k in gridCfg.GetKeys())
|
|
||||||
|
if (null != gridCfg)
|
||||||
{
|
{
|
||||||
_info[k] = gridCfg.GetString(k);
|
foreach (string k in gridCfg.GetKeys())
|
||||||
|
{
|
||||||
|
_info[k] = gridCfg.GetString(k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (null != netCfg)
|
||||||
|
{
|
||||||
|
if (grid)
|
||||||
|
_info["login"] = netCfg.GetString("user_server_url");
|
||||||
|
else
|
||||||
|
_info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port"));
|
||||||
|
IssueWarning();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_info["login"] = "http://127.0.0.1:9000/";
|
||||||
|
IssueWarning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@ -91,6 +111,16 @@ namespace OpenSim.Common.Communications
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void IssueWarning()
|
||||||
|
{
|
||||||
|
_log.Warn("[GridInfoService] found no [GridInfo] section in your OpenSim.ini");
|
||||||
|
_log.Warn("[GridInfoService] trying to guess sensible defaults, you might want to provide better ones:");
|
||||||
|
foreach (string k in _info.Keys)
|
||||||
|
{
|
||||||
|
_log.WarnFormat("[GridInfoService] {0}: {1}", k, _info[k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public XmlRpcResponse XmlRpcGridInfoMethod(XmlRpcRequest request)
|
public XmlRpcResponse XmlRpcGridInfoMethod(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
XmlRpcResponse response = new XmlRpcResponse();
|
XmlRpcResponse response = new XmlRpcResponse();
|
||||||
|
|
Loading…
Reference in New Issue