aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorBlueWall2012-01-19 13:48:31 -0500
committerBlueWall2012-01-19 13:48:31 -0500
commitbf9ce4709faa22c23411ade380e77a699a29ce51 (patch)
treecc47e7e4f7cdf4e96a36e1672ef321c279b97787 /OpenSim
parentRegionReady: (diff)
downloadopensim-SC-bf9ce4709faa22c23411ade380e77a699a29ce51.zip
opensim-SC-bf9ce4709faa22c23411ade380e77a699a29ce51.tar.gz
opensim-SC-bf9ce4709faa22c23411ade380e77a699a29ce51.tar.bz2
opensim-SC-bf9ce4709faa22c23411ade380e77a699a29ce51.tar.xz
Add fetching of SRV_HomeURI to "/json_grid_info"
Make SRV_HomeURI available on the GridInfoService through the "/json_grid_info" URI. This i s mainly to service OSSL, but can be seen externally via the URI.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
index bfcddca..67472e3 100644
--- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
+++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Server.Handlers.Grid
44 public class GridInfoHandlers 44 public class GridInfoHandlers
45 { 45 {
46 private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47 private IConfigSource m_Config;
48 private Hashtable _info = new Hashtable(); 48 private Hashtable _info = new Hashtable();
49 49
50 /// <summary> 50 /// <summary>
@@ -60,6 +60,7 @@ namespace OpenSim.Server.Handlers.Grid
60 /// </remarks> 60 /// </remarks>
61 public GridInfoHandlers(IConfigSource configSource) 61 public GridInfoHandlers(IConfigSource configSource)
62 { 62 {
63 m_Config = configSource;
63 loadGridInfo(configSource); 64 loadGridInfo(configSource);
64 } 65 }
65 66
@@ -144,9 +145,38 @@ namespace OpenSim.Server.Handlers.Grid
144 return sb.ToString(); 145 return sb.ToString();
145 } 146 }
146 147
148 /// <summary>
149 /// Get GridInfo in json format: Used bu the OSSL osGetGrid*
150 /// Adding the SRV_HomeIRI to the kvp returned for use in scripts
151 /// </summary>
152 /// <returns>
153 /// json string
154 /// </returns>
155 /// <param name='request'>
156 /// Request.
157 /// </param>
158 /// <param name='path'>
159 /// /json_grid_info
160 /// </param>
161 /// <param name='param'>
162 /// Parameter.
163 /// </param>
164 /// <param name='httpRequest'>
165 /// Http request.
166 /// </param>
167 /// <param name='httpResponse'>
168 /// Http response.
169 /// </param>
147 public string JsonGetGridInfoMethod(string request, string path, string param, 170 public string JsonGetGridInfoMethod(string request, string path, string param,
148 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 171 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
149 { 172 {
173 string HomeURI = String.Empty;
174 IConfig cfg = m_Config.Configs["LoginService"];
175
176 if (null != cfg)
177 {
178 HomeURI = cfg.GetString("SRV_HomeURI", HomeURI);
179 }
150 180
151 OSDMap map = new OSDMap(); 181 OSDMap map = new OSDMap();
152 182
@@ -155,6 +185,11 @@ namespace OpenSim.Server.Handlers.Grid
155 map[k] = OSD.FromString(_info[k].ToString()); 185 map[k] = OSD.FromString(_info[k].ToString());
156 } 186 }
157 187
188 if (!String.IsNullOrEmpty(HomeURI))
189 {
190 map["HomeURI"] = OSD.FromString(HomeURI);
191 }
192
158 return OSDParser.SerializeJsonString(map).ToString(); 193 return OSDParser.SerializeJsonString(map).ToString();
159 } 194 }
160 } 195 }