diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/ISunModule.cs | 2 |
2 files changed, 28 insertions, 20 deletions
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 | |||
267 | return GetCurrentSunHour() + 6.0f; | 267 | return GetCurrentSunHour() + 6.0f; |
268 | } | 268 | } |
269 | 269 | ||
270 | #region IRegion Methods | 270 | #region INonSharedRegion Methods |
271 | 271 | ||
272 | // Called immediately after the module is loaded for a given region | 272 | // Called immediately after the module is loaded for a given region |
273 | // i.e. Immediately after instance creation. | 273 | // i.e. Immediately after instance creation. |
274 | public void Initialise(Scene scene, IConfigSource config) | 274 | public void Initialise(IConfigSource config) |
275 | { | 275 | { |
276 | m_scene = scene; | ||
277 | m_frame = 0; | 276 | m_frame = 0; |
278 | 277 | ||
279 | // This one puts an entry in the main help screen | 278 | // This one puts an entry in the main help screen |
@@ -358,15 +357,6 @@ namespace OpenSim.Region.CoreModules | |||
358 | HorizonShift = m_HorizonShift; // Z axis translation | 357 | HorizonShift = m_HorizonShift; // Z axis translation |
359 | // HoursToRadians = (SunCycle/24)*VWTimeRatio; | 358 | // HoursToRadians = (SunCycle/24)*VWTimeRatio; |
360 | 359 | ||
361 | // Insert our event handling hooks | ||
362 | |||
363 | scene.EventManager.OnFrame += SunUpdate; | ||
364 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; | ||
365 | scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; | ||
366 | scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; | ||
367 | |||
368 | ready = true; | ||
369 | |||
370 | m_log.Debug("[SUN]: Mode is " + m_RegionMode); | 360 | m_log.Debug("[SUN]: Mode is " + m_RegionMode); |
371 | m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); | 361 | m_log.Debug("[SUN]: Initialization completed. Day is " + SecondsPerSunCycle + " seconds, and year is " + m_YearLengthDays + " days"); |
372 | m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); | 362 | m_log.Debug("[SUN]: Axis offset is " + m_HorizonShift); |
@@ -376,14 +366,29 @@ namespace OpenSim.Region.CoreModules | |||
376 | break; | 366 | break; |
377 | } | 367 | } |
378 | 368 | ||
379 | scene.RegisterModuleInterface<ISunModule>(this); | ||
380 | } | 369 | } |
381 | 370 | ||
382 | public void PostInitialise() | 371 | public Type ReplaceableInterface |
383 | { | 372 | { |
373 | get { return null; } | ||
384 | } | 374 | } |
385 | 375 | ||
386 | public void Close() | 376 | public void AddRegion(Scene scene) |
377 | { | ||
378 | m_scene = scene; | ||
379 | // Insert our event handling hooks | ||
380 | |||
381 | scene.EventManager.OnFrame += SunUpdate; | ||
382 | scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; | ||
383 | scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; | ||
384 | scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; | ||
385 | |||
386 | scene.RegisterModuleInterface<ISunModule>(this); | ||
387 | |||
388 | ready = true; | ||
389 | } | ||
390 | |||
391 | public void RemoveRegion(Scene scene) | ||
387 | { | 392 | { |
388 | ready = false; | 393 | ready = false; |
389 | 394 | ||
@@ -394,14 +399,17 @@ namespace OpenSim.Region.CoreModules | |||
394 | m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; | 399 | m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; |
395 | } | 400 | } |
396 | 401 | ||
397 | public string Name | 402 | public void RegionLoaded(Scene scene) |
398 | { | 403 | { |
399 | get { return "SunModule"; } | ||
400 | } | 404 | } |
401 | 405 | ||
402 | public bool IsSharedModule | 406 | public void Close() |
403 | { | 407 | { |
404 | get { return false; } | 408 | } |
409 | |||
410 | public string Name | ||
411 | { | ||
412 | get { return "SunModule"; } | ||
405 | } | 413 | } |
406 | 414 | ||
407 | #endregion | 415 | #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; | |||
29 | 29 | ||
30 | namespace OpenSim.Region.Framework.Interfaces | 30 | namespace OpenSim.Region.Framework.Interfaces |
31 | { | 31 | { |
32 | public interface ISunModule : IRegionModule | 32 | public interface ISunModule : INonSharedRegionModule |
33 | { | 33 | { |
34 | double GetSunParameter(string param); | 34 | double GetSunParameter(string param); |
35 | 35 | ||