aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Common')
-rw-r--r--OpenSim/Common/Communications/GridInfoService.cs44
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();