bug fixes:
- GridInfoServices was not paying attention to location of ini file - typo in RemoteAdminPlugin0.6.0-stable
parent
cf5ee5eaa1
commit
d972d22788
|
@ -441,7 +441,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
// default place for region XML files is in the
|
// default place for region XML files is in the
|
||||||
// Regions directory of th config dir (aka /bin)
|
// Regions directory of the config dir (aka /bin)
|
||||||
string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
|
string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,59 +55,55 @@ namespace OpenSim.Framework.Communications
|
||||||
/// anything else requires a general redesign of the config
|
/// anything else requires a general redesign of the config
|
||||||
/// system.
|
/// system.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public GridInfoService(string configPath)
|
public GridInfoService(IConfigSource configSource)
|
||||||
{
|
{
|
||||||
_info["platform"] = "OpenSim";
|
_info["platform"] = "OpenSim";
|
||||||
if (File.Exists(configPath))
|
try
|
||||||
{
|
{
|
||||||
try
|
IConfig startupCfg = configSource.Configs["Startup"];
|
||||||
|
IConfig gridCfg = configSource.Configs["GridInfo"];
|
||||||
|
IConfig netCfg = configSource.Configs["Network"];
|
||||||
|
|
||||||
|
bool grid = startupCfg.GetBoolean("gridmode", false);
|
||||||
|
|
||||||
|
if (grid)
|
||||||
|
_info["mode"] = "grid";
|
||||||
|
else
|
||||||
|
_info["mode"] = "standalone";
|
||||||
|
|
||||||
|
|
||||||
|
if (null != gridCfg)
|
||||||
{
|
{
|
||||||
IConfigSource _configSource = new IniConfigSource(configPath);
|
foreach (string k in gridCfg.GetKeys())
|
||||||
IConfig startupCfg = _configSource.Configs["Startup"];
|
|
||||||
IConfig gridCfg = _configSource.Configs["GridInfo"];
|
|
||||||
IConfig netCfg = _configSource.Configs["Network"];
|
|
||||||
|
|
||||||
bool grid = startupCfg.GetBoolean("gridmode", false);
|
|
||||||
|
|
||||||
if (grid)
|
|
||||||
_info["mode"] = "grid";
|
|
||||||
else
|
|
||||||
_info["mode"] = "standalone";
|
|
||||||
|
|
||||||
|
|
||||||
if (null != gridCfg)
|
|
||||||
{
|
{
|
||||||
foreach (string k in gridCfg.GetKeys())
|
_info[k] = gridCfg.GetString(k);
|
||||||
{
|
|
||||||
_info[k] = gridCfg.GetString(k);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (null != netCfg)
|
}
|
||||||
{
|
else if (null != netCfg)
|
||||||
if (grid)
|
{
|
||||||
_info["login"] = netCfg.GetString("user_server_url");
|
if (grid)
|
||||||
|
_info["login"] = netCfg.GetString("user_server_url");
|
||||||
else
|
else
|
||||||
_info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port"));
|
_info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port"));
|
||||||
IssueWarning();
|
IssueWarning();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_info["login"] = "http://127.0.0.1:9000/";
|
|
||||||
IssueWarning();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
else
|
||||||
{
|
{
|
||||||
_log.DebugFormat("[GridInfoService] cannot get grid info from {0}, using minimal defaults", configPath);
|
_info["login"] = "http://127.0.0.1:9000/";
|
||||||
|
IssueWarning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
_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>
|
/// <summary>
|
||||||
/// Default constructor, uses OpenSim.ini.
|
/// Default constructor, uses OpenSim.ini.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public GridInfoService() : this(Path.Combine(Util.configDir(), "OpenSim.ini"))
|
public GridInfoService() : this(new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini")))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,8 @@ namespace OpenSim
|
||||||
m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod);
|
m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod);
|
||||||
|
|
||||||
// provide grid info
|
// provide grid info
|
||||||
m_gridInfoService = new GridInfoService();
|
// m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini")));
|
||||||
|
m_gridInfoService = new GridInfoService(m_config.Source);
|
||||||
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
|
m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod);
|
||||||
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
|
m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue