Introduce a LightShare kill packet ans send it when needed. Currently only

understood by AVN v0.3
avinationmerge
Melanie 2011-12-24 16:18:01 +01:00
parent 2e07d24199
commit 41f6d6a5ff
2 changed files with 13 additions and 5 deletions

View File

@ -153,11 +153,19 @@ namespace OpenSim.Region.CoreModules.World.LightShare
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
{ {
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) if (m_enableWindlight)
{
if (m_scene.RegionInfo.WindlightSettings.valid)
{ {
List<byte[]> param = compileWindlightSettings(wl); List<byte[]> param = compileWindlightSettings(wl);
client.SendGenericMessage("Windlight", param); client.SendGenericMessage("Windlight", param);
} }
else
{
List<byte[]> param = new List<byte[]>();
client.SendGenericMessage("WindlightReset", param);
}
}
} }
private void EventManager_OnMakeRootAgent(ScenePresence presence) private void EventManager_OnMakeRootAgent(ScenePresence presence)
@ -176,7 +184,6 @@ namespace OpenSim.Region.CoreModules.World.LightShare
private void EventManager_OnSaveNewWindlightProfile() private void EventManager_OnSaveNewWindlightProfile()
{ {
if (m_scene.RegionInfo.WindlightSettings.valid)
m_scene.ForEachRootClient(SendProfileToClient); m_scene.ForEachRootClient(SendProfileToClient);
} }

View File

@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false;
if (m_host.ParentGroup.Scene.SimulationDataService != null) if (m_host.ParentGroup.Scene.SimulationDataService != null)
m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID);
m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile();
} }
/// <summary> /// <summary>
/// Set the current Windlight scene to a target avatar /// Set the current Windlight scene to a target avatar