diff options
author | Sean Dague | 2008-09-04 22:06:16 +0000 |
---|---|---|
committer | Sean Dague | 2008-09-04 22:06:16 +0000 |
commit | a0f2e4683612428372df62a8716e3426e7a364ea (patch) | |
tree | edfdfe58c871948a42e8775d82f6626f3dfaaa2f /OpenSim/Region/Environment | |
parent | remove calls (diff) | |
download | opensim-SC-a0f2e4683612428372df62a8716e3426e7a364ea.zip opensim-SC-a0f2e4683612428372df62a8716e3426e7a364ea.tar.gz opensim-SC-a0f2e4683612428372df62a8716e3426e7a364ea.tar.bz2 opensim-SC-a0f2e4683612428372df62a8716e3426e7a364ea.tar.xz |
added in find calls
added logging of exceptions, which we'll get quite a few of at this
point most likely
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/EntityList.cs | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EntityList.cs b/OpenSim/Region/Environment/Scenes/EntityList.cs index c64e549..a03b36c 100644 --- a/OpenSim/Region/Environment/Scenes/EntityList.cs +++ b/OpenSim/Region/Environment/Scenes/EntityList.cs | |||
@@ -41,11 +41,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | { | 41 | { |
42 | public class EntityList | 42 | public class EntityList |
43 | { | 43 | { |
44 | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
45 | |||
46 | // we are intentionally using non generics here as testing has | ||
47 | // shown synchronized collections are faster than manually | ||
48 | // locked generics. | ||
49 | |||
45 | private Hashtable m_obj_by_uuid; | 50 | private Hashtable m_obj_by_uuid; |
46 | private Hashtable m_pres_by_uuid; | ||
47 | private Hashtable m_obj_by_local; | 51 | private Hashtable m_obj_by_local; |
48 | 52 | ||
53 | private Hashtable m_pres_by_uuid; | ||
54 | |||
49 | public EntityList() | 55 | public EntityList() |
50 | { | 56 | { |
51 | m_obj_by_uuid = Hashtable.Synchronized(new Hashtable()); | 57 | m_obj_by_uuid = Hashtable.Synchronized(new Hashtable()); |
@@ -89,6 +95,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
89 | } | 95 | } |
90 | catch (Exception e) | 96 | catch (Exception e) |
91 | { | 97 | { |
98 | m_log.ErrorFormat("RemoveObject failed for {0}", uuid, e); | ||
92 | sog = null; | 99 | sog = null; |
93 | } | 100 | } |
94 | return sog; | 101 | return sog; |
@@ -104,9 +111,52 @@ namespace OpenSim.Region.Environment.Scenes | |||
104 | } | 111 | } |
105 | catch (Exception e) | 112 | catch (Exception e) |
106 | { | 113 | { |
114 | m_log.ErrorFormat("RemovePresence failed for {0}", uuid, e); | ||
107 | sp = null; | 115 | sp = null; |
108 | } | 116 | } |
109 | return sp; | 117 | return sp; |
110 | } | 118 | } |
119 | |||
120 | public SceneObjectGroup FindObject(LLUUID uuid) | ||
121 | { | ||
122 | try | ||
123 | { | ||
124 | SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; | ||
125 | return sog; | ||
126 | } | ||
127 | catch (Exception e) | ||
128 | { | ||
129 | m_log.ErrorFormat("FindObject failed for {0}", uuid, e); | ||
130 | return null; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | public SceneObjectGroup FindObject(int local) | ||
135 | { | ||
136 | try | ||
137 | { | ||
138 | LLUUID uuid = (LLUUID)m_obj_by_local[local]; | ||
139 | SceneObjectGroup sog = (SceneObjectGroup)m_obj_by_uuid[uuid]; | ||
140 | return sog; | ||
141 | } | ||
142 | catch (Exception e) | ||
143 | { | ||
144 | m_log.ErrorFormat("FindObject failed for {0}", local, e); | ||
145 | return null; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | public ScenePresence FindPresense(LLUUID uuid) | ||
150 | { | ||
151 | try | ||
152 | { | ||
153 | ScenePresence sp = (ScenePresence)m_pres_by_uuid[uuid]; | ||
154 | return sp; | ||
155 | } | ||
156 | catch (Exception e) | ||
157 | { | ||
158 | return null; | ||
159 | } | ||
160 | } | ||
111 | } | 161 | } |
112 | } \ No newline at end of file | 162 | } \ No newline at end of file |