From c2bfdaa026b02b1a6f41745464e7934e166ab35f Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 13 Feb 2013 01:52:25 +0000 Subject: Make the sim features module register it's interface so it can be used --- OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 191bccf..8f38737 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -94,6 +94,8 @@ namespace OpenSim.Region.ClientStack.Linden { m_scene = s; m_scene.EventManager.OnRegisterCaps += RegisterCaps; + + m_scene.RegisterModuleInterface(this); } public void RemoveRegion(Scene s) -- cgit v1.1 From ef662fc959c7943e55c548c50c6b160d12e5c095 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 14 Feb 2013 08:40:15 +0100 Subject: Add an event and some logic to allow customizing Simulator Features by avatar --- .../Linden/Caps/SimulatorFeaturesModule.cs | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 8f38737..6ef8815 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -59,6 +59,8 @@ namespace OpenSim.Region.ClientStack.Linden // private static readonly ILog m_log = // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public event SimulatorFeaturesRequestDelegate OnSimulatorFeaturesRequest; + private Scene m_scene; /// @@ -158,7 +160,7 @@ namespace OpenSim.Region.ClientStack.Linden IRequestHandler reqHandler = new RestHTTPHandler( "GET", "/CAPS/" + UUID.Random(), - HandleSimulatorFeaturesRequest, "SimulatorFeatures", agentID.ToString()); + x => { return HandleSimulatorFeaturesRequest(x, agentID); }, "SimulatorFeatures", agentID.ToString()); caps.RegisterHandler("SimulatorFeatures", reqHandler); } @@ -187,18 +189,33 @@ namespace OpenSim.Region.ClientStack.Linden return new OSDMap(m_features); } - private Hashtable HandleSimulatorFeaturesRequest(Hashtable mDhttpMethod) + private OSDMap DeepCopy() + { + // This isn't the cheapest way of doing this but the rate + // of occurrence is low (on sim entry only) and it's a sure + // way to get a true deep copy. + OSD copy = OSDParser.DeserializeLLSDXml(OSDParser.SerializeLLSDXmlString(m_features)); + + return (OSDMap)copy; + } + + private Hashtable HandleSimulatorFeaturesRequest(Hashtable mDhttpMethod, UUID agentID) { // m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: SimulatorFeatures request"); + OSDMap copy = DeepCopy(); + + SimulatorFeaturesRequestDelegate handlerOnSimulatorFeaturesRequest = OnSimulatorFeaturesRequest; + if (handlerOnSimulatorFeaturesRequest != null) + handlerOnSimulatorFeaturesRequest(agentID, ref copy); + //Send back data Hashtable responsedata = new Hashtable(); responsedata["int_response_code"] = 200; responsedata["content_type"] = "text/plain"; responsedata["keepalive"] = false; - lock (m_features) - responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(m_features); + responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(copy); return responsedata; } -- cgit v1.1 From e82fab34d7377a7d9bfc223f093ac67b393677cc Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 26 Mar 2013 19:00:30 +0000 Subject: Implement a pref to turn on the simulator ExportSupported feature entry. This tells the viewer to enable the UI for export permissions. WARNING: If your inventory store contains invalid flags data, this will result in items becoming exportable! Don't turn this on in production until it's complete! --- OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 6ef8815..7d9f935 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -70,6 +70,7 @@ namespace OpenSim.Region.ClientStack.Linden private string m_MapImageServerURL = string.Empty; private string m_SearchURL = string.Empty; + private bool m_ExportSupported = false; #region ISharedRegionModule Members @@ -87,6 +88,8 @@ namespace OpenSim.Region.ClientStack.Linden } m_SearchURL = config.GetString("SearchServerURI", string.Empty); + + m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported); } AddDefaultFeatures(); @@ -152,6 +155,9 @@ namespace OpenSim.Region.ClientStack.Linden if (m_SearchURL != string.Empty) gridServicesMap["search"] = m_SearchURL; m_features["GridServices"] = gridServicesMap; + + if (m_ExportSupported) + m_features["ExportSupported"] = true; } } -- cgit v1.1