diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index f9f01fe..83f004d 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -198,20 +198,19 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
198 | 198 | ||
199 | private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) | 199 | private SceneObjectPart findPrim(UUID objectID, out string ObjectRegionName) |
200 | { | 200 | { |
201 | List<Scene> scenes = null; | ||
202 | lock (m_Scenes) | 201 | lock (m_Scenes) |
203 | scenes = new List<Scene>(m_Scenes.Values); | ||
204 | |||
205 | foreach (Scene s in scenes) | ||
206 | { | 202 | { |
207 | SceneObjectPart part = s.GetSceneObjectPart(objectID); | 203 | foreach (Scene s in m_Scenes.Values) |
208 | if (part != null) | ||
209 | { | 204 | { |
210 | ObjectRegionName = s.RegionInfo.RegionName; | 205 | SceneObjectPart part = s.GetSceneObjectPart(objectID); |
211 | uint localX = (s.RegionInfo.RegionLocX * (int)Constants.RegionSize); | 206 | if (part != null) |
212 | uint localY = (s.RegionInfo.RegionLocY * (int)Constants.RegionSize); | 207 | { |
213 | ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; | 208 | ObjectRegionName = s.RegionInfo.RegionName; |
214 | return part; | 209 | uint localX = (s.RegionInfo.RegionLocX * (int)Constants.RegionSize); |
210 | uint localY = (s.RegionInfo.RegionLocY * (int)Constants.RegionSize); | ||
211 | ObjectRegionName = ObjectRegionName + " (" + localX + ", " + localY + ")"; | ||
212 | return part; | ||
213 | } | ||
215 | } | 214 | } |
216 | } | 215 | } |
217 | ObjectRegionName = string.Empty; | 216 | ObjectRegionName = string.Empty; |
@@ -364,7 +363,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
364 | public Email GetNextEmail(UUID objectID, string sender, string subject) | 363 | public Email GetNextEmail(UUID objectID, string sender, string subject) |
365 | { | 364 | { |
366 | List<Email> queue = null; | 365 | List<Email> queue = null; |
367 | List<UUID> removal = new List<UUID>(); | ||
368 | 366 | ||
369 | lock (m_LastGetEmailCall) | 367 | lock (m_LastGetEmailCall) |
370 | { | 368 | { |
@@ -377,6 +375,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
377 | 375 | ||
378 | // Hopefully this isn't too time consuming. If it is, we can always push it into a worker thread. | 376 | // Hopefully this isn't too time consuming. If it is, we can always push it into a worker thread. |
379 | DateTime now = DateTime.Now; | 377 | DateTime now = DateTime.Now; |
378 | List<UUID> removal = new List<UUID>(); | ||
380 | foreach (UUID uuid in m_LastGetEmailCall.Keys) | 379 | foreach (UUID uuid in m_LastGetEmailCall.Keys) |
381 | { | 380 | { |
382 | if ((now - m_LastGetEmailCall[uuid]) > m_QueueTimeout) | 381 | if ((now - m_LastGetEmailCall[uuid]) > m_QueueTimeout) |
@@ -384,15 +383,15 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
384 | removal.Add(uuid); | 383 | removal.Add(uuid); |
385 | } | 384 | } |
386 | } | 385 | } |
387 | } | ||
388 | 386 | ||
389 | foreach (UUID remove in removal) | 387 | foreach (UUID remove in removal) |
390 | { | 388 | { |
391 | lock (m_LastGetEmailCall) | ||
392 | m_LastGetEmailCall.Remove(remove); | 389 | m_LastGetEmailCall.Remove(remove); |
393 | 390 | lock (m_MailQueues) | |
394 | lock (m_MailQueues) | 391 | { |
395 | m_MailQueues.Remove(remove); | 392 | m_MailQueues.Remove(remove); |
393 | } | ||
394 | } | ||
396 | } | 395 | } |
397 | 396 | ||
398 | lock (m_MailQueues) | 397 | lock (m_MailQueues) |