mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
* 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.
This commit is contained in:
@@ -332,6 +332,15 @@ namespace OpenSim.Data.MySQL
|
||||
item.Creator = new LLUUID((string) reader["creatorID"]);
|
||||
item.BasePermissions = (uint) reader["inventoryBasePermissions"];
|
||||
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
|
||||
|
||||
// new fields
|
||||
item.SalePrice = (int) reader["salePrice"];
|
||||
item.SaleType = Convert.ToByte(reader["saleType"]);
|
||||
item.CreationDate = (int) reader["creationDate"];
|
||||
item.GroupID = new LLUUID(reader["groupID"].ToString());
|
||||
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
|
||||
item.Flags = (uint) reader["flags"];
|
||||
|
||||
return item;
|
||||
}
|
||||
catch (MySqlException e)
|
||||
@@ -353,8 +362,6 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
lock (database)
|
||||
{
|
||||
Dictionary<string, string> param = new Dictionary<string, string>();
|
||||
|
||||
MySqlCommand result =
|
||||
new MySqlCommand("SELECT * FROM inventoryitems WHERE inventoryID = ?uuid", database.Connection);
|
||||
result.Parameters.AddWithValue("?uuid", itemID.ToString());
|
||||
@@ -444,9 +451,9 @@ namespace OpenSim.Data.MySQL
|
||||
public void addInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
string sql =
|
||||
"REPLACE INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions) VALUES ";
|
||||
"REPLACE INTO inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags) VALUES ";
|
||||
sql +=
|
||||
"(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID, ?inventoryBasePermissions, ?inventoryEveryOnePermissions)";
|
||||
"(?inventoryID, ?assetID, ?assetType, ?parentFolderID, ?avatarID, ?inventoryName, ?inventoryDescription, ?inventoryNextPermissions, ?inventoryCurrentPermissions, ?invType, ?creatorID, ?inventoryBasePermissions, ?inventoryEveryOnePermissions, ?salePrice, ?saleType, ?creationDate, ?groupID, ?groupOwned, ?flags)";
|
||||
|
||||
try
|
||||
{
|
||||
@@ -465,6 +472,12 @@ namespace OpenSim.Data.MySQL
|
||||
result.Parameters.AddWithValue("?creatorID", item.Creator.ToString());
|
||||
result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
|
||||
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
|
||||
result.Parameters.AddWithValue("?salePrice", item.SalePrice);
|
||||
result.Parameters.AddWithValue("?saleType", item.SaleType);
|
||||
result.Parameters.AddWithValue("?creationDate", item.CreationDate);
|
||||
result.Parameters.AddWithValue("?groupID", item.GroupID);
|
||||
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
|
||||
result.Parameters.AddWithValue("?flags", item.Flags);
|
||||
|
||||
lock (database)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,13 @@ CREATE TABLE `inventoryitems` (
|
||||
`creatorID` varchar(36) default NULL,
|
||||
`inventoryBasePermissions` int(10) unsigned NOT NULL default 0,
|
||||
`inventoryEveryOnePermissions` int(10) unsigned NOT NULL default 0,
|
||||
`salePrice` int(11) default NULL,
|
||||
`saleType` tinyint(4) default NULL,
|
||||
`creationDate` int(11) default NULL,
|
||||
`groupID` varchar(63) default NULL,
|
||||
`groupOwned` tinyint(4) default NULL,
|
||||
`flags` int(11) unsigned default NULL,
|
||||
PRIMARY KEY (`inventoryID`),
|
||||
KEY `owner` (`avatarID`),
|
||||
KEY `folder` (`parentFolderID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 2';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rev. 3';
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
ALTER TABLE `inventoryitems`
|
||||
ADD COLUMN `salePrice` int(11) NOT NULL,
|
||||
ADD COLUMN `saleType` tinyint(4) NOT NULL,
|
||||
ADD COLUMN `creationDate` int(11) NOT NULL,
|
||||
ADD COLUMN `groupID` varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000',
|
||||
ADD COLUMN `groupOwned` tinyint(4) NOT NULL,
|
||||
ADD COLUMN `flags` int(11) unsigned NOT NULL,
|
||||
COMMENT='Rev. 3';
|
||||
@@ -101,6 +101,14 @@ namespace OpenSim.Data.SQLite
|
||||
item.CurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]);
|
||||
item.BasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]);
|
||||
item.EveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]);
|
||||
|
||||
// new fields
|
||||
item.SalePrice = Convert.ToInt32(row["salePrice"]);
|
||||
item.SaleType = Convert.ToByte(row["saleType"]);
|
||||
item.CreationDate = Convert.ToInt32(row["creationDate"]);
|
||||
item.GroupID = new LLUUID((string)row["groupID"]);
|
||||
item.GroupOwned = Convert.ToBoolean(row["groupOwned"]);
|
||||
item.Flags = Convert.ToUInt32(row["Flags"]);
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -120,6 +128,14 @@ namespace OpenSim.Data.SQLite
|
||||
row["inventoryCurrentPermissions"] = item.CurrentPermissions;
|
||||
row["inventoryBasePermissions"] = item.BasePermissions;
|
||||
row["inventoryEveryOnePermissions"] = item.EveryOnePermissions;
|
||||
|
||||
// new fields
|
||||
row["salePrice"] = item.SalePrice;
|
||||
row["saleType"] = item.SaleType;
|
||||
row["creationDate"] = item.CreationDate;
|
||||
row["groupID"] = item.GroupID;
|
||||
row["groupOwned"] = item.GroupOwned;
|
||||
row["flags"] = item.Flags;
|
||||
}
|
||||
|
||||
private void addFolder(InventoryFolderBase folder, bool add)
|
||||
@@ -530,7 +546,21 @@ namespace OpenSim.Data.SQLite
|
||||
createCol(inv, "inventoryBasePermissions", typeof (Int32));
|
||||
createCol(inv, "inventoryEveryOnePermissions", typeof (Int32));
|
||||
|
||||
inv.PrimaryKey = new DataColumn[] {inv.Columns["UUID"]};
|
||||
// sale info
|
||||
createCol(inv, "salePrice", typeof(Int32));
|
||||
createCol(inv, "saleType", typeof(Byte));
|
||||
|
||||
// creation date
|
||||
createCol(inv, "creationDate", typeof(Int32));
|
||||
|
||||
// group info
|
||||
createCol(inv, "groupID", typeof(String));
|
||||
createCol(inv, "groupOwned", typeof(Boolean));
|
||||
|
||||
// Flags
|
||||
createCol(inv, "flags", typeof(UInt32));
|
||||
|
||||
inv.PrimaryKey = new DataColumn[] { inv.Columns["UUID"] };
|
||||
return inv;
|
||||
}
|
||||
|
||||
|
||||
@@ -721,7 +721,7 @@ namespace OpenSim.Data.SQLite
|
||||
createCol(items, "everyonePermissions", typeof (UInt32));
|
||||
createCol(items, "groupPermissions", typeof (UInt32));
|
||||
|
||||
items.PrimaryKey = new DataColumn[] {items.Columns["itemID"]};
|
||||
items.PrimaryKey = new DataColumn[] { items.Columns["itemID"] };
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user