aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2010-05-02 10:31:35 -0700
committerDiva Canto2010-05-02 10:31:35 -0700
commitbd49985afa0a30cf9338730807a42eff3d508bee (patch)
tree46786ed3004402af809e99a67a7bd1a3dbf182af /OpenSim/Region
parentadd operation to "nant distbin" to copy StandaloneCommon.ini.example -> Stand... (diff)
downloadopensim-SC_OLD-bd49985afa0a30cf9338730807a42eff3d508bee.zip
opensim-SC_OLD-bd49985afa0a30cf9338730807a42eff3d508bee.tar.gz
opensim-SC_OLD-bd49985afa0a30cf9338730807a42eff3d508bee.tar.bz2
opensim-SC_OLD-bd49985afa0a30cf9338730807a42eff3d508bee.tar.xz
Switched everything to XInventory by default. The old Inventory is still there for now, in case bugs pop up with XInventory.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs111
1 files changed, 28 insertions, 83 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index a2f26d5..22bd04c 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -41,7 +41,7 @@ using OpenMetaverse;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
43{ 43{
44 public class LocalInventoryServicesConnector : BaseInventoryConnector, ISharedRegionModule, IInventoryService 44 public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -50,7 +50,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
50 private IInventoryService m_InventoryService; 50 private IInventoryService m_InventoryService;
51 51
52 private bool m_Enabled = false; 52 private bool m_Enabled = false;
53 private bool m_Initialized = false;
54 53
55 public Type ReplaceableInterface 54 public Type ReplaceableInterface
56 { 55 {
@@ -93,23 +92,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
93 if (m_InventoryService == null) 92 if (m_InventoryService == null)
94 { 93 {
95 m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service"); 94 m_log.Error("[LOCAL INVENTORY SERVICES CONNECTOR]: Can't load inventory service");
96 //return;
97 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); 95 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
98 } 96 }
99 97
100 //List<IInventoryDataPlugin> plugins
101 // = DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(
102 // configSettings.StandaloneInventoryPlugin,
103 // configSettings.StandaloneInventorySource);
104
105 //foreach (IInventoryDataPlugin plugin in plugins)
106 //{
107 // // Using the OSP wrapper plugin for database plugins should be made configurable at some point
108 // m_InventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin, this));
109 //}
110
111 Init(source);
112
113 m_Enabled = true; 98 m_Enabled = true;
114 m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled"); 99 m_log.Info("[LOCAL INVENTORY SERVICES CONNECTOR]: Local inventory connector enabled");
115 } 100 }
@@ -128,99 +113,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
128 { 113 {
129 if (!m_Enabled) 114 if (!m_Enabled)
130 return; 115 return;
131
132 if (!m_Initialized)
133 {
134 m_Initialized = true;
135 }
136
137// m_log.DebugFormat(
138// "[LOCAL INVENTORY SERVICES CONNECTOR]: Registering IInventoryService to scene {0}", scene.RegionInfo.RegionName);
139 116
140 scene.RegisterModuleInterface<IInventoryService>(this); 117 scene.RegisterModuleInterface<IInventoryService>(this);
141 m_cache.AddRegion(scene);
142 } 118 }
143 119
144 public void RemoveRegion(Scene scene) 120 public void RemoveRegion(Scene scene)
145 { 121 {
146 if (!m_Enabled) 122 if (!m_Enabled)
147 return; 123 return;
148
149 m_cache.RemoveRegion(scene);
150 } 124 }
151 125
152 public void RegionLoaded(Scene scene) 126 public void RegionLoaded(Scene scene)
153 { 127 {
154 if (!m_Enabled) 128 if (!m_Enabled)
155 return; 129 return;
156
157 m_log.InfoFormat(
158 "[LOCAL INVENTORY SERVICES CONNECTOR]: Enabled local inventory for region {0}", scene.RegionInfo.RegionName);
159 } 130 }
160 131
161 #region IInventoryService 132 #region IInventoryService
162 133
163 public override bool CreateUserInventory(UUID user) 134 public bool CreateUserInventory(UUID user)
164 { 135 {
165 return m_InventoryService.CreateUserInventory(user); 136 return m_InventoryService.CreateUserInventory(user);
166 } 137 }
167 138
168 public override List<InventoryFolderBase> GetInventorySkeleton(UUID userId) 139 public List<InventoryFolderBase> GetInventorySkeleton(UUID userId)
169 { 140 {
170 return m_InventoryService.GetInventorySkeleton(userId); 141 return m_InventoryService.GetInventorySkeleton(userId);
171 } 142 }
172 143
173 public override InventoryCollection GetUserInventory(UUID id) 144 public InventoryCollection GetUserInventory(UUID id)
174 { 145 {
175 return m_InventoryService.GetUserInventory(id); 146 return m_InventoryService.GetUserInventory(id);
176 } 147 }
177 148
178 public override void GetUserInventory(UUID userID, InventoryReceiptCallback callback) 149 public void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
179 { 150 {
180 m_InventoryService.GetUserInventory(userID, callback); 151 m_InventoryService.GetUserInventory(userID, callback);
181 } 152 }
182 153
183 // Inherited. See base 154 public InventoryFolderBase GetRootFolder(UUID userID)
184 //public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
185 //{
186 // return m_InventoryService.GetFolderForType(userID, type);
187 //}
188
189 public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
190 { 155 {
191 InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); 156 return m_InventoryService.GetRootFolder(userID);
192 if (root != null) 157 }
193 {
194 InventoryCollection content = GetFolderContent(userID, root.ID);
195 if (content != null)
196 {
197 Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>();
198 foreach (InventoryFolderBase folder in content.Folders)
199 {
200 if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
201 {
202 //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type);
203 folders[(AssetType)folder.Type] = folder;
204 }
205 }
206 // Put the root folder there, as type Folder
207 folders[AssetType.Folder] = root;
208 //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type);
209 158
210 return folders; 159 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
211 } 160 {
212 } 161 return m_InventoryService.GetFolderForType(userID, type);
213 m_log.WarnFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: System folders for {0} not found", userID);
214 return new Dictionary<AssetType, InventoryFolderBase>();
215 } 162 }
216 163
217 public override InventoryCollection GetFolderContent(UUID userID, UUID folderID) 164 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
218 { 165 {
219 return m_InventoryService.GetFolderContent(userID, folderID); 166 return m_InventoryService.GetFolderContent(userID, folderID);
220 } 167 }
221 168
222 169 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
223 public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
224 { 170 {
225 return m_InventoryService.GetFolderItems(userID, folderID); 171 return m_InventoryService.GetFolderItems(userID, folderID);
226 } 172 }
@@ -230,7 +176,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
230 /// </summary> 176 /// </summary>
231 /// <param name="folder"></param> 177 /// <param name="folder"></param>
232 /// <returns>true if the folder was successfully added</returns> 178 /// <returns>true if the folder was successfully added</returns>
233 public override bool AddFolder(InventoryFolderBase folder) 179 public bool AddFolder(InventoryFolderBase folder)
234 { 180 {
235 return m_InventoryService.AddFolder(folder); 181 return m_InventoryService.AddFolder(folder);
236 } 182 }
@@ -240,7 +186,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
240 /// </summary> 186 /// </summary>
241 /// <param name="folder"></param> 187 /// <param name="folder"></param>
242 /// <returns>true if the folder was successfully updated</returns> 188 /// <returns>true if the folder was successfully updated</returns>
243 public override bool UpdateFolder(InventoryFolderBase folder) 189 public bool UpdateFolder(InventoryFolderBase folder)
244 { 190 {
245 return m_InventoryService.UpdateFolder(folder); 191 return m_InventoryService.UpdateFolder(folder);
246 } 192 }
@@ -250,12 +196,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
250 /// </summary> 196 /// </summary>
251 /// <param name="folder">A folder containing the details of the new location</param> 197 /// <param name="folder">A folder containing the details of the new location</param>
252 /// <returns>true if the folder was successfully moved</returns> 198 /// <returns>true if the folder was successfully moved</returns>
253 public override bool MoveFolder(InventoryFolderBase folder) 199 public bool MoveFolder(InventoryFolderBase folder)
254 { 200 {
255 return m_InventoryService.MoveFolder(folder); 201 return m_InventoryService.MoveFolder(folder);
256 } 202 }
257 203
258 public override bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) 204 public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
259 { 205 {
260 return m_InventoryService.DeleteFolders(ownerID, folderIDs); 206 return m_InventoryService.DeleteFolders(ownerID, folderIDs);
261 } 207 }
@@ -265,18 +211,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
265 /// </summary> 211 /// </summary>
266 /// <param name="folder"></param> 212 /// <param name="folder"></param>
267 /// <returns>true if the folder was successfully purged</returns> 213 /// <returns>true if the folder was successfully purged</returns>
268 public override bool PurgeFolder(InventoryFolderBase folder) 214 public bool PurgeFolder(InventoryFolderBase folder)
269 { 215 {
270 return m_InventoryService.PurgeFolder(folder); 216 return m_InventoryService.PurgeFolder(folder);
271 } 217 }
272 218
273 /// <summary> 219 /// <summary>
274 /// Add a new item to the user's inventory, plain 220 /// Add a new item to the user's inventory
275 /// Called by base class AddItem
276 /// </summary> 221 /// </summary>
277 /// <param name="item"></param> 222 /// <param name="item"></param>
278 /// <returns>true if the item was successfully added</returns> 223 /// <returns>true if the item was successfully added</returns>
279 protected override bool AddItemPlain(InventoryItemBase item) 224 public bool AddItem(InventoryItemBase item)
280 { 225 {
281 return m_InventoryService.AddItem(item); 226 return m_InventoryService.AddItem(item);
282 } 227 }
@@ -286,13 +231,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
286 /// </summary> 231 /// </summary>
287 /// <param name="item"></param> 232 /// <param name="item"></param>
288 /// <returns>true if the item was successfully updated</returns> 233 /// <returns>true if the item was successfully updated</returns>
289 public override bool UpdateItem(InventoryItemBase item) 234 public bool UpdateItem(InventoryItemBase item)
290 { 235 {
291 return m_InventoryService.UpdateItem(item); 236 return m_InventoryService.UpdateItem(item);
292 } 237 }
293 238
294 239
295 public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) 240 public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
296 { 241 {
297 return m_InventoryService.MoveItems(ownerID, items); 242 return m_InventoryService.MoveItems(ownerID, items);
298 } 243 }
@@ -302,12 +247,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
302 /// </summary> 247 /// </summary>
303 /// <param name="item"></param> 248 /// <param name="item"></param>
304 /// <returns>true if the item was successfully deleted</returns> 249 /// <returns>true if the item was successfully deleted</returns>
305 public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) 250 public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
306 { 251 {
307 return m_InventoryService.DeleteItems(ownerID, itemIDs); 252 return m_InventoryService.DeleteItems(ownerID, itemIDs);
308 } 253 }
309 254
310 public override InventoryItemBase GetItem(InventoryItemBase item) 255 public InventoryItemBase GetItem(InventoryItemBase item)
311 { 256 {
312// m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); 257// m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID);
313 258
@@ -322,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
322 return item; 267 return item;
323 } 268 }
324 269
325 public override InventoryFolderBase GetFolder(InventoryFolderBase folder) 270 public InventoryFolderBase GetFolder(InventoryFolderBase folder)
326 { 271 {
327 return m_InventoryService.GetFolder(folder); 272 return m_InventoryService.GetFolder(folder);
328 } 273 }
@@ -332,17 +277,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
332 /// </summary> 277 /// </summary>
333 /// <param name="userID"></param> 278 /// <param name="userID"></param>
334 /// <returns></returns> 279 /// <returns></returns>
335 public override bool HasInventoryForUser(UUID userID) 280 public bool HasInventoryForUser(UUID userID)
336 { 281 {
337 return m_InventoryService.HasInventoryForUser(userID); 282 return m_InventoryService.HasInventoryForUser(userID);
338 } 283 }
339 284
340 public override List<InventoryItemBase> GetActiveGestures(UUID userId) 285 public List<InventoryItemBase> GetActiveGestures(UUID userId)
341 { 286 {
342 return m_InventoryService.GetActiveGestures(userId); 287 return m_InventoryService.GetActiveGestures(userId);
343 } 288 }
344 289
345 public override int GetAssetPermissions(UUID userID, UUID assetID) 290 public int GetAssetPermissions(UUID userID, UUID assetID)
346 { 291 {
347 return m_InventoryService.GetAssetPermissions(userID, assetID); 292 return m_InventoryService.GetAssetPermissions(userID, assetID);
348 } 293 }