mirror of
https://github.com/opensim/opensim.git
synced 2026-07-30 21:38:46 +08:00
Added test GridClient, which allowed me to remove a few bugs out of the new code.
This commit is contained in:
@@ -258,6 +258,8 @@ namespace OpenSim.Server.Base
|
||||
|
||||
public static Dictionary<string, object> ParseXmlResponse(string data)
|
||||
{
|
||||
//m_log.DebugFormat("[XXX]: received xml string: {0}", data);
|
||||
|
||||
Dictionary<string, object> ret = new Dictionary<string, object>();
|
||||
|
||||
XmlDocument doc = new XmlDocument();
|
||||
@@ -284,7 +286,7 @@ namespace OpenSim.Server.Base
|
||||
|
||||
foreach (XmlNode part in partL)
|
||||
{
|
||||
XmlNode type = part.Attributes.GetNamedItem("Type");
|
||||
XmlNode type = part.Attributes.GetNamedItem("type");
|
||||
if (type == null || type.Value != "List")
|
||||
{
|
||||
ret[part.Name] = part.InnerText;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
if (serverConfig == null)
|
||||
throw new Exception("No section 'Server' in config file");
|
||||
|
||||
string gridService = serverConfig.GetString("GridServiceModule",
|
||||
string gridService = serverConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (gridService == String.Empty)
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
StreamReader sr = new StreamReader(requestData);
|
||||
string body = sr.ReadToEnd();
|
||||
sr.Close();
|
||||
body = body.Trim();
|
||||
|
||||
Dictionary<string, string> request =
|
||||
ServerUtils.ParseQueryString(body);
|
||||
@@ -98,11 +99,11 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
case "get_region_range":
|
||||
return GetRegionRange(request);
|
||||
|
||||
default:
|
||||
m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method);
|
||||
return FailureResult();
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[GRID HANDLER XXX]: unknown method {0} request {1}", method.Length, method);
|
||||
return FailureResult();
|
||||
|
||||
}
|
||||
|
||||
#region Method-specific handlers
|
||||
@@ -155,11 +156,12 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
|
||||
UUID regionID = UUID.Zero;
|
||||
if (request["REGIONID"] != null)
|
||||
UUID.TryParse(request["REGIONID"], out scopeID);
|
||||
UUID.TryParse(request["REGIONID"], out regionID);
|
||||
else
|
||||
m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours");
|
||||
|
||||
List<GridRegion> rinfos = m_GridService.GetNeighbours(scopeID, regionID);
|
||||
//m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count);
|
||||
|
||||
Dictionary<string, object> result = new Dictionary<string, object>();
|
||||
int i = 0;
|
||||
@@ -171,6 +173,7 @@ namespace OpenSim.Server.Handlers.Grid
|
||||
}
|
||||
|
||||
string xmlString = ServerUtils.BuildXmlResponse(result);
|
||||
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
return encoding.GetBytes(xmlString);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user