mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user