aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRevolution2009-12-30 22:00:58 -0600
committerMelanie2009-12-31 21:31:04 +0000
commit8ca37dbefadc9b2d31b76786051d0ed8e1342121 (patch)
treea106a4d559ad77df5fe0bf916681055552994595 /OpenSim
parentAdds tons of packets. (diff)
downloadopensim-SC_OLD-8ca37dbefadc9b2d31b76786051d0ed8e1342121.zip
opensim-SC_OLD-8ca37dbefadc9b2d31b76786051d0ed8e1342121.tar.gz
opensim-SC_OLD-8ca37dbefadc9b2d31b76786051d0ed8e1342121.tar.bz2
opensim-SC_OLD-8ca37dbefadc9b2d31b76786051d0ed8e1342121.tar.xz
Adds Friend Finding functionality.
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs23
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 {