mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Added new ForEachRootScenePresence to Scene since almost every delegate passed to ForEachScenePresence checks for !IsChildAgent first. It consolidates child and root handling for coming refactors.
This commit is contained in:
@@ -658,17 +658,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
|
||||
return;
|
||||
|
||||
Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.UUID != senderID)
|
||||
{
|
||||
ScenePresence p = Scene.GetScenePresence(sp.UUID);
|
||||
// make sure they are still there, we could be working down a long list
|
||||
// Also make sure they are actually in the region
|
||||
if (p != null && !p.IsChildAgent)
|
||||
{
|
||||
ScenePresence p;
|
||||
if(Scene.TryGetScenePresence(sp.UUID, out p))
|
||||
Scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -929,10 +927,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public void sendRegionInfoPacketToAll()
|
||||
{
|
||||
Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
HandleRegionInfoRequest(sp.ControllingClient);
|
||||
HandleRegionInfoRequest(sp.ControllingClient);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -476,11 +476,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
|
||||
{
|
||||
if (avatar.IsChildAgent)
|
||||
return;
|
||||
|
||||
ILandObject over = null;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -70,11 +70,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
|
||||
SceneObjectGroup grp = part.ParentGroup;
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||
if (dis > 100.0) // Max audio distance
|
||||
return;
|
||||
@@ -122,11 +119,8 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
}
|
||||
}
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||
if (dis > 100.0) // Max audio distance
|
||||
return;
|
||||
|
||||
@@ -488,12 +488,9 @@ namespace OpenSim.Region.CoreModules
|
||||
|
||||
private void SunUpdateToAllClients()
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
{
|
||||
SunToClient(sp.ControllingClient);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -435,10 +435,9 @@ namespace OpenSim.Region.CoreModules
|
||||
m_frameLastUpdateClientArray = m_frame;
|
||||
}
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (!sp.IsChildAgent)
|
||||
sp.ControllingClient.SendWindData(windSpeeds);
|
||||
sp.ControllingClient.SendWindData(windSpeeds);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,10 +401,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
// Don't send a green dot for yourself
|
||||
if (!sp.IsChildAgent && sp.UUID != remoteClient.AgentId)
|
||||
if (sp.UUID != remoteClient.AgentId)
|
||||
{
|
||||
mapitem = new mapItemReply();
|
||||
mapitem.x = (uint)(xstart + sp.AbsolutePosition.X);
|
||||
|
||||
Reference in New Issue
Block a user