aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLInventoryData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs54
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index fe2d393..50d3cc7 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -28,7 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using libsecondlife; 31using OpenMetaverse;
32using log4net; 32using log4net;
33using MySql.Data.MySqlClient; 33using MySql.Data.MySqlClient;
34using OpenSim.Framework; 34using OpenSim.Framework;
@@ -125,7 +125,7 @@ namespace OpenSim.Data.MySQL
125 /// </summary> 125 /// </summary>
126 /// <param name="folderID">The folder to search</param> 126 /// <param name="folderID">The folder to search</param>
127 /// <returns>A list containing inventory items</returns> 127 /// <returns>A list containing inventory items</returns>
128 public List<InventoryItemBase> getInventoryInFolder(LLUUID folderID) 128 public List<InventoryItemBase> getInventoryInFolder(UUID folderID)
129 { 129 {
130 try 130 try
131 { 131 {
@@ -163,7 +163,7 @@ namespace OpenSim.Data.MySQL
163 /// </summary> 163 /// </summary>
164 /// <param name="user">The user whos inventory is to be searched</param> 164 /// <param name="user">The user whos inventory is to be searched</param>
165 /// <returns>A list of folder objects</returns> 165 /// <returns>A list of folder objects</returns>
166 public List<InventoryFolderBase> getUserRootFolders(LLUUID user) 166 public List<InventoryFolderBase> getUserRootFolders(UUID user)
167 { 167 {
168 try 168 try
169 { 169 {
@@ -176,7 +176,7 @@ namespace OpenSim.Data.MySQL
176 "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", 176 "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid",
177 database.Connection); 177 database.Connection);
178 result.Parameters.AddWithValue("?uuid", user.ToString()); 178 result.Parameters.AddWithValue("?uuid", user.ToString());
179 result.Parameters.AddWithValue("?zero", LLUUID.Zero.ToString()); 179 result.Parameters.AddWithValue("?zero", UUID.Zero.ToString());
180 MySqlDataReader reader = result.ExecuteReader(); 180 MySqlDataReader reader = result.ExecuteReader();
181 181
182 List<InventoryFolderBase> items = new List<InventoryFolderBase>(); 182 List<InventoryFolderBase> items = new List<InventoryFolderBase>();
@@ -204,7 +204,7 @@ namespace OpenSim.Data.MySQL
204 /// </summary> 204 /// </summary>
205 /// <param name="user">The user UUID</param> 205 /// <param name="user">The user UUID</param>
206 /// <returns></returns> 206 /// <returns></returns>
207 public InventoryFolderBase getUserRootFolder(LLUUID user) 207 public InventoryFolderBase getUserRootFolder(UUID user)
208 { 208 {
209 try 209 try
210 { 210 {
@@ -217,7 +217,7 @@ namespace OpenSim.Data.MySQL
217 "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid", 217 "SELECT * FROM inventoryfolders WHERE parentFolderID = ?zero AND agentID = ?uuid",
218 database.Connection); 218 database.Connection);
219 result.Parameters.AddWithValue("?uuid", user.ToString()); 219 result.Parameters.AddWithValue("?uuid", user.ToString());
220 result.Parameters.AddWithValue("?zero", LLUUID.Zero.ToString()); 220 result.Parameters.AddWithValue("?zero", UUID.Zero.ToString());
221 221
222 MySqlDataReader reader = result.ExecuteReader(); 222 MySqlDataReader reader = result.ExecuteReader();
223 223
@@ -258,7 +258,7 @@ namespace OpenSim.Data.MySQL
258 /// </summary> 258 /// </summary>
259 /// <param name="parentID">The folder to search</param> 259 /// <param name="parentID">The folder to search</param>
260 /// <returns>A list of inventory folders</returns> 260 /// <returns>A list of inventory folders</returns>
261 public List<InventoryFolderBase> getInventoryFolders(LLUUID parentID) 261 public List<InventoryFolderBase> getInventoryFolders(UUID parentID)
262 { 262 {
263 try 263 try
264 { 264 {
@@ -302,23 +302,23 @@ namespace OpenSim.Data.MySQL
302 { 302 {
303 InventoryItemBase item = new InventoryItemBase(); 303 InventoryItemBase item = new InventoryItemBase();
304 304
305 item.ID = new LLUUID((string) reader["inventoryID"]); 305 item.ID = new UUID((string) reader["inventoryID"]);
306 item.AssetID = new LLUUID((string) reader["assetID"]); 306 item.AssetID = new UUID((string) reader["assetID"]);
307 item.AssetType = (int) reader["assetType"]; 307 item.AssetType = (int) reader["assetType"];
308 item.Folder = new LLUUID((string) reader["parentFolderID"]); 308 item.Folder = new UUID((string) reader["parentFolderID"]);
309 item.Owner = new LLUUID((string) reader["avatarID"]); 309 item.Owner = new UUID((string) reader["avatarID"]);
310 item.Name = (string) reader["inventoryName"]; 310 item.Name = (string) reader["inventoryName"];
311 item.Description = (string) reader["inventoryDescription"]; 311 item.Description = (string) reader["inventoryDescription"];
312 item.NextPermissions = (uint) reader["inventoryNextPermissions"]; 312 item.NextPermissions = (uint) reader["inventoryNextPermissions"];
313 item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"]; 313 item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"];
314 item.InvType = (int) reader["invType"]; 314 item.InvType = (int) reader["invType"];
315 item.Creator = new LLUUID((string) reader["creatorID"]); 315 item.Creator = new UUID((string) reader["creatorID"]);
316 item.BasePermissions = (uint) reader["inventoryBasePermissions"]; 316 item.BasePermissions = (uint) reader["inventoryBasePermissions"];
317 item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; 317 item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
318 item.SalePrice = (int) reader["salePrice"]; 318 item.SalePrice = (int) reader["salePrice"];
319 item.SaleType = Convert.ToByte(reader["saleType"]); 319 item.SaleType = Convert.ToByte(reader["saleType"]);
320 item.CreationDate = (int) reader["creationDate"]; 320 item.CreationDate = (int) reader["creationDate"];
321 item.GroupID = new LLUUID(reader["groupID"].ToString()); 321 item.GroupID = new UUID(reader["groupID"].ToString());
322 item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); 322 item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
323 item.Flags = (uint) reader["flags"]; 323 item.Flags = (uint) reader["flags"];
324 324
@@ -337,7 +337,7 @@ namespace OpenSim.Data.MySQL
337 /// </summary> 337 /// </summary>
338 /// <param name="item">The item to return</param> 338 /// <param name="item">The item to return</param>
339 /// <returns>An inventory item</returns> 339 /// <returns>An inventory item</returns>
340 public InventoryItemBase getInventoryItem(LLUUID itemID) 340 public InventoryItemBase getInventoryItem(UUID itemID)
341 { 341 {
342 try 342 try
343 { 343 {
@@ -378,9 +378,9 @@ namespace OpenSim.Data.MySQL
378 try 378 try
379 { 379 {
380 InventoryFolderBase folder = new InventoryFolderBase(); 380 InventoryFolderBase folder = new InventoryFolderBase();
381 folder.Owner = new LLUUID((string) reader["agentID"]); 381 folder.Owner = new UUID((string) reader["agentID"]);
382 folder.ParentID = new LLUUID((string) reader["parentFolderID"]); 382 folder.ParentID = new UUID((string) reader["parentFolderID"]);
383 folder.ID = new LLUUID((string) reader["folderID"]); 383 folder.ID = new UUID((string) reader["folderID"]);
384 folder.Name = (string) reader["folderName"]; 384 folder.Name = (string) reader["folderName"];
385 folder.Type = (short) reader["type"]; 385 folder.Type = (short) reader["type"];
386 folder.Version = (ushort) ((int) reader["version"]); 386 folder.Version = (ushort) ((int) reader["version"]);
@@ -400,7 +400,7 @@ namespace OpenSim.Data.MySQL
400 /// </summary> 400 /// </summary>
401 /// <param name="folder">The folder to return</param> 401 /// <param name="folder">The folder to return</param>
402 /// <returns>A folder class</returns> 402 /// <returns>A folder class</returns>
403 public InventoryFolderBase getInventoryFolder(LLUUID folderID) 403 public InventoryFolderBase getInventoryFolder(UUID folderID)
404 { 404 {
405 try 405 try
406 { 406 {
@@ -498,7 +498,7 @@ namespace OpenSim.Data.MySQL
498 /// Detele the specified inventory item 498 /// Detele the specified inventory item
499 /// </summary> 499 /// </summary>
500 /// <param name="item">The inventory item UUID to delete</param> 500 /// <param name="item">The inventory item UUID to delete</param>
501 public void deleteInventoryItem(LLUUID itemID) 501 public void deleteInventoryItem(UUID itemID)
502 { 502 {
503 try 503 try
504 { 504 {
@@ -596,7 +596,7 @@ namespace OpenSim.Data.MySQL
596 /// </summary> 596 /// </summary>
597 /// <param name="folders">list where folders will be appended</param> 597 /// <param name="folders">list where folders will be appended</param>
598 /// <param name="parentID">ID of parent</param> 598 /// <param name="parentID">ID of parent</param>
599 protected void getInventoryFolders(ref List<InventoryFolderBase> folders, LLUUID parentID) 599 protected void getInventoryFolders(ref List<InventoryFolderBase> folders, UUID parentID)
600 { 600 {
601 List<InventoryFolderBase> subfolderList = getInventoryFolders(parentID); 601 List<InventoryFolderBase> subfolderList = getInventoryFolders(parentID);
602 602
@@ -610,7 +610,7 @@ namespace OpenSim.Data.MySQL
610 /// </summary> 610 /// </summary>
611 /// <param name="parentID"></param> 611 /// <param name="parentID"></param>
612 /// <returns></returns> 612 /// <returns></returns>
613 public List<InventoryFolderBase> getFolderHierarchy(LLUUID parentID) 613 public List<InventoryFolderBase> getFolderHierarchy(UUID parentID)
614 { 614 {
615 /* Note: There are subtle changes between this implementation of getFolderHierarchy and the previous one 615 /* Note: There are subtle changes between this implementation of getFolderHierarchy and the previous one
616 * - We will only need to hit the database twice instead of n times. 616 * - We will only need to hit the database twice instead of n times.
@@ -631,8 +631,8 @@ namespace OpenSim.Data.MySQL
631 try 631 try
632 { 632 {
633 List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); 633 List<InventoryFolderBase> folders = new List<InventoryFolderBase>();
634 Dictionary<LLUUID, List<InventoryFolderBase>> hashtable 634 Dictionary<UUID, List<InventoryFolderBase>> hashtable
635 = new Dictionary<LLUUID, List<InventoryFolderBase>>(); ; 635 = new Dictionary<UUID, List<InventoryFolderBase>>(); ;
636 List<InventoryFolderBase> parentFolder = new List<InventoryFolderBase>(); 636 List<InventoryFolderBase> parentFolder = new List<InventoryFolderBase>();
637 lock (database) 637 lock (database)
638 { 638 {
@@ -655,7 +655,7 @@ namespace OpenSim.Data.MySQL
655 655
656 if (parentFolder.Count >= 1) // No result means parent folder does not exist 656 if (parentFolder.Count >= 1) // No result means parent folder does not exist
657 { 657 {
658 if (parentFolder[0].ParentID == LLUUID.Zero) // We are querying the root folder 658 if (parentFolder[0].ParentID == UUID.Zero) // We are querying the root folder
659 { 659 {
660 /* Get all of the agent's folders from the database, put them in a list and return it */ 660 /* Get all of the agent's folders from the database, put them in a list and return it */
661 result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid", 661 result = new MySqlCommand("SELECT * FROM inventoryfolders WHERE agentID = ?uuid",
@@ -728,7 +728,7 @@ namespace OpenSim.Data.MySQL
728 /// Delete a folder from database 728 /// Delete a folder from database
729 /// </summary> 729 /// </summary>
730 /// <param name="folderID">the folder UUID</param> 730 /// <param name="folderID">the folder UUID</param>
731 protected void deleteOneFolder(LLUUID folderID) 731 protected void deleteOneFolder(UUID folderID)
732 { 732 {
733 try 733 try
734 { 734 {
@@ -754,7 +754,7 @@ namespace OpenSim.Data.MySQL
754 /// Delete all item in a folder 754 /// Delete all item in a folder
755 /// </summary> 755 /// </summary>
756 /// <param name="folderID">the folder UUID</param> 756 /// <param name="folderID">the folder UUID</param>
757 protected void deleteItemsInFolder(LLUUID folderID) 757 protected void deleteItemsInFolder(UUID folderID)
758 { 758 {
759 try 759 try
760 { 760 {
@@ -780,7 +780,7 @@ namespace OpenSim.Data.MySQL
780 /// Deletes an inventory folder 780 /// Deletes an inventory folder
781 /// </summary> 781 /// </summary>
782 /// <param name="folderId">Id of folder to delete</param> 782 /// <param name="folderId">Id of folder to delete</param>
783 public void deleteInventoryFolder(LLUUID folderID) 783 public void deleteInventoryFolder(UUID folderID)
784 { 784 {
785 List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID); 785 List<InventoryFolderBase> subFolders = getFolderHierarchy(folderID);
786 786