diff options
Simplified RemoteXInventoryServiceConnector and HGBroker (2) by a lot.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | 90 |
1 files changed, 32 insertions, 58 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 96d0c1c..ac9e792 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | 41 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
43 | { | 43 | { |
44 | public class RemoteXInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService | 44 | public class RemoteXInventoryServicesConnector : ISharedRegionModule, IInventoryService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -75,10 +75,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
75 | Init(source); | 75 | Init(source); |
76 | } | 76 | } |
77 | 77 | ||
78 | protected override void Init(IConfigSource source) | 78 | protected void Init(IConfigSource source) |
79 | { | 79 | { |
80 | m_RemoteConnector = new XInventoryServicesConnector(source); | 80 | m_RemoteConnector = new XInventoryServicesConnector(source); |
81 | base.Init(source); | ||
82 | } | 81 | } |
83 | 82 | ||
84 | 83 | ||
@@ -122,7 +121,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
122 | } | 121 | } |
123 | 122 | ||
124 | scene.RegisterModuleInterface<IInventoryService>(this); | 123 | scene.RegisterModuleInterface<IInventoryService>(this); |
125 | m_cache.AddRegion(scene); | ||
126 | } | 124 | } |
127 | 125 | ||
128 | public void RemoveRegion(Scene scene) | 126 | public void RemoveRegion(Scene scene) |
@@ -130,7 +128,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
130 | if (!m_Enabled) | 128 | if (!m_Enabled) |
131 | return; | 129 | return; |
132 | 130 | ||
133 | m_cache.RemoveRegion(scene); | ||
134 | } | 131 | } |
135 | 132 | ||
136 | public void RegionLoaded(Scene scene) | 133 | public void RegionLoaded(Scene scene) |
@@ -146,71 +143,51 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
146 | 143 | ||
147 | #region IInventoryService | 144 | #region IInventoryService |
148 | 145 | ||
149 | public override bool CreateUserInventory(UUID user) | 146 | public bool CreateUserInventory(UUID user) |
150 | { | 147 | { |
151 | return false; | 148 | return false; |
152 | } | 149 | } |
153 | 150 | ||
154 | public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | 151 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) |
155 | { | 152 | { |
156 | return new List<InventoryFolderBase>(); | 153 | return new List<InventoryFolderBase>(); |
157 | } | 154 | } |
158 | 155 | ||
159 | public override InventoryCollection GetUserInventory(UUID userID) | 156 | public InventoryCollection GetUserInventory(UUID userID) |
160 | { | 157 | { |
161 | return null; | 158 | return null; |
162 | } | 159 | } |
163 | 160 | ||
164 | public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | 161 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) |
165 | { | 162 | { |
166 | try | 163 | } |
167 | { | ||
168 | m_RemoteConnector.GetUserInventory(userID, callback); | ||
169 | } | ||
170 | catch (Exception e) | ||
171 | { | ||
172 | if (StatsManager.SimExtraStats != null) | ||
173 | StatsManager.SimExtraStats.AddInventoryServiceRetrievalFailure(); | ||
174 | |||
175 | m_log.ErrorFormat("[XINVENTORY CONNECTOR]: Request inventory operation failed, {0} {1}", | ||
176 | e.Source, e.Message); | ||
177 | } | ||
178 | 164 | ||
165 | public InventoryFolderBase GetRootFolder(UUID userID) | ||
166 | { | ||
167 | return m_RemoteConnector.GetRootFolder(userID); | ||
179 | } | 168 | } |
180 | 169 | ||
181 | // inherited. See base class | 170 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) |
182 | // public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | 171 | { |
172 | return m_RemoteConnector.GetFolderForType(userID, type); | ||
173 | } | ||
183 | 174 | ||
184 | public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | 175 | public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) |
185 | { | 176 | { |
186 | return m_RemoteConnector.GetSystemFolders(userID); | 177 | return m_RemoteConnector.GetSystemFolders(userID); |
187 | } | 178 | } |
188 | 179 | ||
189 | public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 180 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
190 | { | 181 | { |
191 | m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolderContent {0}", folderID); | 182 | return m_RemoteConnector.GetFolderContent(userID, folderID); |
192 | try | ||
193 | { | ||
194 | return m_RemoteConnector.GetFolderContent(userID, folderID); | ||
195 | } | ||
196 | catch (Exception e) | ||
197 | { | ||
198 | m_log.ErrorFormat("[XINVENTORY CONNECTOR]: GetFolderContent operation failed, {0} {1}", | ||
199 | e.Source, e.Message); | ||
200 | } | ||
201 | InventoryCollection nullCollection = new InventoryCollection(); | ||
202 | nullCollection.Folders = new List<InventoryFolderBase>(); | ||
203 | nullCollection.Items = new List<InventoryItemBase>(); | ||
204 | nullCollection.UserID = userID; | ||
205 | return nullCollection; | ||
206 | } | 183 | } |
207 | 184 | ||
208 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 185 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
209 | { | 186 | { |
210 | return m_RemoteConnector.GetFolderItems(userID, folderID); | 187 | return m_RemoteConnector.GetFolderItems(userID, folderID); |
211 | } | 188 | } |
212 | 189 | ||
213 | public override bool AddFolder(InventoryFolderBase folder) | 190 | public bool AddFolder(InventoryFolderBase folder) |
214 | { | 191 | { |
215 | if (folder == null) | 192 | if (folder == null) |
216 | return false; | 193 | return false; |
@@ -218,7 +195,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
218 | return m_RemoteConnector.AddFolder(folder); | 195 | return m_RemoteConnector.AddFolder(folder); |
219 | } | 196 | } |
220 | 197 | ||
221 | public override bool UpdateFolder(InventoryFolderBase folder) | 198 | public bool UpdateFolder(InventoryFolderBase folder) |
222 | { | 199 | { |
223 | if (folder == null) | 200 | if (folder == null) |
224 | return false; | 201 | return false; |
@@ -226,7 +203,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
226 | return m_RemoteConnector.UpdateFolder(folder); | 203 | return m_RemoteConnector.UpdateFolder(folder); |
227 | } | 204 | } |
228 | 205 | ||
229 | public override bool MoveFolder(InventoryFolderBase folder) | 206 | public bool MoveFolder(InventoryFolderBase folder) |
230 | { | 207 | { |
231 | if (folder == null) | 208 | if (folder == null) |
232 | return false; | 209 | return false; |
@@ -234,7 +211,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
234 | return m_RemoteConnector.MoveFolder(folder); | 211 | return m_RemoteConnector.MoveFolder(folder); |
235 | } | 212 | } |
236 | 213 | ||
237 | public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | 214 | public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) |
238 | { | 215 | { |
239 | if (folderIDs == null) | 216 | if (folderIDs == null) |
240 | return false; | 217 | return false; |
@@ -245,7 +222,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
245 | } | 222 | } |
246 | 223 | ||
247 | 224 | ||
248 | public override bool PurgeFolder(InventoryFolderBase folder) | 225 | public bool PurgeFolder(InventoryFolderBase folder) |
249 | { | 226 | { |
250 | if (folder == null) | 227 | if (folder == null) |
251 | return false; | 228 | return false; |
@@ -253,10 +230,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
253 | return m_RemoteConnector.PurgeFolder(folder); | 230 | return m_RemoteConnector.PurgeFolder(folder); |
254 | } | 231 | } |
255 | 232 | ||
256 | // public bool AddItem(InventoryItemBase item) inherited | 233 | public bool AddItem(InventoryItemBase item) |
257 | // Uses AddItemPlain | ||
258 | |||
259 | protected override bool AddItemPlain(InventoryItemBase item) | ||
260 | { | 234 | { |
261 | if (item == null) | 235 | if (item == null) |
262 | return false; | 236 | return false; |
@@ -264,7 +238,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
264 | return m_RemoteConnector.AddItem(item); | 238 | return m_RemoteConnector.AddItem(item); |
265 | } | 239 | } |
266 | 240 | ||
267 | public override bool UpdateItem(InventoryItemBase item) | 241 | public bool UpdateItem(InventoryItemBase item) |
268 | { | 242 | { |
269 | if (item == null) | 243 | if (item == null) |
270 | return false; | 244 | return false; |
@@ -272,7 +246,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
272 | return m_RemoteConnector.UpdateItem(item); | 246 | return m_RemoteConnector.UpdateItem(item); |
273 | } | 247 | } |
274 | 248 | ||
275 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | 249 | public bool MoveItems(UUID ownerID, List<InventoryItemBase> items) |
276 | { | 250 | { |
277 | if (items == null) | 251 | if (items == null) |
278 | return false; | 252 | return false; |
@@ -281,7 +255,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
281 | } | 255 | } |
282 | 256 | ||
283 | 257 | ||
284 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | 258 | public bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
285 | { | 259 | { |
286 | if (itemIDs == null) | 260 | if (itemIDs == null) |
287 | return false; | 261 | return false; |
@@ -291,7 +265,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
291 | return m_RemoteConnector.DeleteItems(ownerID, itemIDs); | 265 | return m_RemoteConnector.DeleteItems(ownerID, itemIDs); |
292 | } | 266 | } |
293 | 267 | ||
294 | public override InventoryItemBase GetItem(InventoryItemBase item) | 268 | public InventoryItemBase GetItem(InventoryItemBase item) |
295 | { | 269 | { |
296 | if (item == null) | 270 | if (item == null) |
297 | return null; | 271 | return null; |
@@ -299,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
299 | return m_RemoteConnector.GetItem(item); | 273 | return m_RemoteConnector.GetItem(item); |
300 | } | 274 | } |
301 | 275 | ||
302 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) | 276 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) |
303 | { | 277 | { |
304 | m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); | 278 | m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); |
305 | if (folder == null) | 279 | if (folder == null) |
@@ -308,17 +282,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
308 | return m_RemoteConnector.GetFolder(folder); | 282 | return m_RemoteConnector.GetFolder(folder); |
309 | } | 283 | } |
310 | 284 | ||
311 | public override bool HasInventoryForUser(UUID userID) | 285 | public bool HasInventoryForUser(UUID userID) |
312 | { | 286 | { |
313 | return false; | 287 | return false; |
314 | } | 288 | } |
315 | 289 | ||
316 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 290 | public List<InventoryItemBase> GetActiveGestures(UUID userId) |
317 | { | 291 | { |
318 | return new List<InventoryItemBase>(); | 292 | return new List<InventoryItemBase>(); |
319 | } | 293 | } |
320 | 294 | ||
321 | public override int GetAssetPermissions(UUID userID, UUID assetID) | 295 | public int GetAssetPermissions(UUID userID, UUID assetID) |
322 | { | 296 | { |
323 | return m_RemoteConnector.GetAssetPermissions(userID, assetID); | 297 | return m_RemoteConnector.GetAssetPermissions(userID, assetID); |
324 | } | 298 | } |