diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC_OLD-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 8056030..b693f2d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -371,7 +371,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
371 | foreach (string fid in outstanding) | 371 | foreach (string fid in outstanding) |
372 | { | 372 | { |
373 | UUID fromAgentID; | 373 | UUID fromAgentID; |
374 | string firstname = "Unknown", lastname = "User"; | 374 | string firstname = "Unknown", lastname = "UserFMSFOIN"; |
375 | if (!GetAgentInfo(client.Scene.RegionInfo.ScopeID, fid, out fromAgentID, out firstname, out lastname)) | 375 | if (!GetAgentInfo(client.Scene.RegionInfo.ScopeID, fid, out fromAgentID, out firstname, out lastname)) |
376 | { | 376 | { |
377 | m_log.DebugFormat("[FRIENDS MODULE]: skipping malformed friend {0}", fid); | 377 | m_log.DebugFormat("[FRIENDS MODULE]: skipping malformed friend {0}", fid); |
@@ -397,7 +397,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
397 | 397 | ||
398 | protected virtual bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last) | 398 | protected virtual bool GetAgentInfo(UUID scopeID, string fid, out UUID agentID, out string first, out string last) |
399 | { | 399 | { |
400 | first = "Unknown"; last = "User"; | 400 | first = "Unknown"; last = "UserFMGAI"; |
401 | if (!UUID.TryParse(fid, out agentID)) | 401 | if (!UUID.TryParse(fid, out agentID)) |
402 | return false; | 402 | return false; |
403 | 403 | ||
@@ -498,6 +498,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
498 | 498 | ||
499 | protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online) | 499 | protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online) |
500 | { | 500 | { |
501 | //m_log.DebugFormat("[FRIENDS]: Entering StatusNotify for {0}", userID); | ||
502 | |||
501 | List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend); | 503 | List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend); |
502 | List<string> remoteFriendStringIds = new List<string>(); | 504 | List<string> remoteFriendStringIds = new List<string>(); |
503 | foreach (string friendStringId in friendStringIds) | 505 | foreach (string friendStringId in friendStringIds) |
@@ -523,12 +525,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
523 | foreach (PresenceInfo friendSession in friendSessions) | 525 | foreach (PresenceInfo friendSession in friendSessions) |
524 | { | 526 | { |
525 | // let's guard against sessions-gone-bad | 527 | // let's guard against sessions-gone-bad |
526 | if (friendSession.RegionID != UUID.Zero) | 528 | if (friendSession != null && friendSession.RegionID != UUID.Zero) |
527 | { | 529 | { |
530 | //m_log.DebugFormat("[FRIENDS]: Get region {0}", friendSession.RegionID); | ||
528 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 531 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
529 | //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName); | 532 | if (region != null) |
530 | m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online); | 533 | { |
534 | m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online); | ||
535 | } | ||
531 | } | 536 | } |
537 | //else | ||
538 | // m_log.DebugFormat("[FRIENDS]: friend session is null or the region is UUID.Zero"); | ||
532 | } | 539 | } |
533 | } | 540 | } |
534 | 541 | ||
@@ -685,7 +692,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
685 | // | 692 | // |
686 | 693 | ||
687 | // Try local | 694 | // Try local |
688 | if (LocalFriendshipTerminated(exfriendID)) | 695 | if (LocalFriendshipTerminated(client.AgentId, exfriendID)) |
689 | return; | 696 | return; |
690 | 697 | ||
691 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() }); | 698 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() }); |
@@ -827,13 +834,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
827 | return false; | 834 | return false; |
828 | } | 835 | } |
829 | 836 | ||
830 | public bool LocalFriendshipTerminated(UUID exfriendID) | 837 | public bool LocalFriendshipTerminated(UUID userID, UUID exfriendID) |
831 | { | 838 | { |
832 | IClientAPI friendClient = LocateClientObject(exfriendID); | 839 | IClientAPI friendClient = LocateClientObject(exfriendID); |
833 | if (friendClient != null) | 840 | if (friendClient != null) |
834 | { | 841 | { |
835 | // the friend in this sim as root agent | 842 | // the friend in this sim as root agent |
836 | friendClient.SendTerminateFriend(exfriendID); | 843 | friendClient.SendTerminateFriend(userID); |
837 | // update local cache | 844 | // update local cache |
838 | RecacheFriends(friendClient); | 845 | RecacheFriends(friendClient); |
839 | // we're done | 846 | // we're done |