From 32293cfd6ba20cc5cab0a5acba587edea2582324 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 11 Nov 2014 20:42:13 -0800 Subject: [PATCH] Fix the fetching of module references in the viewer support modules. Remove the detachment of attachments in camera-only, because it doesn't work for HG people, and it's too drastic of a move. --- .../ViewerSupport/CameraOnlyModeModule.cs | 13 ++++++++----- .../ViewerSupport/SimulatorFeaturesHelper.cs | 3 +++ .../ViewerSupport/SpecialUIModule.cs | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/CameraOnlyModeModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/CameraOnlyModeModule.cs index c56e02934b..7ae4223899 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/CameraOnlyModeModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/CameraOnlyModeModule.cs @@ -95,8 +95,6 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport if (m_Enabled) { m_scene = scene; - IEntityTransferModule et = m_scene.RequestModuleInterface(); - m_Helper = new SimulatorFeaturesHelper(scene, et); //m_scene.EventManager.OnMakeRootAgent += (OnMakeRootAgent); } } @@ -110,9 +108,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport { if (m_Enabled) { - ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface(); + IEntityTransferModule et = m_scene.RequestModuleInterface(); + m_Helper = new SimulatorFeaturesHelper(scene, et); - if (featuresModule != null && m_Enabled) + ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface(); + if (featuresModule != null) featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; } } @@ -138,7 +138,10 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport } extrasMap["camera-only-mode"] = OSDMap.FromString("true"); m_log.DebugFormat("[CAMERA-ONLY MODE]: Sent in {0}", m_scene.RegionInfo.RegionName); - Util.FireAndForget(delegate { DetachAttachments(agentID); }); + + // Detaching attachments doesn't work for HG visitors, + // so I'm giving that up. + //Util.FireAndForget(delegate { DetachAttachments(agentID); }); } else m_log.DebugFormat("[CAMERA-ONLY MODE]: NOT Sending camera-only-mode in {0}", m_scene.RegionInfo.RegionName); diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/SimulatorFeaturesHelper.cs b/OpenSim/Region/OptionalModules/ViewerSupport/SimulatorFeaturesHelper.cs index 1900f31143..825c03189d 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/SimulatorFeaturesHelper.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/SimulatorFeaturesHelper.cs @@ -101,6 +101,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport if (client != null) { ScenePresence sp = WaitGetScenePresence(agentID); + if (sp == null) // Client is connected but SP still doesn't exist: this may happen on login { m_log.DebugFormat("[XXX]: SP is null"); @@ -123,11 +124,13 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport rsend.send = true; else m_log.DebugFormat("[XXX]: Child or in transit"); + } } else m_log.DebugFormat("[XXX]: client is null"); + if (rsendlist == null) { rsendlist = new List(); diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs index 6415c6cc75..0a8c83a06d 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/SpecialUIModule.cs @@ -95,8 +95,6 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport if (m_Enabled) { m_scene = scene; - IEntityTransferModule et = m_scene.RequestModuleInterface(); - m_Helper = new SimulatorFeaturesHelper(scene, et); } } @@ -104,9 +102,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport { if (m_Enabled) { - ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface(); + IEntityTransferModule et = m_scene.RequestModuleInterface(); + m_Helper = new SimulatorFeaturesHelper(scene, et); - if (featuresModule != null && m_Enabled) + ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface(); + if (featuresModule != null) featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; } }