From 988737b182a59bc0bca72b3c302ab68dd9c5ccfb Mon Sep 17 00:00:00 2001 From: idb Date: Sat, 11 Apr 2009 10:18:20 +0000 Subject: 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. --- .../Region/CoreModules/World/Cloud/CloudModule.cs | 51 +--------------------- 1 file changed, 2 insertions(+), 49 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs') 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 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); - } - } - } - } } } -- cgit v1.1