aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs')
-rw-r--r--OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs52
1 files changed, 51 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
index 645a77f..965a54e 100644
--- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
+++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs
@@ -37,13 +37,14 @@ using Nini.Config;
37using Nwc.XmlRpc; 37using Nwc.XmlRpc;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Servers.HttpServer; 39using OpenSim.Framework.Servers.HttpServer;
40using OpenMetaverse.StructuredData;
40 41
41namespace OpenSim.Server.Handlers.Grid 42namespace OpenSim.Server.Handlers.Grid
42{ 43{
43 public class GridInfoHandlers 44 public class GridInfoHandlers
44 { 45 {
45 private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 47 private IConfigSource m_Config;
47 private Hashtable _info = new Hashtable(); 48 private Hashtable _info = new Hashtable();
48 49
49 /// <summary> 50 /// <summary>
@@ -59,6 +60,7 @@ namespace OpenSim.Server.Handlers.Grid
59 /// </remarks> 60 /// </remarks>
60 public GridInfoHandlers(IConfigSource configSource) 61 public GridInfoHandlers(IConfigSource configSource)
61 { 62 {
63 m_Config = configSource;
62 loadGridInfo(configSource); 64 loadGridInfo(configSource);
63 } 65 }
64 66
@@ -142,5 +144,53 @@ namespace OpenSim.Server.Handlers.Grid
142 144
143 return sb.ToString(); 145 return sb.ToString();
144 } 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>
170 public string JsonGetGridInfoMethod(string request, string path, string param,
171 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
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 }
180
181 OSDMap map = new OSDMap();
182
183 foreach (string k in _info.Keys)
184 {
185 map[k] = OSD.FromString(_info[k].ToString());
186 }
187
188 if (!String.IsNullOrEmpty(HomeURI))
189 {
190 map["home"] = OSD.FromString(HomeURI);
191 }
192
193 return OSDParser.SerializeJsonString(map).ToString();
194 }
145 } 195 }
146} 196}