Greatly improve login time for users with large friends lists by requesting all unknown UUID's in one go rather than individually
parent
420dd78fb7
commit
2fe669448f
|
@ -442,11 +442,44 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||||
if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1))
|
if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1))
|
||||||
friendList.Add(fi);
|
friendList.Add(fi);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
foreach (FriendInfo fi in friendList)
|
foreach (FriendInfo fi in friendList)
|
||||||
{
|
{
|
||||||
// Notify about this user status
|
// Notify about this user status
|
||||||
StatusNotify(fi, agentID, online);
|
StatusNotify(fi, agentID, online);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
StatusNotifyMass(friendList, agentID, online);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online)
|
||||||
|
{
|
||||||
|
string[] friendIDs = new string[friendList.Count];
|
||||||
|
int notlocal = 0;
|
||||||
|
for (int x = 0; x < friendList.Count; x++)
|
||||||
|
{
|
||||||
|
UUID friendID = UUID.Zero;
|
||||||
|
if (UUID.TryParse(friendList[x].Friend, out friendID))
|
||||||
|
{
|
||||||
|
if (!LocalStatusNotification(userID, friendID, online))
|
||||||
|
{
|
||||||
|
friendIDs[notlocal++] = friendID.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PresenceInfo[] friendSessions = PresenceService.GetAgents(friendIDs);
|
||||||
|
|
||||||
|
for (int x = 0; x < friendSessions.GetLength(0); x++)
|
||||||
|
{
|
||||||
|
PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
|
||||||
|
if (friendSession != null)
|
||||||
|
{
|
||||||
|
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||||
|
m_FriendsSimConnector.StatusNotify(region, userID, new UUID(friendIDs[x]), online);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue