aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-30 16:08:24 +0000
committerTeravus Ovares2008-04-30 16:08:24 +0000
commita9cc76e0efba7496909d613c75b81de6a9c5d979 (patch)
treee83763d4dfb3b78ead9b5926dce1d2468b496845 /OpenSim/Data/MySQL
parentmove IUserService into the OpenSim.Framework.Communications assembly (diff)
downloadopensim-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 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs21
-rw-r--r--OpenSim/Data/MySQL/Resources/CreateItemsTable.sql8
-rw-r--r--OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql8
3 files changed, 32 insertions, 5 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 {
diff --git a/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
index 1723ee3..c8b7481 100644
--- a/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
+++ b/OpenSim/Data/MySQL/Resources/CreateItemsTable.sql
@@ -12,7 +12,13 @@ CREATE TABLE `inventoryitems` (
12 `creatorID` varchar(36) default NULL, 12 `creatorID` varchar(36) default NULL,
13 `inventoryBasePermissions` int(10) unsigned NOT NULL default 0, 13 `inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
14 `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0, 14 `inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
15 `salePrice` int(11) default NULL,
16 `saleType` tinyint(4) default NULL,
17 `creationDate` int(11) default NULL,
18 `groupID` varchar(63) default NULL,
19 `groupOwned` tinyint(4) default NULL,
20 `flags` int(11) unsigned default NULL,
15 PRIMARY KEY (`inventoryID`), 21 PRIMARY KEY (`inventoryID`),
16 KEY `owner` (`avatarID`), 22 KEY `owner` (`avatarID`),
17 KEY `folder` (`parentFolderID`) 23 KEY `folder` (`parentFolderID`)
18) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2'; 24) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 3';
diff --git a/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql
new file mode 100644
index 0000000..2b3b1f7
--- /dev/null
+++ b/OpenSim/Data/MySQL/Resources/UpgradeItemsTableToVersion3.sql
@@ -0,0 +1,8 @@
1ALTER TABLE `inventoryitems`
2 ADD COLUMN `salePrice` int(11) NOT NULL,
3 ADD COLUMN `saleType` tinyint(4) NOT NULL,
4 ADD COLUMN `creationDate` int(11) NOT NULL,
5 ADD COLUMN `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
6 ADD COLUMN `groupOwned` tinyint(4) NOT NULL,
7 ADD COLUMN `flags` int(11) unsigned NOT NULL,
8COMMENT='Rev. 3';