diff options
author | Melanie | 2012-05-08 00:07:18 +0100 |
---|---|---|
committer | Melanie | 2012-05-08 00:07:18 +0100 |
commit | 05634907e9f4bad0e4efb1263513a1971967542e (patch) | |
tree | 9c2f424e63e1bb392c8cc0a66a6b523b2991cf28 /OpenSim/Region/CoreModules | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Revert "Better error handling if Load OAR or Save OAR fail" (diff) | |
download | opensim-SC_OLD-05634907e9f4bad0e4efb1263513a1971967542e.zip opensim-SC_OLD-05634907e9f4bad0e4efb1263513a1971967542e.tar.gz opensim-SC_OLD-05634907e9f4bad0e4efb1263513a1971967542e.tar.bz2 opensim-SC_OLD-05634907e9f4bad0e4efb1263513a1971967542e.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index fc6325d..24ec435 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -449,29 +449,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
449 | /// </summary> | 449 | /// </summary> |
450 | public IClientAPI LocateClientObject(UUID agentID) | 450 | public IClientAPI LocateClientObject(UUID agentID) |
451 | { | 451 | { |
452 | Scene scene = GetClientScene(agentID); | ||
453 | if (scene != null) | ||
454 | { | ||
455 | ScenePresence presence = scene.GetScenePresence(agentID); | ||
456 | if (presence != null) | ||
457 | return presence.ControllingClient; | ||
458 | } | ||
459 | |||
460 | return null; | ||
461 | } | ||
462 | |||
463 | /// <summary> | ||
464 | /// Find the scene for an agent | ||
465 | /// </summary> | ||
466 | private Scene GetClientScene(UUID agentId) | ||
467 | { | ||
468 | lock (m_Scenes) | 452 | lock (m_Scenes) |
469 | { | 453 | { |
470 | foreach (Scene scene in m_Scenes) | 454 | foreach (Scene scene in m_Scenes) |
471 | { | 455 | { |
472 | ScenePresence presence = scene.GetScenePresence(agentId); | 456 | ScenePresence presence = scene.GetScenePresence(agentID); |
473 | if (presence != null && !presence.IsChildAgent) | 457 | if (presence != null && !presence.IsChildAgent) |
474 | return scene; | 458 | return presence.ControllingClient; |
475 | } | 459 | } |
476 | } | 460 | } |
477 | 461 | ||
@@ -498,7 +482,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
498 | Util.FireAndForget( | 482 | Util.FireAndForget( |
499 | delegate | 483 | delegate |
500 | { | 484 | { |
501 | m_log.DebugFormat("[FRIENDS MODULE]: Notifying {0} friends", friendList.Count); | 485 | m_log.DebugFormat( |
486 | "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}", | ||
487 | friendList.Count, agentID, online); | ||
488 | |||
502 | // Notify about this user status | 489 | // Notify about this user status |
503 | StatusNotify(friendList, agentID, online); | 490 | StatusNotify(friendList, agentID, online); |
504 | } | 491 | } |
@@ -515,7 +502,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
515 | { | 502 | { |
516 | // Try local | 503 | // Try local |
517 | if (LocalStatusNotification(userID, friendID, online)) | 504 | if (LocalStatusNotification(userID, friendID, online)) |
518 | return; | 505 | continue; |
519 | 506 | ||
520 | // The friend is not here [as root]. Let's forward. | 507 | // The friend is not here [as root]. Let's forward. |
521 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 508 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
@@ -523,11 +510,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
523 | { | 510 | { |
524 | PresenceInfo friendSession = null; | 511 | PresenceInfo friendSession = null; |
525 | foreach (PresenceInfo pinfo in friendSessions) | 512 | foreach (PresenceInfo pinfo in friendSessions) |
513 | { | ||
526 | if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad | 514 | if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad |
527 | { | 515 | { |
528 | friendSession = pinfo; | 516 | friendSession = pinfo; |
529 | break; | 517 | break; |
530 | } | 518 | } |
519 | } | ||
531 | 520 | ||
532 | if (friendSession != null) | 521 | if (friendSession != null) |
533 | { | 522 | { |