From bf9ce4709faa22c23411ade380e77a699a29ce51 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Thu, 19 Jan 2012 13:48:31 -0500 Subject: 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. --- OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs | 37 +++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'OpenSim/Server') 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 public class GridInfoHandlers { private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private IConfigSource m_Config; private Hashtable _info = new Hashtable(); /// @@ -60,6 +60,7 @@ namespace OpenSim.Server.Handlers.Grid /// public GridInfoHandlers(IConfigSource configSource) { + m_Config = configSource; loadGridInfo(configSource); } @@ -144,9 +145,38 @@ namespace OpenSim.Server.Handlers.Grid return sb.ToString(); } + /// + /// Get GridInfo in json format: Used bu the OSSL osGetGrid* + /// Adding the SRV_HomeIRI to the kvp returned for use in scripts + /// + /// + /// json string + /// + /// + /// Request. + /// + /// + /// /json_grid_info + /// + /// + /// Parameter. + /// + /// + /// Http request. + /// + /// + /// Http response. + /// public string JsonGetGridInfoMethod(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { + string HomeURI = String.Empty; + IConfig cfg = m_Config.Configs["LoginService"]; + + if (null != cfg) + { + HomeURI = cfg.GetString("SRV_HomeURI", HomeURI); + } OSDMap map = new OSDMap(); @@ -155,6 +185,11 @@ namespace OpenSim.Server.Handlers.Grid map[k] = OSD.FromString(_info[k].ToString()); } + if (!String.IsNullOrEmpty(HomeURI)) + { + map["HomeURI"] = OSD.FromString(HomeURI); + } + return OSDParser.SerializeJsonString(map).ToString(); } } -- cgit v1.1