diff options
3 files changed, 34 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index 820f11b..81f1ff6 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -44,6 +44,7 @@ | |||
44 | <RegionModule id="VegetationModule" type="OpenSim.Region.CoreModules.Avatar.Vegetation.VegetationModule"/> | 44 | <RegionModule id="VegetationModule" type="OpenSim.Region.CoreModules.Avatar.Vegetation.VegetationModule"/> |
45 | <RegionModule id="IPBanModule" type="OpenSim.Region.CoreModules.Agent.IPBan.IPBanModule"/> | 45 | <RegionModule id="IPBanModule" type="OpenSim.Region.CoreModules.Agent.IPBan.IPBanModule"/> |
46 | <RegionModule id="J2KDecoderModule" type="OpenSim.Region.CoreModules.Agent.TextureSender.J2KDecoderModule"/> | 46 | <RegionModule id="J2KDecoderModule" type="OpenSim.Region.CoreModules.Agent.TextureSender.J2KDecoderModule"/> |
47 | <RegionModule id="CloudModule" type="OpenSim.Region.CoreModules.CloudModule"/> | ||
47 | <!-- Service connectors OUT modules --> | 48 | <!-- Service connectors OUT modules --> |
48 | <RegionModule id="LocalAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.LocalAssetServicesConnector" /> | 49 | <RegionModule id="LocalAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.LocalAssetServicesConnector" /> |
49 | <RegionModule id="RemoteAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.RemoteAssetServicesConnector" /> | 50 | <RegionModule id="RemoteAssetServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.RemoteAssetServicesConnector" /> |
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index 5fa3dc2..2ec6ff9 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes; | |||
35 | 35 | ||
36 | namespace OpenSim.Region.CoreModules | 36 | namespace OpenSim.Region.CoreModules |
37 | { | 37 | { |
38 | public class CloudModule : ICloudModule | 38 | public class CloudModule : ICloudModule, INonSharedRegionModule |
39 | { | 39 | { |
40 | // private static readonly log4net.ILog m_log | 40 | // private static readonly log4net.ILog m_log |
41 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 41 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
@@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules | |||
48 | private float m_cloudDensity = 1.0F; | 48 | private float m_cloudDensity = 1.0F; |
49 | private float[] cloudCover = new float[16 * 16]; | 49 | private float[] cloudCover = new float[16 * 16]; |
50 | 50 | ||
51 | public void Initialise(Scene scene, IConfigSource config) | 51 | public void Initialise(IConfigSource config) |
52 | { | 52 | { |
53 | IConfig cloudConfig = config.Configs["Cloud"]; | 53 | IConfig cloudConfig = config.Configs["Cloud"]; |
54 | 54 | ||
@@ -59,21 +59,40 @@ namespace OpenSim.Region.CoreModules | |||
59 | m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); | 59 | m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); |
60 | } | 60 | } |
61 | 61 | ||
62 | if (m_enabled) | 62 | } |
63 | { | ||
64 | 63 | ||
65 | m_scene = scene; | 64 | public void AddRegion(Scene scene) |
65 | { | ||
66 | if (!m_enabled) | ||
67 | return; | ||
66 | 68 | ||
67 | scene.EventManager.OnNewClient += CloudsToClient; | 69 | m_scene = scene; |
68 | scene.RegisterModuleInterface<ICloudModule>(this); | ||
69 | scene.EventManager.OnFrame += CloudUpdate; | ||
70 | 70 | ||
71 | GenerateCloudCover(); | 71 | scene.EventManager.OnNewClient += CloudsToClient; |
72 | scene.RegisterModuleInterface<ICloudModule>(this); | ||
73 | scene.EventManager.OnFrame += CloudUpdate; | ||
72 | 74 | ||
73 | m_ready = true; | 75 | GenerateCloudCover(); |
74 | 76 | ||
75 | } | 77 | m_ready = true; |
78 | } | ||
79 | |||
80 | public void RemoveRegion(Scene scene) | ||
81 | { | ||
82 | if (!m_enabled) | ||
83 | return; | ||
76 | 84 | ||
85 | m_ready = false; | ||
86 | // Remove our hooks | ||
87 | m_scene.EventManager.OnNewClient -= CloudsToClient; | ||
88 | m_scene.EventManager.OnFrame -= CloudUpdate; | ||
89 | m_scene.UnregisterModuleInterface<ICloudModule>(this); | ||
90 | |||
91 | m_scene = null; | ||
92 | } | ||
93 | |||
94 | public void RegionLoaded(Scene scene) | ||
95 | { | ||
77 | } | 96 | } |
78 | 97 | ||
79 | public void PostInitialise() | 98 | public void PostInitialise() |
@@ -82,13 +101,6 @@ namespace OpenSim.Region.CoreModules | |||
82 | 101 | ||
83 | public void Close() | 102 | public void Close() |
84 | { | 103 | { |
85 | if (m_enabled) | ||
86 | { | ||
87 | m_ready = false; | ||
88 | // Remove our hooks | ||
89 | m_scene.EventManager.OnNewClient -= CloudsToClient; | ||
90 | m_scene.EventManager.OnFrame -= CloudUpdate; | ||
91 | } | ||
92 | } | 104 | } |
93 | 105 | ||
94 | public string Name | 106 | public string Name |
@@ -96,12 +108,11 @@ namespace OpenSim.Region.CoreModules | |||
96 | get { return "CloudModule"; } | 108 | get { return "CloudModule"; } |
97 | } | 109 | } |
98 | 110 | ||
99 | public bool IsSharedModule | 111 | public Type ReplaceableInterface |
100 | { | 112 | { |
101 | get { return false; } | 113 | get { return null; } |
102 | } | 114 | } |
103 | 115 | ||
104 | |||
105 | public float CloudCover(int x, int y, int z) | 116 | public float CloudCover(int x, int y, int z) |
106 | { | 117 | { |
107 | float cover = 0f; | 118 | float cover = 0f; |
diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index 7296ac3..54172bd 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Region.Framework.Interfaces | 28 | namespace OpenSim.Region.Framework.Interfaces |
29 | { | 29 | { |
30 | public interface ICloudModule : IRegionModule | 30 | public interface ICloudModule |
31 | { | 31 | { |
32 | /// <summary> | 32 | /// <summary> |
33 | /// Retrieves the cloud density at the given region coordinates | 33 | /// Retrieves the cloud density at the given region coordinates |