add GetLocalRegionByName to GridServicesConnector plus cosmetics

This commit is contained in:
UbitUmarov
2024-09-21 00:41:25 +01:00
parent fcddf631ce
commit 3823940205
5 changed files with 498 additions and 527 deletions

View File

@@ -543,19 +543,21 @@ namespace OpenSim.Server.Base
public static Dictionary<string, object> ParseXmlResponse(string data)
{
try
if(!string.IsNullOrEmpty(data))
{
using XmlReader xr = XmlReader.Create(new StringReader(data),
ParseXmlStringResponseXmlReaderSettings, ParseXmlResponseXmlParserContext);
if (!xr.ReadToFollowing("ServerResponse"))
return new Dictionary<string, object>();
return ScanXmlResponse(xr);
try
{
using XmlReader xr = XmlReader.Create(new StringReader(data),
ParseXmlStringResponseXmlReaderSettings, ParseXmlResponseXmlParserContext);
if (xr.ReadToFollowing("ServerResponse"))
return ScanXmlResponse(xr);
}
catch (Exception e)
{
m_log.Debug($"[serverUtils.ParseXmlResponse]: failed error: {e.Message}\n --string:\n{data}\n");
}
}
catch (Exception e)
{
m_log.DebugFormat("[serverUtils.ParseXmlResponse]: failed error: {0}\n --string:\n{1}\n", e.Message, data);
}
return new Dictionary<string, object>();
return [];
}
private static readonly XmlReaderSettings ParseXmlStreamResponseXmlReaderSettings = new()