0.6.0-stable
Teravus Ovares 2008-04-14 03:20:36 +00:00
parent 30f93b2201
commit 2b7419c7fb
1 changed files with 21 additions and 7 deletions

View File

@ -88,6 +88,9 @@ namespace OpenSim.Region.Environment.Modules
client.OnTerminateFriendship += OnTerminateFriendship; client.OnTerminateFriendship += OnTerminateFriendship;
List<FriendListItem> fl = new List<FriendListItem>(); List<FriendListItem> fl = new List<FriendListItem>();
//bool addFLback = false;
lock (FriendLists) lock (FriendLists)
{ {
if (FriendLists.ContainsKey(client.AgentId)) if (FriendLists.ContainsKey(client.AgentId))
@ -97,11 +100,12 @@ namespace OpenSim.Region.Environment.Modules
else else
{ {
fl = m_scene[0].GetFriendList(client.AgentId); fl = m_scene[0].GetFriendList(client.AgentId);
lock (FriendLists)
{ //lock (FriendLists)
//{
if (!FriendLists.ContainsKey(client.AgentId)) if (!FriendLists.ContainsKey(client.AgentId))
FriendLists.Add(client.AgentId, fl); FriendLists.Add(client.AgentId, fl);
} //}
} }
} }
@ -200,11 +204,21 @@ namespace OpenSim.Region.Environment.Modules
for (int i = 0; i < updateUsers.Count; i++) for (int i = 0; i < updateUsers.Count; i++)
{ {
List<FriendListItem> flfli = new List<FriendListItem>(); List<FriendListItem> flfli = new List<FriendListItem>();
try
lock (FriendLists)
{ {
if (FriendLists.ContainsKey(updateUsers[i]))
flfli = FriendLists[updateUsers[i]]; lock (FriendLists)
{
if (FriendLists.ContainsKey(updateUsers[i]))
flfli = FriendLists[updateUsers[i]];
}
}
catch (IndexOutOfRangeException)
{
// Ignore the index out of range exception.
// This causes friend lists to get out of sync slightly.. however
// prevents a sim crash.
m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off");
} }
for (int j = 0; j < flfli.Count; j++) for (int j = 0; j < flfli.Count; j++)