From fcd1e36ed6177f3b3e83d7fd829df3a5325c5e9c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 4 Dec 2016 17:01:49 +0000 Subject: a few changes to new GetDisplaynames and friends --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index f96ae8b..2481d11 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -201,6 +201,8 @@ namespace OpenSim.Region.ClientStack.Linden m_assetService = m_Scene.AssetService; m_regionName = m_Scene.RegionInfo.RegionName; m_UserManager = m_Scene.RequestModuleInterface(); + if (m_UserManager == null) + m_log.Error("[CAPS]: GetDisplayNames disabled because user management component not found"); RegisterHandlers(); @@ -324,9 +326,12 @@ namespace OpenSim.Region.ClientStack.Linden { try { - IRequestHandler GetDisplayNamesHandler = new RestStreamHandler( + if (m_UserManager != null) + { + IRequestHandler GetDisplayNamesHandler = new RestStreamHandler( "GET", GetNewCapPath(), GetDisplayNames, "GetDisplayNames", null); - m_HostCapsObj.RegisterHandler("GetDisplayNames", GetDisplayNamesHandler); + m_HostCapsObj.RegisterHandler("GetDisplayNames", GetDisplayNamesHandler); + } } catch (Exception e) { @@ -1818,23 +1823,24 @@ namespace OpenSim.Region.ClientStack.Linden string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { - httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NoContent; + httpResponse.StatusCode = (int)System.Net.HttpStatusCode.Gone; httpResponse.ContentType = "text/plain"; ScenePresence sp = m_Scene.GetScenePresence(m_AgentID); if(sp == null || sp.IsDeleted) return ""; - NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); - string[] ids = query.GetValues("ids"); - - if (m_UserManager == null) + if(sp.IsInTransit) { - m_log.Error("[GET_DISPLAY_NAMES]: Cannot fetch display names without a user management component"); - httpResponse.StatusCode = (int)System.Net.HttpStatusCode.InternalServerError; + httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable; + httpResponse.AddHeader("Retry-After","30"); return ""; } + NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); + string[] ids = query.GetValues("ids"); + + Dictionary names = m_UserManager.GetUsersNames(ids); OSDMap osdReply = new OSDMap(); -- cgit v1.1