diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d6a82ef..580e06f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
395 | 395 | ||
396 | // if it leaves, we want to know, too | 396 | // if it leaves, we want to know, too |
397 | client.OnLogout += OnLogout; | 397 | client.OnLogout += OnLogout; |
398 | |||
398 | client.OnGrantUserRights += GrantUserFriendRights; | 399 | client.OnGrantUserRights += GrantUserFriendRights; |
400 | client.OnTrackAgentEvent += FindAgent; | ||
401 | client.OnFindAgentEvent += FindAgent; | ||
399 | 402 | ||
400 | } | 403 | } |
401 | 404 | ||
@@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
1114 | { | 1117 | { |
1115 | ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); | 1118 | ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); |
1116 | } | 1119 | } |
1120 | public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target) | ||
1121 | { | ||
1122 | List<FriendListItem> friendList = GetUserFriends(hunter); | ||
1123 | foreach (FriendListItem item in friendList) | ||
1124 | { | ||
1125 | if(item.onlinestatus == true) | ||
1126 | { | ||
1127 | if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0) | ||
1128 | { | ||
1129 | ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target); | ||
1130 | string regionname = SPTarget.Scene.RegionInfo.RegionName; | ||
1131 | remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat)); | ||
1132 | } | ||
1133 | } | ||
1134 | else | ||
1135 | { | ||
1136 | remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false); | ||
1137 | } | ||
1138 | } | ||
1139 | } | ||
1117 | 1140 | ||
1118 | public List<FriendListItem> GetUserFriends(UUID agentID) | 1141 | public List<FriendListItem> GetUserFriends(UUID agentID) |
1119 | { | 1142 | { |