Adds Friend Finding functionality.

Signed-off-by: Melanie <melanie@t-data.com>
mysql-performance
Revolution 2009-12-30 22:00:58 -06:00 committed by Melanie
parent 234d4e1105
commit 8ca37dbefa
1 changed files with 23 additions and 0 deletions

View File

@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// if it leaves, we want to know, too // if it leaves, we want to know, too
client.OnLogout += OnLogout; client.OnLogout += OnLogout;
client.OnGrantUserRights += GrantUserFriendRights; client.OnGrantUserRights += GrantUserFriendRights;
client.OnTrackAgentEvent += FindAgent;
client.OnFindAgentEvent += FindAgent;
} }
@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{ {
((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights);
} }
public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target)
{
List<FriendListItem> friendList = GetUserFriends(hunter);
foreach (FriendListItem item in friendList)
{
if(item.onlinestatus == true)
{
if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0)
{
ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target);
string regionname = SPTarget.Scene.RegionInfo.RegionName;
remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat));
}
}
else
{
remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false);
}
}
}
public List<FriendListItem> GetUserFriends(UUID agentID) public List<FriendListItem> GetUserFriends(UUID agentID)
{ {