Rename ForEachAvatar back to ForEachScenePresence. The other changes

from previous commit which sort out which iterator is used are left
intact. A discussion is needed as to what constitutes an avatar vs a
ScenePresence.
remove-scene-viewer
Dan Lake 2011-11-03 17:53:51 -07:00
parent 94dc7d07eb
commit b8d50b10fb
16 changed files with 35 additions and 35 deletions

View File

@ -148,7 +148,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
Rest.main.SceneManager.ForEachScene(delegate(Scene s)
{
s.ForEachAvatar(delegate(ScenePresence sp)
s.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.Firstname == names[0] && sp.Lastname == names[1])
{

View File

@ -230,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{
// This should use ForEachClient, but clients don't have a position.
// If camera is moved into client, then camera position can be used
s.ForEachAvatar(
s.ForEachRootScenePresence(
delegate(ScenePresence presence)
{
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))

View File

@ -476,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
{
m_scene.ForEachAvatar(delegate(ScenePresence avatar)
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
{
ILandObject over = null;
try

View File

@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
SceneObjectGroup grp = part.ParentGroup;
m_scene.ForEachAvatar(delegate(ScenePresence sp)
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
if (dis > 100.0) // Max audio distance
@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
}
}
m_scene.ForEachAvatar(delegate(ScenePresence sp)
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
if (dis > 100.0) // Max audio distance

View File

@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
else
{
m_scene.ForEachAvatar(delegate(ScenePresence sp)
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
// Don't send a green dot for yourself
if (sp.UUID != remoteClient.AgentId)
@ -1180,7 +1180,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
else
{
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
m_scene.ForEachAvatar(delegate(ScenePresence sp)
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
OSDMap responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X));

View File

@ -872,7 +872,7 @@ namespace OpenSim.Region.Framework.Scenes
try
{
ForEachAvatar(delegate(ScenePresence agent)
ForEachRootScenePresence(delegate(ScenePresence agent)
{
//agent.ControllingClient.new
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
@ -1017,7 +1017,7 @@ namespace OpenSim.Region.Framework.Scenes
GridRegion r = new GridRegion(region);
try
{
ForEachAvatar(delegate(ScenePresence agent)
ForEachRootScenePresence(delegate(ScenePresence agent)
{
if (m_teleportModule != null)
m_teleportModule.EnableChildAgent(agent, r);
@ -4228,7 +4228,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Avatars may be an NPC or a 'real' client.
/// </summary>
/// <param name="action"></param>
public void ForEachAvatar(Action<ScenePresence> action)
public void ForEachRootScenePresence(Action<ScenePresence> action)
{
if(m_sceneGraph != null)
{
@ -4326,7 +4326,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="action"></param>
public void ForEachRootClient(Action<IClientAPI> action)
{
ForEachAvatar(delegate(ScenePresence presence)
ForEachRootScenePresence(delegate(ScenePresence presence)
{
action(presence.ControllingClient);
});

View File

@ -481,7 +481,7 @@ namespace OpenSim.Region.Framework.Scenes
ForEachCurrentScene(
delegate(Scene scene)
{
scene.ForEachAvatar(delegate(ScenePresence scenePresence)
scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
{
avatars.Add(scenePresence);
});

View File

@ -1150,7 +1150,7 @@ namespace OpenSim.Region.Framework.Scenes
{
SceneObjectPart part = parts[i];
Scene.ForEachAvatar(delegate(ScenePresence avatar)
Scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
{
if (avatar.ParentID == LocalId)
avatar.StandUp();

View File

@ -2216,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av)
{
if (av.LocalId == localId)
{
@ -2347,7 +2347,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av)
{
if (av.LocalId == localId)
{
@ -2470,7 +2470,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av)
{
if (av.LocalId == localId)
{
@ -2696,7 +2696,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence sp)
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);

View File

@ -956,7 +956,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// send the animations of the other presences to me
m_scene.ForEachAvatar(delegate(ScenePresence presence)
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence != this)
presence.Animator.SendAnimPackToClient(ControllingClient);
@ -2596,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendOtherAgentsAvatarDataToMe()
{
int count = 0;
m_scene.ForEachAvatar(delegate(ScenePresence scenePresence)
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
{
// only send information about other root agents
if (scenePresence.UUID == UUID)
@ -2660,7 +2660,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
int count = 0;
m_scene.ForEachAvatar(delegate(ScenePresence scenePresence)
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
{
// only send information about other root agents
if (scenePresence.UUID == UUID)

View File

@ -112,7 +112,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
scene.ForEachAvatar(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
}
}
}
@ -123,7 +123,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
{
foreach (Scene scene in m_scenes.Values)
{
scene.ForEachAvatar(
scene.ForEachRootScenePresence(
delegate(ScenePresence sp)
{
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);

View File

@ -373,7 +373,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
scene.RegionInfo.RegionID,
DateTime.UtcNow.ToString("s")));
scene.ForEachAvatar(delegate(ScenePresence sp)
scene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
list.Append("</avatars>");

View File

@ -711,7 +711,7 @@ namespace OpenSim.Region.RegionCombinerModule
List<Vector3> CoarseLocations = new List<Vector3>();
List<UUID> AvatarUUIDs = new List<UUID>();
connectiondata.RegionScene.ForEachAvatar(delegate(ScenePresence sp)
connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.UUID != presence.UUID)
{

View File

@ -3740,7 +3740,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
List<UUID> keytable = new List<UUID>();
// parse for sitting avatare-uuids
World.ForEachAvatar(delegate(ScenePresence presence)
World.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
keytable.Add(presence.UUID);
@ -3802,7 +3802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
// parse for sitting avatare-names
List<String> nametable = new List<String>();
World.ForEachAvatar(delegate(ScenePresence presence)
World.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
nametable.Add(presence.ControllingClient.Name);
@ -7611,7 +7611,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
int avatarCount = 0;
World.ForEachAvatar(delegate(ScenePresence presence)
World.ForEachRootScenePresence(delegate(ScenePresence presence)
{
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
avatarCount++;
@ -9379,7 +9379,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
landObject.SetMediaUrl(url);
// now send to all (non-child) agents in the parcel
World.ForEachAvatar(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.currentParcelUUID == landData.GlobalID)
{
@ -9412,7 +9412,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence == null)
{
// send to all (non-child) agents in the parcel
World.ForEachAvatar(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.currentParcelUUID == landData.GlobalID)
{
@ -10527,7 +10527,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (checkAgents)
{
World.ForEachAvatar(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.AbsolutePosition.ApproxEquals(posToCheck, sp.PhysicsActor.Size.X))
{

View File

@ -873,7 +873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.None, "osGetAgents");
LSL_List result = new LSL_List();
World.ForEachAvatar(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
result.Add(new LSL_String(sp.Name));
});
@ -2581,7 +2581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{
World.ForEachAvatar(delegate(ScenePresence sp)
World.ForEachRootScenePresence(delegate(ScenePresence sp)
{
if (sp.Firstname == FirstName && sp.Lastname == SurName)
{
@ -2715,7 +2715,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
LSL_List result = new LSL_List();
World.ForEachAvatar(delegate (ScenePresence avatar)
World.ForEachRootScenePresence(delegate (ScenePresence avatar)
{
if (avatar != null && avatar.UUID != m_host.OwnerID)
{

View File

@ -507,7 +507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
senseEntity(sp);
if ((ts.type & AGENT_BY_USERNAME) != 0)
{
m_CmdManager.m_ScriptEngine.World.ForEachAvatar(
m_CmdManager.m_ScriptEngine.World.ForEachRootScenePresence(
delegate (ScenePresence ssp)
{
if (ssp.Lastname == "Resident")
@ -526,7 +526,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
}
else
{
m_CmdManager.m_ScriptEngine.World.ForEachAvatar(senseEntity);
m_CmdManager.m_ScriptEngine.World.ForEachRootScenePresence(senseEntity);
}
return sensedEntities;
}