Allow reloading of estate settings into a running region. Move sun update

helper into Scene, since that is less evil than exposing m_storageManager
to the public.
slimupdates
Melanie Thielker 2010-05-04 18:10:13 +02:00 committed by Melanie
parent 9635af61f0
commit 6eea0a3931
2 changed files with 49 additions and 37 deletions

View File

@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.RegionSettings.FixedSun = UseFixedSun;
m_scene.RegionInfo.RegionSettings.SunPosition = SunHour;
TriggerEstateToolsSunUpdate();
m_scene.TriggerEstateSunUpdate();
//m_log.Debug("[ESTATE]: UFS: " + UseFixedSun.ToString());
//m_log.Debug("[ESTATE]: SunHour: " + SunHour.ToString());
@ -861,7 +861,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegionInfo.EstateSettings.Save();
TriggerEstateToolsSunUpdate();
m_scene.TriggerEstateSunUpdate();
sendDetailedEstateData(remoteClient, invoice);
}
@ -983,7 +983,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
{
// Sets up the sun module based no the saved Estate and Region Settings
// DO NOT REMOVE or the sun will stop working
TriggerEstateToolsSunUpdate();
m_scene.TriggerEstateSunUpdate();
}
public void Close()
@ -1004,40 +1004,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
#region Other Functions
private void TriggerEstateToolsSunUpdate()
{
float sun;
if (m_scene.RegionInfo.RegionSettings.UseEstateSun)
{
sun = (float)m_scene.RegionInfo.EstateSettings.SunPosition;
if (m_scene.RegionInfo.EstateSettings.UseGlobalTime)
{
sun = m_scene.EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f;
}
//
m_scene.EventManager.TriggerEstateToolsSunUpdate(
m_scene.RegionInfo.RegionHandle,
m_scene.RegionInfo.EstateSettings.FixedSun,
m_scene.RegionInfo.RegionSettings.UseEstateSun,
sun);
}
else
{
// Use the Sun Position from the Region Settings
sun = (float)m_scene.RegionInfo.RegionSettings.SunPosition - 6.0f;
m_scene.EventManager.TriggerEstateToolsSunUpdate(
m_scene.RegionInfo.RegionHandle,
m_scene.RegionInfo.RegionSettings.FixedSun,
m_scene.RegionInfo.RegionSettings.UseEstateSun,
sun);
}
}
public void changeWaterHeight(float height)
{
setRegionTerrainSettings(height,

View File

@ -5075,5 +5075,51 @@ namespace OpenSim.Region.Framework.Scenes
{
return new Vector3(x, y, GetGroundHeight(x, y));
}
public List<UUID> GetEstateRegions(int estateID)
{
if (m_storageManager.EstateDataStore == null)
return new List<UUID>();
return m_storageManager.EstateDataStore.GetRegions(estateID);
}
public void ReloadEstateData()
{
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
TriggerEstateSunUpdate();
}
public void TriggerEstateSunUpdate()
{
float sun;
if (RegionInfo.RegionSettings.UseEstateSun)
{
sun = (float)RegionInfo.EstateSettings.SunPosition;
if (RegionInfo.EstateSettings.UseGlobalTime)
{
sun = EventManager.GetCurrentTimeAsSunLindenHour() - 6.0f;
}
//
EventManager.TriggerEstateToolsSunUpdate(
RegionInfo.RegionHandle,
RegionInfo.EstateSettings.FixedSun,
RegionInfo.RegionSettings.UseEstateSun,
sun);
}
else
{
// Use the Sun Position from the Region Settings
sun = (float)RegionInfo.RegionSettings.SunPosition - 6.0f;
EventManager.TriggerEstateToolsSunUpdate(
RegionInfo.RegionHandle,
RegionInfo.RegionSettings.FixedSun,
RegionInfo.RegionSettings.UseEstateSun,
sun);
}
}
}
}