diff options
author | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-06 07:52:41 +0000 |
commit | 7d89e122930be39e84a6d174548fa2d12ac0484a (patch) | |
tree | e5aa5752f988a9aba2a969f49e5e208985eda80c /OpenSim/Data/MySQL/MySQLInventoryData.cs | |
parent | * minor: speculatively try a change to bamboo.build to see if this generates ... (diff) | |
download | opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.zip opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.gz opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.bz2 opensim-SC_OLD-7d89e122930be39e84a6d174548fa2d12ac0484a.tar.xz |
* This is the fabled LibOMV update with all of the libOMV types from JHurliman
* This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle.
* This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big!
* Essentially we're back at square 1 in the testing phase.. so lets identify things that broke.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 54 |
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using libsecondlife; | 31 | using OpenMetaverse; |
32 | using log4net; | 32 | using log4net; |
33 | using MySql.Data.MySqlClient; | 33 | using MySql.Data.MySqlClient; |
34 | using OpenSim.Framework; | 34 | using 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 | ||