aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs51
1 files changed, 2 insertions, 49 deletions
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
index b9c716f..ca25a23 100644
--- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
+++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
@@ -48,8 +48,6 @@ 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 private Dictionary<UUID, ulong> m_rootAgents = new Dictionary<UUID, ulong>();
52
53 public void Initialise(Scene scene, IConfigSource config) 51 public void Initialise(Scene scene, IConfigSource config)
54 { 52 {
55 IConfig cloudConfig = config.Configs["Cloud"]; 53 IConfig cloudConfig = config.Configs["Cloud"];
@@ -66,9 +64,7 @@ namespace OpenSim.Region.CoreModules
66 64
67 m_scene = scene; 65 m_scene = scene;
68 66
69 scene.EventManager.OnMakeChildAgent += MakeChildAgent; 67 scene.EventManager.OnNewClient += CloudsToClient;
70 scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
71 scene.EventManager.OnClientClosed += ClientLoggedOut;
72 scene.RegisterModuleInterface<ICloudModule>(this); 68 scene.RegisterModuleInterface<ICloudModule>(this);
73 scene.EventManager.OnFrame += CloudUpdate; 69 scene.EventManager.OnFrame += CloudUpdate;
74 70
@@ -90,9 +86,7 @@ namespace OpenSim.Region.CoreModules
90 { 86 {
91 m_ready = false; 87 m_ready = false;
92 // Remove our hooks 88 // Remove our hooks
93 m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent; 89 m_scene.EventManager.OnNewClient -= CloudsToClient;
94 m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
95 m_scene.EventManager.OnClientClosed -= ClientLoggedOut;
96 m_scene.EventManager.OnFrame -= CloudUpdate; 90 m_scene.EventManager.OnFrame -= CloudUpdate;
97 } 91 }
98 } 92 }
@@ -215,46 +209,5 @@ namespace OpenSim.Region.CoreModules
215 } 209 }
216 } 210 }
217 } 211 }
218
219 private void ClientLoggedOut(UUID AgentId)
220 {
221 lock (m_rootAgents)
222 {
223 if (m_rootAgents.ContainsKey(AgentId))
224 {
225 m_rootAgents.Remove(AgentId);
226 }
227 }
228 }
229
230 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
231 {
232 lock (m_rootAgents)
233 {
234 if (m_rootAgents.ContainsKey(avatar.UUID))
235 {
236 m_rootAgents[avatar.UUID] = avatar.RegionHandle;
237 }
238 else
239 {
240 m_rootAgents.Add(avatar.UUID, avatar.RegionHandle);
241 CloudsToClient(avatar.ControllingClient);
242 }
243 }
244 }
245
246 private void MakeChildAgent(ScenePresence avatar)
247 {
248 lock (m_rootAgents)
249 {
250 if (m_rootAgents.ContainsKey(avatar.UUID))
251 {
252 if (m_rootAgents[avatar.UUID] == avatar.RegionHandle)
253 {
254 m_rootAgents.Remove(avatar.UUID);
255 }
256 }
257 }
258 }
259 } 212 }
260} 213}