diff options
author | Teravus Ovares | 2008-04-14 03:20:36 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-14 03:20:36 +0000 |
commit | 2b7419c7fb55449e47560afcaf54e02bf982b749 (patch) | |
tree | d29cfb2484f911d5ab548edd1c58380f3a82418a /OpenSim/Region/Environment/Modules | |
parent | Fix for mantis 952 (diff) | |
download | opensim-SC-2b7419c7fb55449e47560afcaf54e02bf982b749.zip opensim-SC-2b7419c7fb55449e47560afcaf54e02bf982b749.tar.gz opensim-SC-2b7419c7fb55449e47560afcaf54e02bf982b749.tar.bz2 opensim-SC-2b7419c7fb55449e47560afcaf54e02bf982b749.tar.xz |
#952 again
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r-- | OpenSim/Region/Environment/Modules/FriendsModule.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs index a6d44ee..a2ec599 100644 --- a/OpenSim/Region/Environment/Modules/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs | |||
@@ -88,6 +88,9 @@ namespace OpenSim.Region.Environment.Modules | |||
88 | client.OnTerminateFriendship += OnTerminateFriendship; | 88 | client.OnTerminateFriendship += OnTerminateFriendship; |
89 | 89 | ||
90 | List<FriendListItem> fl = new List<FriendListItem>(); | 90 | List<FriendListItem> fl = new List<FriendListItem>(); |
91 | |||
92 | //bool addFLback = false; | ||
93 | |||
91 | lock (FriendLists) | 94 | lock (FriendLists) |
92 | { | 95 | { |
93 | if (FriendLists.ContainsKey(client.AgentId)) | 96 | if (FriendLists.ContainsKey(client.AgentId)) |
@@ -97,11 +100,12 @@ namespace OpenSim.Region.Environment.Modules | |||
97 | else | 100 | else |
98 | { | 101 | { |
99 | fl = m_scene[0].GetFriendList(client.AgentId); | 102 | fl = m_scene[0].GetFriendList(client.AgentId); |
100 | lock (FriendLists) | 103 | |
101 | { | 104 | //lock (FriendLists) |
105 | //{ | ||
102 | if (!FriendLists.ContainsKey(client.AgentId)) | 106 | if (!FriendLists.ContainsKey(client.AgentId)) |
103 | FriendLists.Add(client.AgentId, fl); | 107 | FriendLists.Add(client.AgentId, fl); |
104 | } | 108 | //} |
105 | } | 109 | } |
106 | } | 110 | } |
107 | 111 | ||
@@ -200,11 +204,21 @@ namespace OpenSim.Region.Environment.Modules | |||
200 | for (int i = 0; i < updateUsers.Count; i++) | 204 | for (int i = 0; i < updateUsers.Count; i++) |
201 | { | 205 | { |
202 | List<FriendListItem> flfli = new List<FriendListItem>(); | 206 | List<FriendListItem> flfli = new List<FriendListItem>(); |
203 | 207 | try | |
204 | lock (FriendLists) | 208 | { |
209 | |||
210 | lock (FriendLists) | ||
211 | { | ||
212 | if (FriendLists.ContainsKey(updateUsers[i])) | ||
213 | flfli = FriendLists[updateUsers[i]]; | ||
214 | } | ||
215 | } | ||
216 | catch (IndexOutOfRangeException) | ||
205 | { | 217 | { |
206 | if (FriendLists.ContainsKey(updateUsers[i])) | 218 | // Ignore the index out of range exception. |
207 | flfli = FriendLists[updateUsers[i]]; | 219 | // This causes friend lists to get out of sync slightly.. however |
220 | // prevents a sim crash. | ||
221 | m_log.Info("[FRIEND]: Unable to enumerate last friendlist user. User logged off"); | ||
208 | } | 222 | } |
209 | 223 | ||
210 | for (int j = 0; j < flfli.Count; j++) | 224 | for (int j = 0; j < flfli.Count; j++) |