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.
0.6.5-rc1
idb 2009-04-11 10:18:20 +00:00
parent 2dca78b2bf
commit 988737b182
2 changed files with 4 additions and 51 deletions

View File

@ -48,8 +48,6 @@ namespace OpenSim.Region.CoreModules
private float m_cloudDensity = 1.0F;
private float[] cloudCover = new float[16 * 16];
private Dictionary<UUID, ulong> m_rootAgents = new Dictionary<UUID, ulong>();
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<ICloudModule>(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);
}
}
}
}
}
}

View File

@ -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().