From 41f6d6a5fff5251764db5f637fa197f1bb14a7cd Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 24 Dec 2011 16:18:01 +0100 Subject: Introduce a LightShare kill packet ans send it when needed. Currently only understood by AVN v0.3 --- .../Region/CoreModules/LightShare/LightShareModule.cs | 17 ++++++++++++----- .../ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index 41a80ce..f49641f 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); + } } } @@ -176,8 +184,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 cb0d765..77a784d 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 -- cgit v1.1