aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/EntityManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/EntityManager.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityManager.cs32
1 files changed, 26 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EntityManager.cs b/OpenSim/Region/Environment/Scenes/EntityManager.cs
index 43bf090..be39878 100644
--- a/OpenSim/Region/Environment/Scenes/EntityManager.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityManager.cs
@@ -71,21 +71,25 @@ namespace OpenSim.Region.Environment.Scenes
71 } 71 }
72 } 72 }
73 73
74 public void Remove(uint localID) 74 public bool Remove(uint localID)
75 { 75 {
76 lock(m_lock) 76 lock(m_lock)
77 { 77 {
78 m_eb_uuid.Remove(m_eb_localID[localID].UUID); 78 bool a = m_eb_uuid.Remove(m_eb_localID[localID].UUID);
79 m_eb_localID.Remove(localID); 79 bool b = m_eb_localID.Remove(localID);
80
81 return a && b;
80 } 82 }
81 } 83 }
82 84
83 public void Remove(UUID id) 85 public bool Remove(UUID id)
84 { 86 {
85 lock(m_lock) 87 lock(m_lock)
86 { 88 {
87 m_eb_localID.Remove(m_eb_uuid[id].LocalId); 89 bool a = m_eb_localID.Remove(m_eb_uuid[id].LocalId);
88 m_eb_uuid.Remove(id); 90 bool b = m_eb_uuid.Remove(id);
91
92 return a && b;
89 } 93 }
90 } 94 }
91 95
@@ -145,6 +149,22 @@ namespace OpenSim.Region.Environment.Scenes
145 } 149 }
146 } 150 }
147 151
152 public bool TryGetValue(UUID key, out EntityBase obj)
153 {
154 lock(m_lock)
155 {
156 return m_eb_uuid.TryGetValue(key, out obj);
157 }
158 }
159
160 public bool TryGetValue(uint key, out EntityBase obj)
161 {
162 lock (m_lock)
163 {
164 return m_eb_localID.TryGetValue(key, out obj);
165 }
166 }
167
148 /// <summary> 168 /// <summary>
149 /// This could be optimised to work on the list 'live' rather than making a safe copy and iterating that. 169 /// This could be optimised to work on the list 'live' rather than making a safe copy and iterating that.
150 /// </summary> 170 /// </summary>