diff options
author | Dr Scofield | 2008-07-28 14:28:26 +0000 |
---|---|---|
committer | Dr Scofield | 2008-07-28 14:28:26 +0000 |
commit | 0512895eeaf2d84a025c04927ffa5bf3c4003464 (patch) | |
tree | bf8ae690ff7fdb8a0432817b6ad958f31bfac7ef /OpenSim | |
parent | remove void keyword for osWeatherMap.lsl. Update asset and inventory (diff) | |
download | opensim-SC_OLD-0512895eeaf2d84a025c04927ffa5bf3c4003464.zip opensim-SC_OLD-0512895eeaf2d84a025c04927ffa5bf3c4003464.tar.gz opensim-SC_OLD-0512895eeaf2d84a025c04927ffa5bf3c4003464.tar.bz2 opensim-SC_OLD-0512895eeaf2d84a025c04927ffa5bf3c4003464.tar.xz |
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.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Common/Communications/GridInfoService.cs | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/OpenSim/Common/Communications/GridInfoService.cs b/OpenSim/Common/Communications/GridInfoService.cs index f8208ad..adaaa95 100644 --- a/OpenSim/Common/Communications/GridInfoService.cs +++ b/OpenSim/Common/Communications/GridInfoService.cs | |||
@@ -65,15 +65,35 @@ namespace OpenSim.Common.Communications | |||
65 | IConfigSource _configSource = new IniConfigSource(configPath); | 65 | IConfigSource _configSource = new IniConfigSource(configPath); |
66 | IConfig startupCfg = _configSource.Configs["Startup"]; | 66 | IConfig startupCfg = _configSource.Configs["Startup"]; |
67 | IConfig gridCfg = _configSource.Configs["GridInfo"]; | 67 | IConfig gridCfg = _configSource.Configs["GridInfo"]; |
68 | 68 | IConfig netCfg = _configSource.Configs["Network"]; | |
69 | if (!startupCfg.GetBoolean("gridmode", false)) | 69 | |
70 | _info["mode"] = "standalone"; | 70 | bool grid = startupCfg.GetBoolean("gridmode", false); |
71 | else | 71 | |
72 | if (grid) | ||
72 | _info["mode"] = "grid"; | 73 | _info["mode"] = "grid"; |
73 | 74 | else | |
74 | foreach (string k in gridCfg.GetKeys()) | 75 | _info["mode"] = "standalone"; |
76 | |||
77 | |||
78 | if (null != gridCfg) | ||
79 | { | ||
80 | foreach (string k in gridCfg.GetKeys()) | ||
81 | { | ||
82 | _info[k] = gridCfg.GetString(k); | ||
83 | } | ||
84 | } | ||
85 | else if (null != netCfg) | ||
86 | { | ||
87 | if (grid) | ||
88 | _info["login"] = netCfg.GetString("user_server_url"); | ||
89 | else | ||
90 | _info["login"] = String.Format("http://127.0.0.1:{0}/", netCfg.GetString("http_listener_port")); | ||
91 | IssueWarning(); | ||
92 | } | ||
93 | else | ||
75 | { | 94 | { |
76 | _info[k] = gridCfg.GetString(k); | 95 | _info["login"] = "http://127.0.0.1:9000/"; |
96 | IssueWarning(); | ||
77 | } | 97 | } |
78 | } | 98 | } |
79 | catch (Exception) | 99 | catch (Exception) |
@@ -91,6 +111,16 @@ namespace OpenSim.Common.Communications | |||
91 | { | 111 | { |
92 | } | 112 | } |
93 | 113 | ||
114 | private void IssueWarning() | ||
115 | { | ||
116 | _log.Warn("[GridInfoService] found no [GridInfo] section in your OpenSim.ini"); | ||
117 | _log.Warn("[GridInfoService] trying to guess sensible defaults, you might want to provide better ones:"); | ||
118 | foreach (string k in _info.Keys) | ||
119 | { | ||
120 | _log.WarnFormat("[GridInfoService] {0}: {1}", k, _info[k]); | ||
121 | } | ||
122 | } | ||
123 | |||
94 | public XmlRpcResponse XmlRpcGridInfoMethod(XmlRpcRequest request) | 124 | public XmlRpcResponse XmlRpcGridInfoMethod(XmlRpcRequest request) |
95 | { | 125 | { |
96 | XmlRpcResponse response = new XmlRpcResponse(); | 126 | XmlRpcResponse response = new XmlRpcResponse(); |