diff options
author | Jeff Ames | 2008-05-16 01:22:11 +0000 |
---|---|---|
committer | Jeff Ames | 2008-05-16 01:22:11 +0000 |
commit | 65c5efe43b68700bad94076d4cd421160203c5de (patch) | |
tree | 589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Framework/Communications/InventoryServiceBase.cs | |
parent | Thank you very much, mjm for : (diff) | |
download | opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.zip opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2 opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Framework/Communications/InventoryServiceBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/InventoryServiceBase.cs | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index e81d8c4..dffeed3 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -40,13 +40,13 @@ namespace OpenSim.Framework.Communications | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public abstract class InventoryServiceBase : IInventoryServices | 41 | public abstract class InventoryServiceBase : IInventoryServices |
42 | { | 42 | { |
43 | private static readonly ILog m_log | 43 | private static readonly ILog m_log |
44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); | 46 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); |
47 | 47 | ||
48 | #region Plugin methods | 48 | #region Plugin methods |
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Adds a new user server plugin - plugins will be requested in the order they were loaded. | 51 | /// Adds a new user server plugin - plugins will be requested in the order they were loaded. |
52 | /// </summary> | 52 | /// </summary> |
@@ -76,42 +76,42 @@ namespace OpenSim.Framework.Communications | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | #endregion | 80 | #endregion |
81 | 81 | ||
82 | #region IInventoryServices methods | 82 | #region IInventoryServices methods |
83 | 83 | ||
84 | // See IInventoryServices | 84 | // See IInventoryServices |
85 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) | 85 | public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) |
86 | { | 86 | { |
87 | // m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); | 87 | // m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); |
88 | 88 | ||
89 | InventoryFolderBase rootFolder = RequestRootFolder(userId); | 89 | InventoryFolderBase rootFolder = RequestRootFolder(userId); |
90 | 90 | ||
91 | // Agent has no inventory structure yet. | 91 | // Agent has no inventory structure yet. |
92 | if (null == rootFolder) | 92 | if (null == rootFolder) |
93 | { | 93 | { |
94 | return null; | 94 | return null; |
95 | } | 95 | } |
96 | 96 | ||
97 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); | 97 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); |
98 | 98 | ||
99 | userFolders.Add(rootFolder); | 99 | userFolders.Add(rootFolder); |
100 | 100 | ||
101 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 101 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
102 | { | 102 | { |
103 | IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.ID); | 103 | IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.ID); |
104 | userFolders.AddRange(folders); | 104 | userFolders.AddRange(folders); |
105 | } | 105 | } |
106 | 106 | ||
107 | // foreach (InventoryFolderBase folder in userFolders) | 107 | // foreach (InventoryFolderBase folder in userFolders) |
108 | // { | 108 | // { |
109 | // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); | 109 | // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); |
110 | // } | 110 | // } |
111 | 111 | ||
112 | return userFolders; | 112 | return userFolders; |
113 | } | 113 | } |
114 | 114 | ||
115 | // See IInventoryServices | 115 | // See IInventoryServices |
116 | public virtual bool HasInventoryForUser(LLUUID userID) | 116 | public virtual bool HasInventoryForUser(LLUUID userID) |
117 | { | 117 | { |
@@ -133,31 +133,31 @@ namespace OpenSim.Framework.Communications | |||
133 | public bool CreateNewUserInventory(LLUUID user) | 133 | public bool CreateNewUserInventory(LLUUID user) |
134 | { | 134 | { |
135 | InventoryFolderBase existingRootFolder = RequestRootFolder(user); | 135 | InventoryFolderBase existingRootFolder = RequestRootFolder(user); |
136 | 136 | ||
137 | if (null != existingRootFolder) | 137 | if (null != existingRootFolder) |
138 | { | 138 | { |
139 | m_log.WarnFormat( | 139 | m_log.WarnFormat( |
140 | "[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have " | 140 | "[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have " |
141 | + "a root inventory folder with id {1}", | 141 | + "a root inventory folder with id {1}", |
142 | user, existingRootFolder.ID); | 142 | user, existingRootFolder.ID); |
143 | } | 143 | } |
144 | else | 144 | else |
145 | { | 145 | { |
146 | UsersInventory inven = new UsersInventory(); | 146 | UsersInventory inven = new UsersInventory(); |
147 | inven.CreateNewInventorySet(user); | 147 | inven.CreateNewInventorySet(user); |
148 | AddNewInventorySet(inven); | 148 | AddNewInventorySet(inven); |
149 | 149 | ||
150 | return true; | 150 | return true; |
151 | } | 151 | } |
152 | 152 | ||
153 | return false; | 153 | return false; |
154 | } | 154 | } |
155 | 155 | ||
156 | // See IInventoryServices | 156 | // See IInventoryServices |
157 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); | 157 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); |
158 | 158 | ||
159 | #endregion | 159 | #endregion |
160 | 160 | ||
161 | #region Methods used by GridInventoryService | 161 | #region Methods used by GridInventoryService |
162 | 162 | ||
163 | public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) | 163 | public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) |
@@ -180,21 +180,21 @@ namespace OpenSim.Framework.Communications | |||
180 | } | 180 | } |
181 | return itemsList; | 181 | return itemsList; |
182 | } | 182 | } |
183 | 183 | ||
184 | #endregion | 184 | #endregion |
185 | 185 | ||
186 | // See IInventoryServices | 186 | // See IInventoryServices |
187 | public bool AddFolder(InventoryFolderBase folder) | 187 | public bool AddFolder(InventoryFolderBase folder) |
188 | { | 188 | { |
189 | m_log.DebugFormat( | 189 | m_log.DebugFormat( |
190 | "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | 190 | "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
191 | 191 | ||
192 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 192 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
193 | { | 193 | { |
194 | plugin.Value.addInventoryFolder(folder); | 194 | plugin.Value.addInventoryFolder(folder); |
195 | } | 195 | } |
196 | 196 | ||
197 | // FIXME: Should return false on failure | 197 | // FIXME: Should return false on failure |
198 | return true; | 198 | return true; |
199 | } | 199 | } |
200 | 200 | ||
@@ -203,14 +203,14 @@ namespace OpenSim.Framework.Communications | |||
203 | { | 203 | { |
204 | m_log.DebugFormat( | 204 | m_log.DebugFormat( |
205 | "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | 205 | "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
206 | 206 | ||
207 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 207 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
208 | { | 208 | { |
209 | plugin.Value.moveInventoryFolder(folder); | 209 | plugin.Value.moveInventoryFolder(folder); |
210 | } | 210 | } |
211 | 211 | ||
212 | // FIXME: Should return false on failure | 212 | // FIXME: Should return false on failure |
213 | return true; | 213 | return true; |
214 | } | 214 | } |
215 | 215 | ||
216 | // See IInventoryServices | 216 | // See IInventoryServices |
@@ -218,14 +218,14 @@ namespace OpenSim.Framework.Communications | |||
218 | { | 218 | { |
219 | m_log.DebugFormat( | 219 | m_log.DebugFormat( |
220 | "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); | 220 | "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); |
221 | 221 | ||
222 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 222 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
223 | { | 223 | { |
224 | plugin.Value.addInventoryItem(item); | 224 | plugin.Value.addInventoryItem(item); |
225 | } | 225 | } |
226 | 226 | ||
227 | // FIXME: Should return false on failure | 227 | // FIXME: Should return false on failure |
228 | return true; | 228 | return true; |
229 | } | 229 | } |
230 | 230 | ||
231 | // See IInventoryServices | 231 | // See IInventoryServices |
@@ -233,14 +233,14 @@ namespace OpenSim.Framework.Communications | |||
233 | { | 233 | { |
234 | m_log.InfoFormat( | 234 | m_log.InfoFormat( |
235 | "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | 235 | "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); |
236 | 236 | ||
237 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 237 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
238 | { | 238 | { |
239 | plugin.Value.updateInventoryItem(item); | 239 | plugin.Value.updateInventoryItem(item); |
240 | } | 240 | } |
241 | 241 | ||
242 | // FIXME: Should return false on failure | 242 | // FIXME: Should return false on failure |
243 | return true; | 243 | return true; |
244 | } | 244 | } |
245 | 245 | ||
246 | // See IInventoryServices | 246 | // See IInventoryServices |
@@ -248,19 +248,19 @@ namespace OpenSim.Framework.Communications | |||
248 | { | 248 | { |
249 | m_log.InfoFormat( | 249 | m_log.InfoFormat( |
250 | "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); | 250 | "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); |
251 | 251 | ||
252 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 252 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
253 | { | 253 | { |
254 | plugin.Value.deleteInventoryItem(item.ID); | 254 | plugin.Value.deleteInventoryItem(item.ID); |
255 | } | 255 | } |
256 | 256 | ||
257 | // FIXME: Should return false on failure | 257 | // FIXME: Should return false on failure |
258 | return true; | 258 | return true; |
259 | } | 259 | } |
260 | 260 | ||
261 | /// <summary> | 261 | /// <summary> |
262 | /// Purge a folder of all items items and subfolders. | 262 | /// Purge a folder of all items items and subfolders. |
263 | /// | 263 | /// |
264 | /// FIXME: Really nasty in a sense, because we have to query the database to get information we may | 264 | /// FIXME: Really nasty in a sense, because we have to query the database to get information we may |
265 | /// already know... Needs heavy refactoring. | 265 | /// already know... Needs heavy refactoring. |
266 | /// </summary> | 266 | /// </summary> |
@@ -269,13 +269,13 @@ namespace OpenSim.Framework.Communications | |||
269 | { | 269 | { |
270 | m_log.DebugFormat( | 270 | m_log.DebugFormat( |
271 | "[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); | 271 | "[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); |
272 | 272 | ||
273 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); | 273 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); |
274 | 274 | ||
275 | foreach (InventoryFolderBase subFolder in subFolders) | 275 | foreach (InventoryFolderBase subFolder in subFolders) |
276 | { | 276 | { |
277 | // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); | 277 | // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); |
278 | 278 | ||
279 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 279 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
280 | { | 280 | { |
281 | plugin.Value.deleteInventoryFolder(subFolder.ID); | 281 | plugin.Value.deleteInventoryFolder(subFolder.ID); |
@@ -288,17 +288,17 @@ namespace OpenSim.Framework.Communications | |||
288 | { | 288 | { |
289 | DeleteItem(item); | 289 | DeleteItem(item); |
290 | } | 290 | } |
291 | 291 | ||
292 | // FIXME: Should return false on failure | 292 | // FIXME: Should return false on failure |
293 | return true; | 293 | return true; |
294 | } | 294 | } |
295 | 295 | ||
296 | private void AddNewInventorySet(UsersInventory inventory) | 296 | private void AddNewInventorySet(UsersInventory inventory) |
297 | { | 297 | { |
298 | foreach (InventoryFolderBase folder in inventory.Folders.Values) | 298 | foreach (InventoryFolderBase folder in inventory.Folders.Values) |
299 | { | 299 | { |
300 | AddFolder(folder); | 300 | AddFolder(folder); |
301 | } | 301 | } |
302 | } | 302 | } |
303 | 303 | ||
304 | /// <summary> | 304 | /// <summary> |
@@ -340,7 +340,7 @@ namespace OpenSim.Framework.Communications | |||
340 | folder.Type = (short)AssetType.Bodypart; | 340 | folder.Type = (short)AssetType.Bodypart; |
341 | folder.Version = 1; | 341 | folder.Version = 1; |
342 | Folders.Add(folder.ID, folder); | 342 | Folders.Add(folder.ID, folder); |
343 | 343 | ||
344 | folder = new InventoryFolderBase(); | 344 | folder = new InventoryFolderBase(); |
345 | folder.ParentID = rootFolder; | 345 | folder.ParentID = rootFolder; |
346 | folder.Owner = user; | 346 | folder.Owner = user; |
@@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications | |||
348 | folder.Name = "Calling Cards"; | 348 | folder.Name = "Calling Cards"; |
349 | folder.Type = (short)AssetType.CallingCard; | 349 | folder.Type = (short)AssetType.CallingCard; |
350 | folder.Version = 1; | 350 | folder.Version = 1; |
351 | Folders.Add(folder.ID, folder); | 351 | Folders.Add(folder.ID, folder); |
352 | 352 | ||
353 | folder = new InventoryFolderBase(); | 353 | folder = new InventoryFolderBase(); |
354 | folder.ParentID = rootFolder; | 354 | folder.ParentID = rootFolder; |