Adds Friend Finding functionality.
Signed-off-by: Melanie <melanie@t-data.com>mysql-performance
parent
234d4e1105
commit
8ca37dbefa
|
@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
|||
|
||||
// if it leaves, we want to know, too
|
||||
client.OnLogout += OnLogout;
|
||||
|
||||
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);
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue