change meshUploadFlagModule

master
UbitUmarov 2020-04-27 20:00:03 +01:00
parent b4fc5c33ec
commit 27ea249194
2 changed files with 20 additions and 27 deletions

View File

@ -115,7 +115,7 @@ namespace OpenSim.Region.ClientStack.LindenCaps
public void UpdateAgentPreferences(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID agent) public void UpdateAgentPreferences(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID agent)
{ {
if(httpRequest.HttpMethod != "POST") if (httpRequest.HttpMethod != "POST")
{ {
httpResponse.StatusCode = (int)HttpStatusCode.NotFound; httpResponse.StatusCode = (int)HttpStatusCode.NotFound;
return; return;

View File

@ -27,17 +27,16 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Reflection; using System.Net;
using System.Text;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using Mono.Addins; using Mono.Addins;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps; using Caps = OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.ClientStack.Linden namespace OpenSim.Region.ClientStack.Linden
@ -116,36 +115,30 @@ namespace OpenSim.Region.ClientStack.Linden
public void RegisterCaps(UUID agentID, Caps caps) public void RegisterCaps(UUID agentID, Caps caps)
{ {
IRequestHandler reqHandler caps.RegisterSimpleHandler("MeshUploadFlag",
= new RestHTTPHandler( new SimpleStreamHandler("/" + UUID.Random(), MeshUploadFlag));
"GET", "/CAPS/" + UUID.Random(), ht => MeshUploadFlag(ht, agentID), "MeshUploadFlag", agentID.ToString()); /* to use when/if we do check on dbs
new SimpleStreamHandler("/" + UUID.Random(), delegate (IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
caps.RegisterHandler("MeshUploadFlag", reqHandler); {
MeshUploadFlag(httpRequest, httpResponse, agentID);
}));
*/
} }
private Hashtable MeshUploadFlag(Hashtable mDhttpMethod, UUID agentID) //private void MeshUploadFlag(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID agentID)
private void MeshUploadFlag(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{ {
// m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request"); // m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request");
if(httpRequest.HttpMethod != "GET")
{
httpResponse.StatusCode = (int)HttpStatusCode.NotFound;
return;
}
OSDMap data = new OSDMap(); OSDMap data = new OSDMap();
// ScenePresence sp = m_scene.GetScenePresence(m_agentID);
// data["username"] = sp.Firstname + "." + sp.Lastname;
// data["display_name_next_update"] = new OSDDate(DateTime.Now);
// data["legacy_first_name"] = sp.Firstname;
data["mesh_upload_status"] = "valid"; data["mesh_upload_status"] = "valid";
// data["display_name"] = sp.Firstname + " " + sp.Lastname; httpResponse.RawBuffer = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(data));
// data["legacy_last_name"] = sp.Lastname; httpResponse.StatusCode = (int)HttpStatusCode.OK;
// data["id"] = m_agentID;
// data["is_display_name_default"] = true;
//Send back data
Hashtable responsedata = new Hashtable();
responsedata["int_response_code"] = 200;
responsedata["content_type"] = "text/plain";
responsedata["keepalive"] = false;
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(data);
return responsedata;
} }
} }
} }