aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authoridb2009-04-11 10:18:20 +0000
committeridb2009-04-11 10:18:20 +0000
commit988737b182a59bc0bca72b3c302ab68dd9c5ccfb (patch)
tree481d5527ab3a81dbc0c5df1cea6b27bae52a583b /OpenSim/Region/CoreModules
parent* BulletDotNETPlugin supports Axis lock (LLSetStatus) from the script engine ... (diff)
downloadopensim-SC-988737b182a59bc0bca72b3c302ab68dd9c5ccfb.zip
opensim-SC-988737b182a59bc0bca72b3c302ab68dd9c5ccfb.tar.gz
opensim-SC-988737b182a59bc0bca72b3c302ab68dd9c5ccfb.tar.bz2
opensim-SC-988737b182a59bc0bca72b3c302ab68dd9c5ccfb.tar.xz
Correct Opensim.ini.example to reflect the default settings for clouds.
Fixes Mantis #3421 Change the agent/avatar events subscriptions to just OnNewClient. The data only needs to be sent once and keeping track of log ins/movements is not required. This will also send cloud data to child agents so that they can see clouds above neighbouring regions not just regions that they have visited.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-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}