From 7dfd1468cc53b622257808fa445519244b1b0716 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 9 Nov 2012 15:38:10 -0800 Subject: Converted the SunModule to the new region module interface. (39 to go...) --- OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 46 +++++++++++++---------- OpenSim/Region/Framework/Interfaces/ISunModule.cs | 2 +- 2 files changed, 28 insertions(+), 20 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index 9a954b8..df025bf 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -267,13 +267,12 @@ namespace OpenSim.Region.CoreModules return GetCurrentSunHour() + 6.0f; } - #region IRegion Methods + #region INonSharedRegion Methods // Called immediately after the module is loaded for a given region // i.e. Immediately after instance creation. - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; m_frame = 0; // This one puts an entry in the main help screen @@ -358,15 +357,6 @@ namespace OpenSim.Region.CoreModules HorizonShift = m_HorizonShift; // Z axis translation // HoursToRadians = (SunCycle/24)*VWTimeRatio; - // Insert our event handling hooks - - scene.EventManager.OnFrame += SunUpdate; - scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; - scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; - scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; - - ready = true; - m_log.Debug("[SUN]: Mode is " + m_RegionMode); m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); @@ -376,14 +366,29 @@ namespace OpenSim.Region.CoreModules break; } - scene.RegisterModuleInterface(this); } - public void PostInitialise() + public Type ReplaceableInterface { + get { return null; } } - public void Close() + public void AddRegion(Scene scene) + { + m_scene = scene; + // Insert our event handling hooks + + scene.EventManager.OnFrame += SunUpdate; + scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; + scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; + scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; + + scene.RegisterModuleInterface(this); + + ready = true; + } + + public void RemoveRegion(Scene scene) { ready = false; @@ -394,14 +399,17 @@ namespace OpenSim.Region.CoreModules m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; } - public string Name + public void RegionLoaded(Scene scene) { - get { return "SunModule"; } } - public bool IsSharedModule + public void Close() { - get { return false; } + } + + public string Name + { + get { return "SunModule"; } } #endregion diff --git a/OpenSim/Region/Framework/Interfaces/ISunModule.cs b/OpenSim/Region/Framework/Interfaces/ISunModule.cs index 819ae11..8231716 100644 --- a/OpenSim/Region/Framework/Interfaces/ISunModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ISunModule.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { - public interface ISunModule : IRegionModule + public interface ISunModule : INonSharedRegionModule { double GetSunParameter(string param); -- cgit v1.1