mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
a few changes to simulatorFeatures cap
This commit is contained in:
@@ -266,7 +266,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
private void HandleSimulatorFeaturesRequest(IOSHttpRequest request, IOSHttpResponse response, UUID agentID)
|
||||
{
|
||||
// m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: SimulatorFeatures request");
|
||||
// m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: SimulatorFeatures request");
|
||||
|
||||
if (request.HttpMethod != "GET")
|
||||
{
|
||||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
if (sp == null)
|
||||
{
|
||||
@@ -281,17 +282,31 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
response.AddHeader("Retry-After", "5");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
OSDMap copy = DeepCopy();
|
||||
|
||||
// Let's add the agentID to the destination guide, if it is expecting that.
|
||||
if (copy.ContainsKey("OpenSimExtras") && ((OSDMap)(copy["OpenSimExtras"])).ContainsKey("destination-guide-url"))
|
||||
((OSDMap)copy["OpenSimExtras"])["destination-guide-url"] = Replace(((OSDMap)copy["OpenSimExtras"])["destination-guide-url"], "[USERID]", agentID.ToString());
|
||||
if(copy.TryGetValue("OpenSimExtras", out OSD oe))
|
||||
{
|
||||
if(((OSDMap)oe).TryGetValue("destination-guide-url", out OSD dgl))
|
||||
{
|
||||
((OSDMap)oe)["destination-guide-url"] = Replace(dgl.AsString(), "[USERID]", agentID.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
OnSimulatorFeaturesRequest?.Invoke(agentID, ref copy);
|
||||
if(OnSimulatorFeaturesRequest != null)
|
||||
{
|
||||
foreach(SimulatorFeaturesRequestDelegate sd in OnSimulatorFeaturesRequest.GetInvocationList())
|
||||
try
|
||||
{
|
||||
sd?.Invoke(agentID, ref copy);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
//Send back data
|
||||
response.RawBuffer = Util.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(copy));
|
||||
response.RawBuffer = OSDParser.SerializeLLSDXmlToBytes(copy);
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user