cosmetics
parent
6c94f5d432
commit
0e6a7c3dac
|
@ -5193,7 +5193,7 @@ Label_GroupsDone:
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void ForEachRootScenePresence(Action<ScenePresence> action)
|
public void ForEachRootScenePresence(Action<ScenePresence> action)
|
||||||
{
|
{
|
||||||
m_sceneGraph.ForEachAvatar(action);
|
m_sceneGraph.ForEachRootScenePresence(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -820,13 +820,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int rootcount = 0;
|
int rootcount = 0;
|
||||||
int childcount = 0;
|
int childcount = 0;
|
||||||
|
|
||||||
ForEachScenePresence(delegate(ScenePresence presence)
|
List<ScenePresence> presences = GetScenePresences();
|
||||||
|
for (int i = 0; i < presences.Count; ++i)
|
||||||
{
|
{
|
||||||
if (presence.IsChildAgent)
|
if (presences[i].IsChildAgent)
|
||||||
++childcount;
|
++childcount;
|
||||||
else
|
else
|
||||||
++rootcount;
|
++rootcount;
|
||||||
});
|
};
|
||||||
|
|
||||||
m_numRootAgents = rootcount;
|
m_numRootAgents = rootcount;
|
||||||
m_numChildAgents = childcount;
|
m_numChildAgents = childcount;
|
||||||
|
@ -1374,29 +1375,39 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// This is just a shortcut function since frequently actions only appy to root SPs
|
/// This is just a shortcut function since frequently actions only appy to root SPs
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void ForEachAvatar(Action<ScenePresence> action)
|
public void ForEachRootScenePresence(Action<ScenePresence> action)
|
||||||
{
|
{
|
||||||
ForEachScenePresence(delegate(ScenePresence sp)
|
List<ScenePresence> presences = GetScenePresences();
|
||||||
|
for (int i = 0; i < presences.Count; ++i)
|
||||||
{
|
{
|
||||||
if (!sp.IsChildAgent)
|
if(presences[i].IsChildAgent || presences[i].IsDeleted)
|
||||||
action(sp);
|
continue;
|
||||||
});
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
action(presences[i]);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.Error("[SCENEGRAPH]: Error in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs action on all scene presences. This can ultimately run the actions in parallel but
|
/// Performs action on all scene presences
|
||||||
/// any delegates passed in will need to implement their own locking on data they reference and
|
|
||||||
/// modify outside of the scope of the delegate.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void ForEachScenePresence(Action<ScenePresence> action)
|
public void ForEachScenePresence(Action<ScenePresence> action)
|
||||||
{
|
{
|
||||||
List<ScenePresence> presences = GetScenePresences();
|
List<ScenePresence> presences = GetScenePresences();
|
||||||
foreach (ScenePresence sp in presences)
|
for(int i = 0; i < presences.Count; ++i)
|
||||||
{
|
{
|
||||||
|
if (presences[i].IsDeleted)
|
||||||
|
continue;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
action(sp);
|
action(presences[i]);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue