Renamed ForEachRootScenePresence to ForEachAvatar. Cleaned up calls to
the 3 iteration functions so more of them are using the correct iteration for the action they are performing. The 3 iterators that seem to fit all actions within OpenSim at this time are: ForEachAvatar: Perform an action on all avatars (root presences) ForEachClient: Perform an action on all clients (root or child clients) ForEachRootClient: Perform an action on all clients that have an avatar There are still a dozen places or so calling the old ForEachScenePresence that will take a little more refactoring to eliminate.remove-scene-viewer
parent
69a4057135
commit
94dc7d07eb
|
@ -148,7 +148,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||||
|
|
||||||
Rest.main.SceneManager.ForEachScene(delegate(Scene s)
|
Rest.main.SceneManager.ForEachScene(delegate(Scene s)
|
||||||
{
|
{
|
||||||
s.ForEachScenePresence(delegate(ScenePresence sp)
|
s.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.Firstname == names[0] && sp.Lastname == names[1])
|
if (sp.Firstname == names[0] && sp.Lastname == names[1])
|
||||||
{
|
{
|
||||||
|
|
|
@ -228,7 +228,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
|
|
||||||
foreach (Scene s in m_scenes)
|
foreach (Scene s in m_scenes)
|
||||||
{
|
{
|
||||||
s.ForEachScenePresence(
|
// 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(
|
||||||
delegate(ScenePresence presence)
|
delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
|
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
|
||||||
|
@ -279,11 +281,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
|
|
||||||
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
||||||
|
|
||||||
((Scene)c.Scene).ForEachRootScenePresence(
|
((Scene)c.Scene).ForEachRootClient(
|
||||||
delegate(ScenePresence presence)
|
delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
IClientAPI client = presence.ControllingClient;
|
|
||||||
|
|
||||||
// don't forward SayOwner chat from objects to
|
// don't forward SayOwner chat from objects to
|
||||||
// non-owner agents
|
// non-owner agents
|
||||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||||
|
@ -292,8 +292,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
return;
|
return;
|
||||||
|
|
||||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||||
receiverIDs.Add(presence.UUID);
|
receiverIDs.Add(client.AgentId);
|
||||||
});
|
});
|
||||||
|
|
||||||
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
||||||
|
|
|
@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||||
|
|
||||||
public void SendGeneralAlert(string message)
|
public void SendGeneralAlert(string message)
|
||||||
{
|
{
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.SendAlertMessage(message);
|
client.SendAlertMessage(message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,9 +162,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||||
public void SendNotificationToUsersInRegion(
|
public void SendNotificationToUsersInRegion(
|
||||||
UUID fromAvatarID, string fromAvatarName, string message)
|
UUID fromAvatarID, string fromAvatarName, string message)
|
||||||
{
|
{
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)
|
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,14 +140,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||||
// This is a bit crude. It seems the client will be null before it actually stops the thread
|
// This is a bit crude. It seems the client will be null before it actually stops the thread
|
||||||
// The thread will kill itself eventually :/
|
// The thread will kill itself eventually :/
|
||||||
// Is there another way to make sure *all* clients get this 'inter region' message?
|
// Is there another way to make sure *all* clients get this 'inter region' message?
|
||||||
m_scene.ForEachRootScenePresence(
|
m_scene.ForEachRootClient(
|
||||||
delegate(ScenePresence p)
|
delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
if (p.UUID != godID)
|
if (client.AgentId != godID)
|
||||||
{
|
{
|
||||||
// Possibly this should really be p.Close() though that method doesn't send a close
|
client.Close();
|
||||||
// to the client
|
|
||||||
p.ControllingClient.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -145,57 +145,38 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||||
param.Add(mBlock);
|
param.Add(mBlock);
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
public void SendProfileToClient(ScenePresence presence)
|
|
||||||
|
public void SendProfileToClient(IClientAPI client)
|
||||||
|
{
|
||||||
|
SendProfileToClient(client, m_scene.RegionInfo.WindlightSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
|
||||||
{
|
{
|
||||||
IClientAPI client = presence.ControllingClient;
|
|
||||||
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
|
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
|
||||||
{
|
{
|
||||||
if (presence.IsChildAgent == false)
|
List<byte[]> param = compileWindlightSettings(wl);
|
||||||
{
|
client.SendGenericMessage("Windlight", param);
|
||||||
List<byte[]> param = compileWindlightSettings(m_scene.RegionInfo.WindlightSettings);
|
|
||||||
client.SendGenericMessage("Windlight", param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//We probably don't want to spam chat with this.. probably
|
|
||||||
//m_log.Debug("[WINDLIGHT]: Module disabled");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void SendProfileToClient(ScenePresence presence, RegionLightShareData wl)
|
|
||||||
{
|
|
||||||
IClientAPI client = presence.ControllingClient;
|
|
||||||
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
|
|
||||||
{
|
|
||||||
if (presence.IsChildAgent == false)
|
|
||||||
{
|
|
||||||
List<byte[]> param = compileWindlightSettings(wl);
|
|
||||||
client.SendGenericMessage("Windlight", param);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//We probably don't want to spam chat with this.. probably
|
|
||||||
//m_log.Debug("[WINDLIGHT]: Module disabled");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EventManager_OnMakeRootAgent(ScenePresence presence)
|
private void EventManager_OnMakeRootAgent(ScenePresence presence)
|
||||||
{
|
{
|
||||||
m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
|
m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
|
||||||
SendProfileToClient(presence);
|
SendProfileToClient(presence.ControllingClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)
|
private void EventManager_OnSendNewWindlightProfileTargeted(RegionLightShareData wl, UUID pUUID)
|
||||||
{
|
{
|
||||||
ScenePresence Sc;
|
IClientAPI client;
|
||||||
if (m_scene.TryGetScenePresence(pUUID,out Sc))
|
m_scene.TryGetClient(pUUID, out client);
|
||||||
{
|
SendProfileToClient(client, wl);
|
||||||
SendProfileToClient(Sc,wl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EventManager_OnSaveNewWindlightProfile()
|
private void EventManager_OnSaveNewWindlightProfile()
|
||||||
{
|
{
|
||||||
if (m_scene.RegionInfo.WindlightSettings.valid)
|
if (m_scene.RegionInfo.WindlightSettings.valid)
|
||||||
m_scene.ForEachScenePresence(SendProfileToClient);
|
m_scene.ForEachRootClient(SendProfileToClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
|
|
@ -658,14 +658,14 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
|
if (!Scene.Permissions.CanIssueEstateCommand(remover_client.AgentId, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
Scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
if (sp.UUID != senderID)
|
if (client.AgentId != senderID)
|
||||||
{
|
{
|
||||||
// make sure they are still there, we could be working down a long list
|
// make sure they are still there, we could be working down a long list
|
||||||
// Also make sure they are actually in the region
|
// Also make sure they are actually in the region
|
||||||
ScenePresence p;
|
ScenePresence p;
|
||||||
if(Scene.TryGetScenePresence(sp.UUID, out p))
|
if(Scene.TryGetScenePresence(client.AgentId, out p))
|
||||||
Scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
Scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -927,9 +927,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||||
|
|
||||||
public void sendRegionInfoPacketToAll()
|
public void sendRegionInfoPacketToAll()
|
||||||
{
|
{
|
||||||
Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
Scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
HandleRegionInfoRequest(sp.ControllingClient);
|
HandleRegionInfoRequest(client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
|
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
|
||||||
{
|
{
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
|
m_scene.ForEachAvatar(delegate(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
ILandObject over = null;
|
ILandObject over = null;
|
||||||
try
|
try
|
||||||
|
|
|
@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
|
|
||||||
SceneObjectGroup grp = part.ParentGroup;
|
SceneObjectGroup grp = part.ParentGroup;
|
||||||
|
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||||
if (dis > 100.0) // Max audio distance
|
if (dis > 100.0) // Max audio distance
|
||||||
|
@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
|
||||||
if (dis > 100.0) // Max audio distance
|
if (dis > 100.0) // Max audio distance
|
||||||
|
|
|
@ -488,9 +488,9 @@ namespace OpenSim.Region.CoreModules
|
||||||
|
|
||||||
private void SunUpdateToAllClients()
|
private void SunUpdateToAllClients()
|
||||||
{
|
{
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
SunToClient(sp.ControllingClient);
|
SunToClient(client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -435,9 +435,9 @@ namespace OpenSim.Region.CoreModules
|
||||||
m_frameLastUpdateClientArray = m_frame;
|
m_frameLastUpdateClientArray = m_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
sp.ControllingClient.SendWindData(windSpeeds);
|
client.SendWindData(windSpeeds);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
// Don't send a green dot for yourself
|
// Don't send a green dot for yourself
|
||||||
if (sp.UUID != remoteClient.AgentId)
|
if (sp.UUID != remoteClient.AgentId)
|
||||||
|
@ -1180,7 +1180,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
|
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
OSDMap responsemapdata = new OSDMap();
|
OSDMap responsemapdata = new OSDMap();
|
||||||
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X));
|
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X));
|
||||||
|
|
|
@ -872,7 +872,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
ForEachAvatar(delegate(ScenePresence agent)
|
||||||
{
|
{
|
||||||
//agent.ControllingClient.new
|
//agent.ControllingClient.new
|
||||||
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
||||||
|
@ -1017,7 +1017,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
GridRegion r = new GridRegion(region);
|
GridRegion r = new GridRegion(region);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
ForEachAvatar(delegate(ScenePresence agent)
|
||||||
{
|
{
|
||||||
if (m_teleportModule != null)
|
if (m_teleportModule != null)
|
||||||
m_teleportModule.EnableChildAgent(agent, r);
|
m_teleportModule.EnableChildAgent(agent, r);
|
||||||
|
@ -1423,12 +1423,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="stats">Stats on the Simulator's performance</param>
|
/// <param name="stats">Stats on the Simulator's performance</param>
|
||||||
private void SendSimStatsPackets(SimStats stats)
|
private void SendSimStatsPackets(SimStats stats)
|
||||||
{
|
{
|
||||||
ForEachRootScenePresence(
|
ForEachRootClient(delegate(IClientAPI client)
|
||||||
delegate(ScenePresence agent)
|
{
|
||||||
{
|
client.SendSimStats(stats);
|
||||||
agent.ControllingClient.SendSimStats(stats);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -4214,35 +4212,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return m_sceneGraph.GetScenePresence(localID);
|
return m_sceneGraph.GetScenePresence(localID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if scene presence is a child (no avatar in this scene)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="avatarID"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public override bool PresenceChildStatus(UUID avatarID)
|
public override bool PresenceChildStatus(UUID avatarID)
|
||||||
{
|
{
|
||||||
ScenePresence cp = GetScenePresence(avatarID);
|
ScenePresence sp;
|
||||||
|
return TryGetScenePresence(avatarID, out sp) && sp.IsChildAgent;
|
||||||
// FIXME: This is really crap - some logout code is relying on a NullReferenceException to halt its processing
|
|
||||||
// This needs to be fixed properly by cleaning up the logout code.
|
|
||||||
//if (cp != null)
|
|
||||||
// return cp.IsChildAgent;
|
|
||||||
|
|
||||||
//return false;
|
|
||||||
|
|
||||||
return cp.IsChildAgent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs action on all ROOT (not child) scene presences.
|
/// Performs action on all avatars in the scene (root scene presences)
|
||||||
/// This is just a shortcut function since frequently actions only appy to root SPs
|
/// Avatars may be an NPC or a 'real' client.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void ForEachRootScenePresence(Action<ScenePresence> action)
|
public void ForEachAvatar(Action<ScenePresence> action)
|
||||||
{
|
{
|
||||||
if(m_sceneGraph != null)
|
if(m_sceneGraph != null)
|
||||||
{
|
{
|
||||||
m_sceneGraph.ForEachRootScenePresence(action);
|
m_sceneGraph.ForEachAvatar(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs action on all scene presences.
|
/// Performs action on all scene presences (root and child)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
public void ForEachScenePresence(Action<ScenePresence> action)
|
public void ForEachScenePresence(Action<ScenePresence> action)
|
||||||
|
@ -4253,25 +4248,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Perform the given action for each object
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="action"></param>
|
|
||||||
// public void ForEachObject(Action<SceneObjectGroup> action)
|
|
||||||
// {
|
|
||||||
// List<SceneObjectGroup> presenceList;
|
|
||||||
//
|
|
||||||
// lock (m_sceneObjects)
|
|
||||||
// {
|
|
||||||
// presenceList = new List<SceneObjectGroup>(m_sceneObjects.Values);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// foreach (SceneObjectGroup presence in presenceList)
|
|
||||||
// {
|
|
||||||
// action(presence);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a group via its UUID
|
/// Get a group via its UUID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -4344,6 +4320,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return m_sceneGraph.TryGetAvatarByName(avatarName, out avatar);
|
return m_sceneGraph.TryGetAvatarByName(avatarName, out avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Perform an action on all clients with an avatar in this scene (root only)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="action"></param>
|
||||||
|
public void ForEachRootClient(Action<IClientAPI> action)
|
||||||
|
{
|
||||||
|
ForEachAvatar(delegate(ScenePresence presence)
|
||||||
|
{
|
||||||
|
action(presence.ControllingClient);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Perform an action on all clients connected to the region (root and child)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="action"></param>
|
||||||
public void ForEachClient(Action<IClientAPI> action)
|
public void ForEachClient(Action<IClientAPI> action)
|
||||||
{
|
{
|
||||||
m_clientManager.ForEachSync(action);
|
m_clientManager.ForEachSync(action);
|
||||||
|
|
|
@ -1190,7 +1190,7 @@ 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 ForEachRootScenePresence(Action<ScenePresence> action)
|
public void ForEachAvatar(Action<ScenePresence> action)
|
||||||
{
|
{
|
||||||
ForEachScenePresence(delegate(ScenePresence sp)
|
ForEachScenePresence(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -458,16 +458,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ForEachCurrentScene(
|
ForEachCurrentScene(
|
||||||
delegate(Scene scene)
|
delegate(Scene scene)
|
||||||
{
|
{
|
||||||
scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
if (name == null || scenePresence.Name == name)
|
if (name == null || client.Name == name)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("Packet debug for {0} {1} set to {2}",
|
m_log.DebugFormat("Packet debug for {0} {1} set to {2}",
|
||||||
scenePresence.Firstname,
|
client.FirstName,
|
||||||
scenePresence.Lastname,
|
client.LastName,
|
||||||
newDebug);
|
newDebug);
|
||||||
|
|
||||||
scenePresence.ControllingClient.DebugPacketLevel = newDebug;
|
client.DebugPacketLevel = newDebug;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
ForEachCurrentScene(
|
ForEachCurrentScene(
|
||||||
delegate(Scene scene)
|
delegate(Scene scene)
|
||||||
{
|
{
|
||||||
scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
scene.ForEachAvatar(delegate(ScenePresence scenePresence)
|
||||||
{
|
{
|
||||||
avatars.Add(scenePresence);
|
avatars.Add(scenePresence);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1150,7 +1150,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
SceneObjectPart part = parts[i];
|
||||||
|
|
||||||
Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
Scene.ForEachAvatar(delegate(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
if (avatar.ParentID == LocalId)
|
if (avatar.ParentID == LocalId)
|
||||||
avatar.StandUp();
|
avatar.StandUp();
|
||||||
|
|
|
@ -992,7 +992,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public PrimitiveBaseShape Shape
|
public PrimitiveBaseShape Shape
|
||||||
{
|
{
|
||||||
get { return m_shape; }
|
get { return m_shape; }
|
||||||
set { m_shape = value; }
|
set { m_shape = value;}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1336,12 +1336,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="AgentID"></param>
|
/// <param name="AgentID"></param>
|
||||||
private void SendRootPartPropertiesToClient(UUID AgentID)
|
private void SendRootPartPropertiesToClient(UUID AgentID)
|
||||||
{
|
{
|
||||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
m_parentGroup.Scene.ForEachClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
// Ugly reference :(
|
// Ugly reference :(
|
||||||
if (avatar.UUID == AgentID)
|
if (client.AgentId == AgentID)
|
||||||
{
|
{
|
||||||
m_parentGroup.SendPropertiesToClient(avatar.ControllingClient);
|
m_parentGroup.SendPropertiesToClient(client);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1461,9 +1461,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (volume < 0)
|
if (volume < 0)
|
||||||
volume = 0;
|
volume = 0;
|
||||||
|
|
||||||
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_parentGroup.Scene.ForEachRootClient(delegate(IClientAPI client)
|
||||||
{
|
{
|
||||||
sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
|
client.SendAttachedSoundGainChange(UUID, (float)volume);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2216,7 +2216,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av)
|
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
|
||||||
{
|
{
|
||||||
if (av.LocalId == localId)
|
if (av.LocalId == localId)
|
||||||
{
|
{
|
||||||
|
@ -2347,7 +2347,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av)
|
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
|
||||||
{
|
{
|
||||||
if (av.LocalId == localId)
|
if (av.LocalId == localId)
|
||||||
{
|
{
|
||||||
|
@ -2470,7 +2470,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence av)
|
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence av)
|
||||||
{
|
{
|
||||||
if (av.LocalId == localId)
|
if (av.LocalId == localId)
|
||||||
{
|
{
|
||||||
|
@ -2696,7 +2696,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
m_parentGroup.Scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
|
if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
|
||||||
sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
|
sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
|
||||||
|
|
|
@ -956,7 +956,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
// send the animations of the other presences to me
|
// send the animations of the other presences to me
|
||||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
m_scene.ForEachAvatar(delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
if (presence != this)
|
if (presence != this)
|
||||||
presence.Animator.SendAnimPackToClient(ControllingClient);
|
presence.Animator.SendAnimPackToClient(ControllingClient);
|
||||||
|
@ -2596,7 +2596,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void SendOtherAgentsAvatarDataToMe()
|
public void SendOtherAgentsAvatarDataToMe()
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
m_scene.ForEachAvatar(delegate(ScenePresence scenePresence)
|
||||||
{
|
{
|
||||||
// only send information about other root agents
|
// only send information about other root agents
|
||||||
if (scenePresence.UUID == UUID)
|
if (scenePresence.UUID == UUID)
|
||||||
|
@ -2660,7 +2660,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
|
// m_log.DebugFormat("[SCENE PRESENCE] SendOtherAgentsAppearanceToMe: {0} {1}", Name, UUID);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence)
|
m_scene.ForEachAvatar(delegate(ScenePresence scenePresence)
|
||||||
{
|
{
|
||||||
// only send information about other root agents
|
// only send information about other root agents
|
||||||
if (scenePresence.UUID == UUID)
|
if (scenePresence.UUID == UUID)
|
||||||
|
|
|
@ -112,7 +112,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_scenes.Values)
|
foreach (Scene scene in m_scenes.Values)
|
||||||
{
|
{
|
||||||
scene.ForEachRootScenePresence(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
|
scene.ForEachAvatar(sp => scene.AvatarFactory.SendAppearance(sp.UUID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,15 +123,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance
|
||||||
{
|
{
|
||||||
foreach (Scene scene in m_scenes.Values)
|
foreach (Scene scene in m_scenes.Values)
|
||||||
{
|
{
|
||||||
scene.ForEachScenePresence(
|
scene.ForEachAvatar(
|
||||||
delegate(ScenePresence sp)
|
delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.ControllingClient is LLClientView && !((LLClientView)sp.ControllingClient).ChildAgentStatus())
|
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
|
||||||
{
|
MainConsole.Instance.OutputFormat(
|
||||||
bool bakedTextureValid = scene.AvatarFactory.ValidateBakedTextureCache(sp);
|
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||||
MainConsole.Instance.OutputFormat(
|
|
||||||
"{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,7 +373,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
||||||
scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
|
scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
|
||||||
scene.RegionInfo.RegionID,
|
scene.RegionInfo.RegionID,
|
||||||
DateTime.UtcNow.ToString("s")));
|
DateTime.UtcNow.ToString("s")));
|
||||||
scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
scene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
|
list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
|
||||||
list.Append("</avatars>");
|
list.Append("</avatars>");
|
||||||
|
|
|
@ -711,7 +711,7 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||||
|
|
||||||
List<Vector3> CoarseLocations = new List<Vector3>();
|
List<Vector3> CoarseLocations = new List<Vector3>();
|
||||||
List<UUID> AvatarUUIDs = new List<UUID>();
|
List<UUID> AvatarUUIDs = new List<UUID>();
|
||||||
connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
connectiondata.RegionScene.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.UUID != presence.UUID)
|
if (sp.UUID != presence.UUID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1644,7 +1644,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (flexi)
|
if (flexi)
|
||||||
{
|
{
|
||||||
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
|
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
|
||||||
// work once the prim is already flexi
|
// work once the prim is already flexi
|
||||||
part.Shape.FlexiSoftness = softness;
|
part.Shape.FlexiSoftness = softness;
|
||||||
part.Shape.FlexiGravity = gravity;
|
part.Shape.FlexiGravity = gravity;
|
||||||
part.Shape.FlexiDrag = friction;
|
part.Shape.FlexiDrag = friction;
|
||||||
|
@ -1654,10 +1654,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
part.Shape.FlexiForceY = (float)Force.y;
|
part.Shape.FlexiForceY = (float)Force.y;
|
||||||
part.Shape.FlexiForceZ = (float)Force.z;
|
part.Shape.FlexiForceZ = (float)Force.z;
|
||||||
part.Shape.PathCurve = 0x80;
|
part.Shape.PathCurve = 0x80;
|
||||||
|
part.ParentGroup.HasGroupChanged = true;
|
||||||
|
part.ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
part.ParentGroup.HasGroupChanged = true;
|
|
||||||
part.ScheduleFullUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3741,7 +3740,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
List<UUID> keytable = new List<UUID>();
|
List<UUID> keytable = new List<UUID>();
|
||||||
// parse for sitting avatare-uuids
|
// parse for sitting avatare-uuids
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence presence)
|
World.ForEachAvatar(delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
||||||
keytable.Add(presence.UUID);
|
keytable.Add(presence.UUID);
|
||||||
|
@ -3803,7 +3802,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
// parse for sitting avatare-names
|
// parse for sitting avatare-names
|
||||||
List<String> nametable = new List<String>();
|
List<String> nametable = new List<String>();
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence presence)
|
World.ForEachAvatar(delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
||||||
nametable.Add(presence.ControllingClient.Name);
|
nametable.Add(presence.ControllingClient.Name);
|
||||||
|
@ -7612,7 +7611,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
int avatarCount = 0;
|
int avatarCount = 0;
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence presence)
|
World.ForEachAvatar(delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
if (presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
||||||
avatarCount++;
|
avatarCount++;
|
||||||
|
@ -9380,7 +9379,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
landObject.SetMediaUrl(url);
|
landObject.SetMediaUrl(url);
|
||||||
|
|
||||||
// now send to all (non-child) agents in the parcel
|
// now send to all (non-child) agents in the parcel
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
World.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.currentParcelUUID == landData.GlobalID)
|
if (sp.currentParcelUUID == landData.GlobalID)
|
||||||
{
|
{
|
||||||
|
@ -9413,7 +9412,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (presence == null)
|
if (presence == null)
|
||||||
{
|
{
|
||||||
// send to all (non-child) agents in the parcel
|
// send to all (non-child) agents in the parcel
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
World.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.currentParcelUUID == landData.GlobalID)
|
if (sp.currentParcelUUID == landData.GlobalID)
|
||||||
{
|
{
|
||||||
|
@ -10528,7 +10527,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (checkAgents)
|
if (checkAgents)
|
||||||
{
|
{
|
||||||
World.ForEachScenePresence(delegate(ScenePresence sp)
|
World.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.AbsolutePosition.ApproxEquals(posToCheck, sp.PhysicsActor.Size.X))
|
if (sp.AbsolutePosition.ApproxEquals(posToCheck, sp.PhysicsActor.Size.X))
|
||||||
{
|
{
|
||||||
|
|
|
@ -873,7 +873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
CheckThreatLevel(ThreatLevel.None, "osGetAgents");
|
CheckThreatLevel(ThreatLevel.None, "osGetAgents");
|
||||||
|
|
||||||
LSL_List result = new LSL_List();
|
LSL_List result = new LSL_List();
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
World.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
result.Add(new LSL_String(sp.Name));
|
result.Add(new LSL_String(sp.Name));
|
||||||
});
|
});
|
||||||
|
@ -2581,7 +2581,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
|
||||||
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
|
||||||
{
|
{
|
||||||
World.ForEachRootScenePresence(delegate(ScenePresence sp)
|
World.ForEachAvatar(delegate(ScenePresence sp)
|
||||||
{
|
{
|
||||||
if (sp.Firstname == FirstName && sp.Lastname == SurName)
|
if (sp.Firstname == FirstName && sp.Lastname == SurName)
|
||||||
{
|
{
|
||||||
|
@ -2715,7 +2715,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
|
CheckThreatLevel(ThreatLevel.None, "osGetAvatarList");
|
||||||
|
|
||||||
LSL_List result = new LSL_List();
|
LSL_List result = new LSL_List();
|
||||||
World.ForEachRootScenePresence(delegate (ScenePresence avatar)
|
World.ForEachAvatar(delegate (ScenePresence avatar)
|
||||||
{
|
{
|
||||||
if (avatar != null && avatar.UUID != m_host.OwnerID)
|
if (avatar != null && avatar.UUID != m_host.OwnerID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -507,7 +507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
senseEntity(sp);
|
senseEntity(sp);
|
||||||
if ((ts.type & AGENT_BY_USERNAME) != 0)
|
if ((ts.type & AGENT_BY_USERNAME) != 0)
|
||||||
{
|
{
|
||||||
m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(
|
m_CmdManager.m_ScriptEngine.World.ForEachAvatar(
|
||||||
delegate (ScenePresence ssp)
|
delegate (ScenePresence ssp)
|
||||||
{
|
{
|
||||||
if (ssp.Lastname == "Resident")
|
if (ssp.Lastname == "Resident")
|
||||||
|
@ -526,7 +526,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(senseEntity);
|
m_CmdManager.m_ScriptEngine.World.ForEachAvatar(senseEntity);
|
||||||
}
|
}
|
||||||
return sensedEntities;
|
return sensedEntities;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue