From 5b52440e61648a98d418cff11b588352a3cfff67 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 24 Dec 2011 16:18:01 +0100 Subject: [PATCH] Introduce a LightShare kill packet ans send it when needed. Currently only understood by AVN v0.3 --- .../CoreModules/LightShare/LightShareModule.cs | 17 ++++++++++++----- .../Shared/Api/Implementation/LS_Api.cs | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index cabbd317fb..16cbbf5d37 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs @@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) { - if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) + if (m_enableWindlight) { - List param = compileWindlightSettings(wl); - client.SendGenericMessage("Windlight", param); + if (m_scene.RegionInfo.WindlightSettings.valid) + { + List param = compileWindlightSettings(wl); + client.SendGenericMessage("Windlight", param); + } + else + { + List param = new List(); + client.SendGenericMessage("WindlightReset", param); + } } } @@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare private void EventManager_OnSaveNewWindlightProfile() { - if (m_scene.RegionInfo.WindlightSettings.valid) - m_scene.ForEachRootClient(SendProfileToClient); + m_scene.ForEachRootClient(SendProfileToClient); } public void PostInitialise() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index cb0d7658aa..77a784d077 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; if (m_host.ParentGroup.Scene.SimulationDataService != null) m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); + m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); } /// /// Set the current Windlight scene to a target avatar