Merge branch 'master' into careminster

This commit is contained in:
Melanie
2012-05-08 00:07:18 +01:00
3 changed files with 38 additions and 47 deletions

View File

@@ -448,30 +448,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
/// Find the client for a ID
/// </summary>
public IClientAPI LocateClientObject(UUID agentID)
{
Scene scene = GetClientScene(agentID);
if (scene != null)
{
ScenePresence presence = scene.GetScenePresence(agentID);
if (presence != null)
return presence.ControllingClient;
}
return null;
}
/// <summary>
/// Find the scene for an agent
/// </summary>
private Scene GetClientScene(UUID agentId)
{
lock (m_Scenes)
{
foreach (Scene scene in m_Scenes)
{
ScenePresence presence = scene.GetScenePresence(agentId);
ScenePresence presence = scene.GetScenePresence(agentID);
if (presence != null && !presence.IsChildAgent)
return scene;
return presence.ControllingClient;
}
}
@@ -498,7 +482,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
Util.FireAndForget(
delegate
{
m_log.DebugFormat("[FRIENDS MODULE]: Notifying {0} friends", friendList.Count);
m_log.DebugFormat(
"[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
friendList.Count, agentID, online);
// Notify about this user status
StatusNotify(friendList, agentID, online);
}
@@ -515,7 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
// Try local
if (LocalStatusNotification(userID, friendID, online))
return;
continue;
// The friend is not here [as root]. Let's forward.
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
@@ -523,11 +510,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
PresenceInfo friendSession = null;
foreach (PresenceInfo pinfo in friendSessions)
{
if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad
{
friendSession = pinfo;
break;
}
}
if (friendSession != null)
{