Add lsClearWindlightScene() to the lightshare module to remove WL settings

from a region and allow normal day cycles to be reestablished
This commit is contained in:
Melanie
2010-11-03 02:31:43 +00:00
parent 4ab9d37a8e
commit 6c3b7617b0
12 changed files with 64 additions and 1 deletions

View File

@@ -466,6 +466,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
return success;
}
public void lsClearWindlightScene()
{
if (!m_LSFunctionsEnabled)
{
LSShoutError("LightShare functions are not enabled.");
return;
}
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
{
LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
return;
}
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);
}
/// <summary>
/// Set the current Windlight scene to a target avatar
/// </summary>

View File

@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_List lsGetWindlightScene(LSL_List rules);
int lsSetWindlightScene(LSL_List rules);
int lsSetWindlightSceneTargeted(LSL_List rules, key target);
void lsClearWindlightScene();
}
}

View File

@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
}
public void lsClearWindlightScene()
{
m_LS_Functions.lsClearWindlightScene();
}
}
}