A few more cleanups on the way to close http://opensimulator.org/mantis/view.php?id=5516 once and for all. Moral of the story: don't send AgentOnline/Offline to viewers with a zero-length array.

bulletsim
Diva Canto 2011-06-11 17:48:19 -07:00
parent e1ca77a0db
commit 06e254c392
1 changed files with 3 additions and 11 deletions

View File

@ -280,10 +280,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
List<string> ids = new List<string>(); List<string> ids = new List<string>();
foreach (FriendInfo f in kvp.Value) foreach (FriendInfo f in kvp.Value)
ids.Add(f.Friend); ids.Add(f.Friend);
UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key, false); UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key);
List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online); List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online);
Thread.Sleep(100);
// need to debug this here
if (online && friendsOnline.Count > 0) if (online && friendsOnline.Count > 0)
{ {
IClientAPI client = LocateClientObject(userID); IClientAPI client = LocateClientObject(userID);
@ -305,15 +304,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out first, out last, out tmp)) if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out first, out last, out tmp))
{ {
IUserManagement userMan = m_Scenes[0].RequestModuleInterface<IUserManagement>(); IUserManagement userMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
userMan.AddUser(agentID, url + ";" + first + " " + last); userMan.AddUser(agentID, first, last, url);
try // our best
{
string[] parts = userMan.GetUserName(agentID).Split();
first = parts[0];
last = parts[1];
}
catch { }
return true; return true;
} }
return false; return false;