diff options
author | Teravus Ovares | 2008-04-30 16:08:24 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-30 16:08:24 +0000 |
commit | a9cc76e0efba7496909d613c75b81de6a9c5d979 (patch) | |
tree | e83763d4dfb3b78ead9b5926dce1d2468b496845 /OpenSim/Data/MySQL/MySQLInventoryData.cs | |
parent | move IUserService into the OpenSim.Framework.Communications assembly (diff) | |
download | opensim-SC-a9cc76e0efba7496909d613c75b81de6a9c5d979.zip opensim-SC-a9cc76e0efba7496909d613c75b81de6a9c5d979.tar.gz opensim-SC-a9cc76e0efba7496909d613c75b81de6a9c5d979.tar.bz2 opensim-SC-a9cc76e0efba7496909d613c75b81de6a9c5d979.tar.xz |
* Long awaited patch from A_Biondi Mantis 923. Kept alive by Melanie. Thanks A_Biondi and Melanie!
* This builds but might not work. JustinCC will examine.. it may work out of the box.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 6261d37..2c781e0 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -332,6 +332,15 @@ namespace OpenSim.Data.MySQL | |||
332 | item.Creator = new LLUUID((string) reader["creatorID"]); | 332 | item.Creator = new LLUUID((string) reader["creatorID"]); |
333 | item.BasePermissions = (uint) reader["inventoryBasePermissions"]; | 333 | item.BasePermissions = (uint) reader["inventoryBasePermissions"]; |
334 | item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; | 334 | item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; |
335 | |||
336 | // new fields | ||
337 | item.SalePrice = (int) reader["salePrice"]; | ||
338 | item.SaleType = Convert.ToByte(reader["saleType"]); | ||
339 | item.CreationDate = (int) reader["creationDate"]; | ||
340 | item.GroupID = new LLUUID(reader["groupID"].ToString()); | ||
341 | item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); | ||
342 | item.Flags = (uint) reader["flags"]; | ||
343 | |||
335 | return item; | 344 | return item; |
336 | } | 345 | } |
337 | catch (MySqlException e) | 346 | catch (MySqlException e) |
@@ -353,8 +362,6 @@ namespace OpenSim.Data.MySQL | |||
353 | { | 362 | { |
354 | lock (database) | 363 | lock (database) |
355 | { | 364 | { |
356 | Dictionary<string, string> param = new Dictionary<string, string>(); | ||
357 | |||
358 | MySqlCommand result = | 365 | MySqlCommand result = |
359 | new MySqlCommand("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", database.Connection); | 366 | new MySqlCommand("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", database.Connection); |
360 | result.Parameters.AddWithValue("?uuid", itemID.ToString()); | 367 | result.Parameters.AddWithValue("?uuid", itemID.ToString()); |
@@ -444,9 +451,9 @@ namespace OpenSim.Data.MySQL | |||
444 | public void addInventoryItem(InventoryItemBase item) | 451 | public void addInventoryItem(InventoryItemBase item) |
445 | { | 452 | { |
446 | string sql = | 453 | string sql = |
447 | "REPLACE INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions) VALUES "; | 454 | "REPLACE INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags) VALUES "; |
448 | sql += | 455 | sql += |
449 | "(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID, ?inventoryBasePermissions, ?inventoryEveryOnePermissions)"; | 456 | "(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID, ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?salePrice, ?saleType, ?creationDate, ?groupID, ?groupOwned, ?flags)"; |
450 | 457 | ||
451 | try | 458 | try |
452 | { | 459 | { |
@@ -465,6 +472,12 @@ namespace OpenSim.Data.MySQL | |||
465 | result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); | 472 | result.Parameters.AddWithValue("?creatorID", item.Creator.ToString()); |
466 | result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); | 473 | result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions); |
467 | result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); | 474 | result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions); |
475 | result.Parameters.AddWithValue("?salePrice", item.SalePrice); | ||
476 | result.Parameters.AddWithValue("?saleType", item.SaleType); | ||
477 | result.Parameters.AddWithValue("?creationDate", item.CreationDate); | ||
478 | result.Parameters.AddWithValue("?groupID", item.GroupID); | ||
479 | result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); | ||
480 | result.Parameters.AddWithValue("?flags", item.Flags); | ||
468 | 481 | ||
469 | lock (database) | 482 | lock (database) |
470 | { | 483 | { |