move ServerReleaseNotes module to simpleStreamHandler

master
UbitUmarov 2020-04-24 00:40:52 +01:00
parent 8d2f90a8e2
commit f955482dfd
2 changed files with 10 additions and 14 deletions

View File

@ -95,7 +95,7 @@ namespace OpenSim.Region.ClientStack.LindenCaps
public void RegisterCaps(UUID agent, Caps caps)
{
string capPath = "/" + UUID.Random().ToString();
string capPath = "/" + UUID.Random().ToString() + "/";
caps.RegisterSimpleHandler("AgentPreferences",
new SimpleStreamHandler(capPath, delegate(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{

View File

@ -112,22 +112,18 @@ namespace OpenSim.Region.ClientStack.LindenCaps
public void RegisterCaps(UUID agentID, Caps caps)
{
string capUrl = "/CAPS/" + UUID.Random() + "/";
IRequestHandler ServerReleaseNote = new RestHTTPHandler("GET", capUrl,
delegate (Hashtable request)
{
return ProcessServerReleaseNotes(request, agentID);
});
caps.RegisterHandler("ServerReleaseNotes", ServerReleaseNote);
string capPath = "/" + UUID.Random() + "/";
caps.RegisterSimpleHandler("ServerReleaseNotes",
new SimpleStreamHandler(capPath, delegate (IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
ProcessServerReleaseNotes(httpResponse);
}));
}
private Hashtable ProcessServerReleaseNotes(Hashtable request, UUID agentID)
private void ProcessServerReleaseNotes(IOSHttpResponse httpResponse)
{
Hashtable responsedata = new Hashtable();
responsedata["int_response_code"] = HttpStatusCode.Moved;
responsedata["str_redirect_location"] = m_ServerReleaseNotesURL;
return responsedata;
httpResponse.StatusCode = (int)HttpStatusCode.Moved;
httpResponse.AddHeader("Location:", m_ServerReleaseNotesURL);
}
}
}