change FetchInventory2 region handler

This commit is contained in:
UbitUmarov
2020-04-28 01:15:18 +01:00
parent bfcbdc8a93
commit 7e2ed9ee2b
2 changed files with 52 additions and 21 deletions

View File

@@ -110,30 +110,15 @@ namespace OpenSim.Region.ClientStack.Linden
private void RegisterCaps(UUID agentID, Caps caps)
{
RegisterFetchCap(agentID, caps, "FetchInventory2", m_fetchInventory2Url);
}
private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
{
string capUrl;
if (url == "localhost")
if (m_fetchInventory2Url == "localhost")
{
capUrl = "/CAPS/" + UUID.Random();
FetchInventory2Handler fetchHandler = new FetchInventory2Handler(m_inventoryService, agentID);
IRequestHandler reqHandler
= new RestStreamHandler(
"POST", capUrl, fetchHandler.FetchInventoryRequest, capName, agentID.ToString());
caps.RegisterHandler(capName, reqHandler);
caps.RegisterSimpleHandler("FetchInventory2",
new SimpleOSDMapHandler("POST", "/" + UUID.Random(), fetchHandler.FetchInventorySimpleRequest));
}
else
else if(!string.IsNullOrWhiteSpace(m_fetchInventory2Url))
{
capUrl = url;
caps.RegisterHandler(capName, capUrl);
caps.RegisterHandler("FetchInventory2", m_fetchInventory2Url);
}
// m_log.DebugFormat(