From 988737b182a59bc0bca72b3c302ab68dd9c5ccfb Mon Sep 17 00:00:00 2001 From: idb Date: Sat, 11 Apr 2009 10:18:20 +0000 Subject: [PATCH] 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. --- .../CoreModules/World/Cloud/CloudModule.cs | 51 +------------------ bin/OpenSim.ini.example | 4 +- 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index b9c716f241..ca25a23b50 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 private float m_cloudDensity = 1.0F; private float[] cloudCover = new float[16 * 16]; - private Dictionary m_rootAgents = new Dictionary(); - public void Initialise(Scene scene, IConfigSource config) { IConfig cloudConfig = config.Configs["Cloud"]; @@ -66,9 +64,7 @@ namespace OpenSim.Region.CoreModules m_scene = scene; - scene.EventManager.OnMakeChildAgent += MakeChildAgent; - scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; - scene.EventManager.OnClientClosed += ClientLoggedOut; + scene.EventManager.OnNewClient += CloudsToClient; scene.RegisterModuleInterface(this); scene.EventManager.OnFrame += CloudUpdate; @@ -90,9 +86,7 @@ namespace OpenSim.Region.CoreModules { m_ready = false; // Remove our hooks - m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent; - m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; - m_scene.EventManager.OnClientClosed -= ClientLoggedOut; + m_scene.EventManager.OnNewClient -= CloudsToClient; m_scene.EventManager.OnFrame -= CloudUpdate; } } @@ -215,46 +209,5 @@ namespace OpenSim.Region.CoreModules } } } - - private void ClientLoggedOut(UUID AgentId) - { - lock (m_rootAgents) - { - if (m_rootAgents.ContainsKey(AgentId)) - { - m_rootAgents.Remove(AgentId); - } - } - } - - private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) - { - lock (m_rootAgents) - { - if (m_rootAgents.ContainsKey(avatar.UUID)) - { - m_rootAgents[avatar.UUID] = avatar.RegionHandle; - } - else - { - m_rootAgents.Add(avatar.UUID, avatar.RegionHandle); - CloudsToClient(avatar.ControllingClient); - } - } - } - - private void MakeChildAgent(ScenePresence avatar) - { - lock (m_rootAgents) - { - if (m_rootAgents.ContainsKey(avatar.UUID)) - { - if (m_rootAgents[avatar.UUID] == avatar.RegionHandle) - { - m_rootAgents.Remove(avatar.UUID); - } - } - } - } } } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 28264629a2..ee2cfd6236 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -752,9 +752,9 @@ [Cloud] ; Enable this to generate classic particle clouds above the sim. ; default is disabled - turn it on here - enabled = true + enabled = false - ; Density of cloud cover 0.0 to 1.0 + ; Density of cloud cover 0.0 to 1.0 Defult 0.5 density = 0.5 ; update interval for the cloud cover data returned by llCloud().