aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs30
1 files changed, 9 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
index a2cfce6..5fa3dc2 100644
--- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
+++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Mono.Addins;
31using Nini.Config; 30using Nini.Config;
32using OpenMetaverse; 31using OpenMetaverse;
33using OpenSim.Framework; 32using OpenSim.Framework;
@@ -36,7 +35,6 @@ using OpenSim.Region.Framework.Scenes;
36 35
37namespace OpenSim.Region.CoreModules 36namespace OpenSim.Region.CoreModules
38{ 37{
39 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
40 public class CloudModule : ICloudModule 38 public class CloudModule : ICloudModule
41 { 39 {
42// private static readonly log4net.ILog m_log 40// private static readonly log4net.ILog m_log
@@ -50,7 +48,7 @@ namespace OpenSim.Region.CoreModules
50 private float m_cloudDensity = 1.0F; 48 private float m_cloudDensity = 1.0F;
51 private float[] cloudCover = new float[16 * 16]; 49 private float[] cloudCover = new float[16 * 16];
52 50
53 public void Initialise(IConfigSource config) 51 public void Initialise(Scene scene, IConfigSource config)
54 { 52 {
55 IConfig cloudConfig = config.Configs["Cloud"]; 53 IConfig cloudConfig = config.Configs["Cloud"];
56 54
@@ -60,17 +58,10 @@ namespace OpenSim.Region.CoreModules
60 m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); 58 m_cloudDensity = cloudConfig.GetFloat("density", 0.5F);
61 m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); 59 m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000);
62 } 60 }
63 }
64
65 public Type ReplaceableInterface
66 {
67 get { return null; }
68 }
69 61
70 public void AddRegion(Scene scene)
71 {
72 if (m_enabled) 62 if (m_enabled)
73 { 63 {
64
74 m_scene = scene; 65 m_scene = scene;
75 66
76 scene.EventManager.OnNewClient += CloudsToClient; 67 scene.EventManager.OnNewClient += CloudsToClient;
@@ -80,18 +71,9 @@ namespace OpenSim.Region.CoreModules
80 GenerateCloudCover(); 71 GenerateCloudCover();
81 72
82 m_ready = true; 73 m_ready = true;
83 }
84 }
85 74
86 public void RegionLoaded(Scene scene) 75 }
87 {
88 }
89 76
90 public void RemoveRegion(Scene scene)
91 {
92 scene.EventManager.OnNewClient -= CloudsToClient;
93 scene.UnregisterModuleInterface<ICloudModule>(this);
94 scene.EventManager.OnFrame -= CloudUpdate;
95 } 77 }
96 78
97 public void PostInitialise() 79 public void PostInitialise()
@@ -114,6 +96,12 @@ namespace OpenSim.Region.CoreModules
114 get { return "CloudModule"; } 96 get { return "CloudModule"; }
115 } 97 }
116 98
99 public bool IsSharedModule
100 {
101 get { return false; }
102 }
103
104
117 public float CloudCover(int x, int y, int z) 105 public float CloudCover(int x, int y, int z)
118 { 106 {
119 float cover = 0f; 107 float cover = 0f;