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) public void RegisterCaps(UUID agent, Caps caps)
{ {
string capPath = "/" + UUID.Random().ToString(); string capPath = "/" + UUID.Random().ToString() + "/";
caps.RegisterSimpleHandler("AgentPreferences", caps.RegisterSimpleHandler("AgentPreferences",
new SimpleStreamHandler(capPath, delegate(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 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) public void RegisterCaps(UUID agentID, Caps caps)
{ {
string capUrl = "/CAPS/" + UUID.Random() + "/"; string capPath = "/" + UUID.Random() + "/";
caps.RegisterSimpleHandler("ServerReleaseNotes",
IRequestHandler ServerReleaseNote = new RestHTTPHandler("GET", capUrl, new SimpleStreamHandler(capPath, delegate (IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
delegate (Hashtable request) {
{ ProcessServerReleaseNotes(httpResponse);
return ProcessServerReleaseNotes(request, agentID); }));
});
caps.RegisterHandler("ServerReleaseNotes", ServerReleaseNote);
} }
private Hashtable ProcessServerReleaseNotes(Hashtable request, UUID agentID) private void ProcessServerReleaseNotes(IOSHttpResponse httpResponse)
{ {
Hashtable responsedata = new Hashtable(); httpResponse.StatusCode = (int)HttpStatusCode.Moved;
responsedata["int_response_code"] = HttpStatusCode.Moved; httpResponse.AddHeader("Location:", m_ServerReleaseNotesURL);
responsedata["str_redirect_location"] = m_ServerReleaseNotesURL;
return responsedata;
} }
} }
} }