on simple cases no need to parse at all

master
UbitUmarov 2020-06-04 02:50:39 +01:00
parent 84a3ff37ab
commit 7a07731371
6 changed files with 28 additions and 73 deletions

View File

@ -199,20 +199,16 @@ namespace OpenSim.Region.CoreModules.World.Estate
string reply = SynchronousRestFormsRequester.MakeRequest("POST",
url + "estate",
reqString);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("RESULT"))
if (reply != string.Empty)
{
if (replyData["RESULT"].ToString().ToLower() == "true")
int indx = reply.IndexOf("true", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
else
return false;
return false;
}
else
m_log.DebugFormat("[XESTATE CONNECTOR]: reply data does not contain result field");
}
else
m_log.DebugFormat("[XESTATE CONNECTOR]: received empty reply");

View File

@ -154,20 +154,10 @@ namespace OpenSim.Services.Connectors
string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("result"))
{
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
{
m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences reply data does not contain result field");
}
int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
return false;
}
else
m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences received empty reply");

View File

@ -148,8 +148,7 @@ namespace OpenSim.Services.Connectors
m_ServerURI + "/auth/plain",
ServerUtils.BuildQueryString(sendData), m_Auth);
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
reply);
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData["Result"].ToString() != "Success")
return false;

View File

@ -157,17 +157,10 @@ namespace OpenSim.Services.Connectors
string reply = SynchronousRestFormsRequester.MakeRequest("POST", m_ServerURI, reqString, m_Auth);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("result"))
{
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[MUTELIST CONNECTOR]: {0} reply data does not contain result field", meth);
int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
return false;
}
else
m_log.DebugFormat("[MUTELIST CONNECTOR]: {0} received empty reply", meth);

View File

@ -111,18 +111,10 @@ namespace OpenSim.Services.Connectors
m_Auth);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("result"))
{
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LoginAgent reply data does not contain result field");
int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LoginAgent received empty reply");
@ -155,20 +147,13 @@ namespace OpenSim.Services.Connectors
uri,
reqString,
m_Auth);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("result"))
{
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutAgent reply data does not contain result field");
int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutAgent received empty reply");
@ -202,18 +187,10 @@ namespace OpenSim.Services.Connectors
m_Auth);
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData.ContainsKey("result"))
{
if (replyData["result"].ToString().ToLower() == "success")
return true;
else
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutRegionAgents reply data does not contain result field");
int indx = reply.IndexOf("success", StringComparison.InvariantCultureIgnoreCase);
if (indx > 0)
return true;
return false;
}
else
m_log.DebugFormat("[PRESENCE CONNECTOR]: LogoutRegionAgents received empty reply");

View File

@ -469,7 +469,7 @@ namespace OpenSim.Services.Connectors.Simulation
try
{
OSDMap args = new OSDMap(2);
OSDMap args = new OSDMap(16);
args["sog"] = OSD.FromString(sog.ToXml2());
args["extra"] = OSD.FromString(sog.ExtraToXmlString());