diff options
author | Dr Scofield | 2008-08-22 11:09:38 +0000 |
---|---|---|
committer | Dr Scofield | 2008-08-22 11:09:38 +0000 |
commit | d972d227889beb3b12b937be55fdecab9bdea2e7 (patch) | |
tree | 9af7cc851644b440a2a6b403d222965713dcb3ee /OpenSim | |
parent | - fixes a bug in RemoteAdminPlugin where CreateRegion would not pay (diff) | |
download | opensim-SC-d972d227889beb3b12b937be55fdecab9bdea2e7.zip opensim-SC-d972d227889beb3b12b937be55fdecab9bdea2e7.tar.gz opensim-SC-d972d227889beb3b12b937be55fdecab9bdea2e7.tar.bz2 opensim-SC-d972d227889beb3b12b937be55fdecab9bdea2e7.tar.xz |
bug fixes:
- GridInfoServices was not paying attention to location of ini file
- typo in RemoteAdminPlugin
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/GridInfoService.cs | 66 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 3 |
3 files changed, 34 insertions, 37 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 5d2d23e..4dc63fd 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -441,7 +441,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
441 | if (persist) | 441 | if (persist) |
442 | { | 442 | { |
443 | // default place for region XML files is in the | 443 | // default place for region XML files is in the |
444 | // Regions directory of th config dir (aka /bin) | 444 | // Regions directory of the config dir (aka /bin) |
445 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); | 445 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); |
446 | try | 446 | try |
447 | { | 447 | { |
diff --git a/OpenSim/Framework/Communications/GridInfoService.cs b/OpenSim/Framework/Communications/GridInfoService.cs index d51bc59..ad60638 100644 --- a/OpenSim/Framework/Communications/GridInfoService.cs +++ b/OpenSim/Framework/Communications/GridInfoService.cs | |||
@@ -55,59 +55,55 @@ namespace OpenSim.Framework.Communications | |||
55 | /// anything else requires a general redesign of the config | 55 | /// anything else requires a general redesign of the config |
56 | /// system. | 56 | /// system. |
57 | /// </remarks> | 57 | /// </remarks> |
58 | public GridInfoService(string configPath) | 58 | public GridInfoService(IConfigSource configSource) |
59 | { | 59 | { |
60 | _info["platform"] = "OpenSim"; | 60 | _info["platform"] = "OpenSim"; |
61 | if (File.Exists(configPath)) | 61 | try |
62 | { | 62 | { |
63 | try | 63 | IConfig startupCfg = configSource.Configs["Startup"]; |
64 | IConfig gridCfg = configSource.Configs["GridInfo"]; | ||
65 | IConfig netCfg = configSource.Configs["Network"]; | ||
66 | |||
67 | bool grid = startupCfg.GetBoolean("gridmode", false); | ||
68 | |||
69 | if (grid) | ||
70 | _info["mode"] = "grid"; | ||
71 | else | ||
72 | _info["mode"] = "standalone"; | ||
73 | |||
74 | |||
75 | if (null != gridCfg) | ||
64 | { | 76 | { |
65 | IConfigSource _configSource = new IniConfigSource(configPath); | 77 | foreach (string k in gridCfg.GetKeys()) |
66 | IConfig startupCfg = _configSource.Configs["Startup"]; | ||
67 | IConfig gridCfg = _configSource.Configs["GridInfo"]; | ||
68 | IConfig netCfg = _configSource.Configs["Network"]; | ||
69 | |||
70 | bool grid = startupCfg.GetBoolean("gridmode", false); | ||
71 | |||
72 | if (grid) | ||
73 | _info["mode"] = "grid"; | ||
74 | else | ||
75 | _info["mode"] = "standalone"; | ||
76 | |||
77 | |||
78 | if (null != gridCfg) | ||
79 | { | 78 | { |
80 | foreach (string k in gridCfg.GetKeys()) | 79 | _info[k] = gridCfg.GetString(k); |
81 | { | ||
82 | _info[k] = gridCfg.GetString(k); | ||
83 | } | ||
84 | } | 80 | } |
85 | else if (null != netCfg) | 81 | } |
86 | { | 82 | else if (null != netCfg) |
87 | if (grid) | 83 | { |
88 | _info["login"] = netCfg.GetString("user_server_url"); | 84 | if (grid) |
85 | _info["login"] = netCfg.GetString("user_server_url"); | ||
89 | else | 86 | else |
90 | _info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port")); | 87 | _info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port")); |
91 | IssueWarning(); | 88 | IssueWarning(); |
92 | } | ||
93 | else | ||
94 | { | ||
95 | _info["login"] = "http://127.0.0.1:9000/"; | ||
96 | IssueWarning(); | ||
97 | } | ||
98 | } | 89 | } |
99 | catch (Exception) | 90 | else |
100 | { | 91 | { |
101 | _log.DebugFormat("[GridInfoService] cannot get grid info from {0}, using minimal defaults", configPath); | 92 | _info["login"] = "http://127.0.0.1:9000/"; |
93 | IssueWarning(); | ||
102 | } | 94 | } |
103 | } | 95 | } |
96 | catch (Exception) | ||
97 | { | ||
98 | _log.Debug("[GridInfoService] cannot get grid info from config source, using minimal defaults"); | ||
99 | } | ||
104 | _log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count); | 100 | _log.InfoFormat("[GridInfoService] Grid info service initialized with {0} keys", _info.Count); |
105 | } | 101 | } |
106 | 102 | ||
107 | /// <summary> | 103 | /// <summary> |
108 | /// Default constructor, uses OpenSim.ini. | 104 | /// Default constructor, uses OpenSim.ini. |
109 | /// </summary> | 105 | /// </summary> |
110 | public GridInfoService() : this(Path.Combine(Util.configDir(), "OpenSim.ini")) | 106 | public GridInfoService() : this(new IniConfigSource(Path.Combine(Util.configDir(), "OpenSim.ini"))) |
111 | { | 107 | { |
112 | } | 108 | } |
113 | 109 | ||
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 983773a..0dd037d 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -387,7 +387,8 @@ namespace OpenSim | |||
387 | m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); | 387 | m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); |
388 | 388 | ||
389 | // provide grid info | 389 | // provide grid info |
390 | m_gridInfoService = new GridInfoService(); | 390 | // m_gridInfoService = new GridInfoService(m_config.Source.Configs["Startup"].GetString("inifile", Path.Combine(Util.configDir(), "OpenSim.ini"))); |
391 | m_gridInfoService = new GridInfoService(m_config.Source); | ||
391 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); | 392 | m_httpServer.AddXmlRPCHandler("get_grid_info", m_gridInfoService.XmlRpcGridInfoMethod); |
392 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); | 393 | m_httpServer.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", m_gridInfoService.RestGetGridInfoMethod)); |
393 | } | 394 | } |