Merge branch 'master' of /home/opensim/lib/osgrid/opensim

iar_mods
BlueWall 2012-01-17 21:10:31 -05:00
commit 939d60da59
2 changed files with 17 additions and 0 deletions

View File

@ -37,6 +37,7 @@ using Nini.Config;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using OpenMetaverse.StructuredData;
namespace OpenSim.Server.Handlers.Grid namespace OpenSim.Server.Handlers.Grid
{ {
@ -142,5 +143,19 @@ namespace OpenSim.Server.Handlers.Grid
return sb.ToString(); return sb.ToString();
} }
public string JsonGetGridInfoMethod(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
OSDMap map = new OSDMap();
foreach (string k in _info.Keys)
{
map[k] = OSD.FromString(_info[k].ToString());
}
return OSDParser.SerializeJsonString(map).ToString();
}
} }
} }

View File

@ -48,6 +48,8 @@ namespace OpenSim.Server.Handlers.Grid
server.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info", server.AddStreamHandler(new RestStreamHandler("GET", "/get_grid_info",
handlers.RestGetGridInfoMethod)); handlers.RestGetGridInfoMethod));
server.AddStreamHandler(new RestStreamHandler("GET", "/json_grid_info",
handlers.JsonGetGridInfoMethod));
server.AddXmlRPCHandler("get_grid_info", handlers.XmlRpcGridInfoMethod); server.AddXmlRPCHandler("get_grid_info", handlers.XmlRpcGridInfoMethod);
} }