we do need to ship the cached friends around on teleports (friends must come from grid)

This commit is contained in:
UbitUmarov
2023-02-03 17:17:02 +00:00
parent a7b8ce9cfd
commit 3858cc945c
4 changed files with 51 additions and 9 deletions

View File

@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
public void CacheFriendOnline(UUID userID, UUID friendID, bool online)
public virtual void CacheFriendOnline(UUID userID, UUID friendID, bool online)
{
if (!m_OnlineFriendsCache.TryGetValue(userID, out HashSet<UUID> friends))
{
@@ -292,6 +292,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
else
friends.Remove(friendID);
}
public virtual List<UUID> GetCachedFriendsOnline(UUID userID)
{
if (m_OnlineFriendsCache.TryGetValue(userID, out HashSet<UUID> friends))
{
List<UUID> friendslst = new List<UUID>(friends.Count);
foreach(UUID id in friends)
friendslst.Add(id);
return friendslst;
}
else
return null;
}
private void OnMakeRootAgent(ScenePresence sp)
{