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.
avinationmerge
Melanie Thielker 2010-05-04 18:10:13 +02:00
parent da849aea78
commit 4f93d30790
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

@ -5109,5 +5109,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);
}
}
}
}