Refactor InventoryItemBase to do the following:

* wrap fields as Properties
 * rename some fields/properties to more sensible names
 * set style to PropName to match more standard C# approach
0.6.0-stable
Sean Dague 2008-04-07 23:15:35 +00:00
parent bb2f163bf7
commit f436815107
16 changed files with 442 additions and 323 deletions

View File

@ -301,19 +301,19 @@ namespace OpenSim.Data.MSSQL
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.inventoryID = new LLUUID((string) reader["inventoryID"]); item.ID = new LLUUID((string) reader["inventoryID"]);
item.assetID = new LLUUID((string) reader["assetID"]); item.AssetID = new LLUUID((string) reader["assetID"]);
item.assetType = (int) reader["assetType"]; item.AssetType = (int) reader["assetType"];
item.parentFolderID = new LLUUID((string) reader["parentFolderID"]); item.Folder = new LLUUID((string) reader["parentFolderID"]);
item.avatarID = new LLUUID((string) reader["avatarID"]); item.Owner = new LLUUID((string) reader["avatarID"]);
item.inventoryName = (string) reader["inventoryName"]; item.Name = (string) reader["inventoryName"];
item.inventoryDescription = (string) reader["inventoryDescription"]; item.Description = (string) reader["inventoryDescription"];
item.inventoryNextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]); item.NextPermissions = Convert.ToUInt32(reader["inventoryNextPermissions"]);
item.inventoryCurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]); item.CurrentPermissions = Convert.ToUInt32(reader["inventoryCurrentPermissions"]);
item.invType = (int) reader["invType"]; item.InvType = (int) reader["invType"];
item.creatorsID = new LLUUID((string) reader["creatorID"]); item.Creator = new LLUUID((string) reader["creatorID"]);
item.inventoryBasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
item.inventoryEveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
return item; return item;
} }
catch (SqlException e) catch (SqlException e)
@ -425,7 +425,7 @@ namespace OpenSim.Data.MSSQL
/// <param name="item">The inventory item</param> /// <param name="item">The inventory item</param>
public void addInventoryItem(InventoryItemBase item) public void addInventoryItem(InventoryItemBase item)
{ {
if (getInventoryItem(item.inventoryID) != null) if (getInventoryItem(item.ID) != null)
{ {
updateInventoryItem(item); updateInventoryItem(item);
return; return;
@ -440,19 +440,19 @@ namespace OpenSim.Data.MSSQL
try try
{ {
Dictionary<string, string> param = new Dictionary<string, string>(); Dictionary<string, string> param = new Dictionary<string, string>();
param["inventoryID"] = item.inventoryID.ToString(); param["inventoryID"] = item.ID.ToString();
param["assetID"] = item.assetID.ToString(); param["assetID"] = item.AssetID.ToString();
param["assetType"] = item.assetType.ToString(); param["assetType"] = item.AssetType.ToString();
param["parentFolderID"] = item.parentFolderID.ToString(); param["parentFolderID"] = item.Folder.ToString();
param["avatarID"] = item.avatarID.ToString(); param["avatarID"] = item.Owner.ToString();
param["inventoryName"] = item.inventoryName; param["inventoryName"] = item.Name;
param["inventoryDescription"] = item.inventoryDescription; param["inventoryDescription"] = item.Description;
param["inventoryNextPermissions"] = item.inventoryNextPermissions.ToString(); param["inventoryNextPermissions"] = item.NextPermissions.ToString();
param["inventoryCurrentPermissions"] = item.inventoryCurrentPermissions.ToString(); param["inventoryCurrentPermissions"] = item.CurrentPermissions.ToString();
param["invType"] = Convert.ToString(item.invType); param["invType"] = Convert.ToString(item.InvType);
param["creatorID"] = item.creatorsID.ToString(); param["creatorID"] = item.Creator.ToString();
param["inventoryBasePermissions"] = Convert.ToString(item.inventoryBasePermissions); param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions);
param["inventoryEveryOnePermissions"] = Convert.ToString(item.inventoryEveryOnePermissions); param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions);
IDbCommand result = database.Query(sql, param); IDbCommand result = database.Query(sql, param);
result.ExecuteNonQuery(); result.ExecuteNonQuery();
@ -484,20 +484,20 @@ namespace OpenSim.Data.MSSQL
"inventoryBasePermissions = @inventoryBasePermissions" + "inventoryBasePermissions = @inventoryBasePermissions" +
"inventoryEveryOnePermissions = @inventoryEveryOnePermissions) where " + "inventoryEveryOnePermissions = @inventoryEveryOnePermissions) where " +
"inventoryID = @keyInventoryID;", database.getConnection()); "inventoryID = @keyInventoryID;", database.getConnection());
SqlParameter param1 = new SqlParameter("@inventoryID", item.inventoryID.ToString()); SqlParameter param1 = new SqlParameter("@inventoryID", item.ID.ToString());
SqlParameter param2 = new SqlParameter("@assetID", item.assetID); SqlParameter param2 = new SqlParameter("@assetID", item.AssetID);
SqlParameter param3 = new SqlParameter("@assetType", item.assetType); SqlParameter param3 = new SqlParameter("@assetType", item.AssetType);
SqlParameter param4 = new SqlParameter("@parentFolderID", item.parentFolderID); SqlParameter param4 = new SqlParameter("@parentFolderID", item.Folder);
SqlParameter param5 = new SqlParameter("@avatarID", item.avatarID); SqlParameter param5 = new SqlParameter("@avatarID", item.Owner);
SqlParameter param6 = new SqlParameter("@inventoryName", item.inventoryName); SqlParameter param6 = new SqlParameter("@inventoryName", item.Name);
SqlParameter param7 = new SqlParameter("@inventoryDescription", item.inventoryDescription); SqlParameter param7 = new SqlParameter("@inventoryDescription", item.Description);
SqlParameter param8 = new SqlParameter("@inventoryNextPermissions", item.inventoryNextPermissions); SqlParameter param8 = new SqlParameter("@inventoryNextPermissions", item.NextPermissions);
SqlParameter param9 = new SqlParameter("@inventoryCurrentPermissions", item.inventoryCurrentPermissions); SqlParameter param9 = new SqlParameter("@inventoryCurrentPermissions", item.CurrentPermissions);
SqlParameter param10 = new SqlParameter("@invType", item.invType); SqlParameter param10 = new SqlParameter("@invType", item.InvType);
SqlParameter param11 = new SqlParameter("@creatorID", item.creatorsID); SqlParameter param11 = new SqlParameter("@creatorID", item.Creator);
SqlParameter param12 = new SqlParameter("@inventoryBasePermissions", item.inventoryBasePermissions); SqlParameter param12 = new SqlParameter("@inventoryBasePermissions", item.BasePermissions);
SqlParameter param13 = new SqlParameter("@inventoryEveryOnePermissions", item.inventoryEveryOnePermissions); SqlParameter param13 = new SqlParameter("@inventoryEveryOnePermissions", item.EveryOnePermissions);
SqlParameter param14 = new SqlParameter("@keyInventoryID", item.inventoryID.ToString()); SqlParameter param14 = new SqlParameter("@keyInventoryID", item.ID.ToString());
command.Parameters.Add(param1); command.Parameters.Add(param1);
command.Parameters.Add(param2); command.Parameters.Add(param2);
command.Parameters.Add(param3); command.Parameters.Add(param3);

View File

@ -312,19 +312,19 @@ namespace OpenSim.Data.MySQL
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.inventoryID = new LLUUID((string) reader["inventoryID"]); item.ID = new LLUUID((string) reader["inventoryID"]);
item.assetID = new LLUUID((string) reader["assetID"]); item.AssetID = new LLUUID((string) reader["assetID"]);
item.assetType = (int) reader["assetType"]; item.AssetType = (int) reader["assetType"];
item.parentFolderID = new LLUUID((string) reader["parentFolderID"]); item.Folder = new LLUUID((string) reader["parentFolderID"]);
item.avatarID = new LLUUID((string) reader["avatarID"]); item.Owner = new LLUUID((string) reader["avatarID"]);
item.inventoryName = (string) reader["inventoryName"]; item.Name = (string) reader["inventoryName"];
item.inventoryDescription = (string) reader["inventoryDescription"]; item.Description = (string) reader["inventoryDescription"];
item.inventoryNextPermissions = (uint) reader["inventoryNextPermissions"]; item.NextPermissions = (uint) reader["inventoryNextPermissions"];
item.inventoryCurrentPermissions = (uint) reader["inventoryCurrentPermissions"]; item.CurrentPermissions = (uint) reader["inventoryCurrentPermissions"];
item.invType = (int) reader["invType"]; item.InvType = (int) reader["invType"];
item.creatorsID = new LLUUID((string) reader["creatorID"]); item.Creator = new LLUUID((string) reader["creatorID"]);
item.inventoryBasePermissions = (uint) reader["inventoryBasePermissions"]; item.BasePermissions = (uint) reader["inventoryBasePermissions"];
item.inventoryEveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
return item; return item;
} }
catch (MySqlException e) catch (MySqlException e)
@ -444,20 +444,20 @@ namespace OpenSim.Data.MySQL
try try
{ {
MySqlCommand result = new MySqlCommand(sql, database.Connection); MySqlCommand result = new MySqlCommand(sql, database.Connection);
result.Parameters.AddWithValue("?inventoryID", item.inventoryID.ToString()); result.Parameters.AddWithValue("?inventoryID", item.ID.ToString());
result.Parameters.AddWithValue("?assetID", item.assetID.ToString()); result.Parameters.AddWithValue("?assetID", item.AssetID.ToString());
result.Parameters.AddWithValue("?assetType", item.assetType.ToString()); result.Parameters.AddWithValue("?assetType", item.AssetType.ToString());
result.Parameters.AddWithValue("?parentFolderID", item.parentFolderID.ToString()); result.Parameters.AddWithValue("?parentFolderID", item.Folder.ToString());
result.Parameters.AddWithValue("?avatarID", item.avatarID.ToString()); result.Parameters.AddWithValue("?avatarID", item.Owner.ToString());
result.Parameters.AddWithValue("?inventoryName", item.inventoryName); result.Parameters.AddWithValue("?inventoryName", item.Name);
result.Parameters.AddWithValue("?inventoryDescription", item.inventoryDescription); result.Parameters.AddWithValue("?inventoryDescription", item.Description);
result.Parameters.AddWithValue("?inventoryNextPermissions", item.inventoryNextPermissions.ToString()); result.Parameters.AddWithValue("?inventoryNextPermissions", item.NextPermissions.ToString());
result.Parameters.AddWithValue("?inventoryCurrentPermissions", result.Parameters.AddWithValue("?inventoryCurrentPermissions",
item.inventoryCurrentPermissions.ToString()); item.CurrentPermissions.ToString());
result.Parameters.AddWithValue("?invType", item.invType); result.Parameters.AddWithValue("?invType", item.InvType);
result.Parameters.AddWithValue("?creatorID", item.creatorsID.ToString()); result.Parameters.AddWithValue("?creatorID", item.Creator.ToString());
result.Parameters.AddWithValue("?inventoryBasePermissions", item.inventoryBasePermissions); result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.inventoryEveryOnePermissions); result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
result.ExecuteNonQuery(); result.ExecuteNonQuery();
result.Dispose(); result.Dispose();
} }

View File

@ -112,7 +112,7 @@ namespace OpenSim.Data.NHibernate
/// <param name="item">The item to be created</param> /// <param name="item">The item to be created</param>
public void addInventoryItem(InventoryItemBase item) public void addInventoryItem(InventoryItemBase item)
{ {
if (!ExistsItem(item.inventoryID)) { if (!ExistsItem(item.ID)) {
using(ISession session = factory.OpenSession()) { using(ISession session = factory.OpenSession()) {
using(ITransaction transaction = session.BeginTransaction()) { using(ITransaction transaction = session.BeginTransaction()) {
session.Save(item); session.Save(item);
@ -120,7 +120,7 @@ namespace OpenSim.Data.NHibernate
} }
} }
} else { } else {
m_log.ErrorFormat("Attempted to add Inventory Item {0} that already exists, updating instead", item.inventoryID); m_log.ErrorFormat("Attempted to add Inventory Item {0} that already exists, updating instead", item.ID);
updateInventoryItem(item); updateInventoryItem(item);
} }
} }
@ -131,7 +131,7 @@ namespace OpenSim.Data.NHibernate
/// <param name="item">The updated item</param> /// <param name="item">The updated item</param>
public void updateInventoryItem(InventoryItemBase item) public void updateInventoryItem(InventoryItemBase item)
{ {
if (ExistsItem(item.inventoryID)) { if (ExistsItem(item.ID)) {
using(ISession session = factory.OpenSession()) { using(ISession session = factory.OpenSession()) {
using(ITransaction transaction = session.BeginTransaction()) { using(ITransaction transaction = session.BeginTransaction()) {
session.Update(item); session.Update(item);
@ -139,7 +139,7 @@ namespace OpenSim.Data.NHibernate
} }
} }
} else { } else {
m_log.ErrorFormat("Attempted to add Inventory Item {0} that already exists", item.inventoryID); m_log.ErrorFormat("Attempted to add Inventory Item {0} that already exists", item.ID);
} }
} }

View File

@ -91,39 +91,39 @@ namespace OpenSim.Data.SQLite
public InventoryItemBase buildItem(DataRow row) public InventoryItemBase buildItem(DataRow row)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.inventoryID = new LLUUID((string) row["UUID"]); item.ID = new LLUUID((string) row["UUID"]);
item.assetID = new LLUUID((string) row["assetID"]); item.AssetID = new LLUUID((string) row["assetID"]);
item.assetType = Convert.ToInt32(row["assetType"]); item.AssetType = Convert.ToInt32(row["assetType"]);
item.invType = Convert.ToInt32(row["invType"]); item.InvType = Convert.ToInt32(row["invType"]);
item.parentFolderID = new LLUUID((string) row["parentFolderID"]); item.Folder = new LLUUID((string) row["parentFolderID"]);
item.avatarID = new LLUUID((string) row["avatarID"]); item.Owner = new LLUUID((string) row["avatarID"]);
item.creatorsID = new LLUUID((string) row["creatorsID"]); item.Creator = new LLUUID((string) row["creatorsID"]);
item.inventoryName = (string) row["inventoryName"]; item.Name = (string) row["inventoryName"];
item.inventoryDescription = (string) row["inventoryDescription"]; item.Description = (string) row["inventoryDescription"];
item.inventoryNextPermissions = Convert.ToUInt32(row["inventoryNextPermissions"]); item.NextPermissions = Convert.ToUInt32(row["inventoryNextPermissions"]);
item.inventoryCurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]); item.CurrentPermissions = Convert.ToUInt32(row["inventoryCurrentPermissions"]);
item.inventoryBasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]); item.BasePermissions = Convert.ToUInt32(row["inventoryBasePermissions"]);
item.inventoryEveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]); item.EveryOnePermissions = Convert.ToUInt32(row["inventoryEveryOnePermissions"]);
return item; return item;
} }
private void fillItemRow(DataRow row, InventoryItemBase item) private void fillItemRow(DataRow row, InventoryItemBase item)
{ {
row["UUID"] = Util.ToRawUuidString(item.inventoryID); row["UUID"] = Util.ToRawUuidString(item.ID);
row["assetID"] = Util.ToRawUuidString(item.assetID); row["assetID"] = Util.ToRawUuidString(item.AssetID);
row["assetType"] = item.assetType; row["assetType"] = item.AssetType;
row["invType"] = item.invType; row["invType"] = item.InvType;
row["parentFolderID"] = Util.ToRawUuidString(item.parentFolderID); row["parentFolderID"] = Util.ToRawUuidString(item.Folder);
row["avatarID"] = Util.ToRawUuidString(item.avatarID); row["avatarID"] = Util.ToRawUuidString(item.Owner);
row["creatorsID"] = Util.ToRawUuidString(item.creatorsID); row["creatorsID"] = Util.ToRawUuidString(item.Creator);
row["inventoryName"] = item.inventoryName; row["inventoryName"] = item.Name;
row["inventoryDescription"] = item.inventoryDescription; row["inventoryDescription"] = item.Description;
row["inventoryNextPermissions"] = item.inventoryNextPermissions; row["inventoryNextPermissions"] = item.NextPermissions;
row["inventoryCurrentPermissions"] = item.inventoryCurrentPermissions; row["inventoryCurrentPermissions"] = item.CurrentPermissions;
row["inventoryBasePermissions"] = item.inventoryBasePermissions; row["inventoryBasePermissions"] = item.BasePermissions;
row["inventoryEveryOnePermissions"] = item.inventoryEveryOnePermissions; row["inventoryEveryOnePermissions"] = item.EveryOnePermissions;
} }
private void addFolder(InventoryFolderBase folder, bool add) private void addFolder(InventoryFolderBase folder, bool add)
@ -182,11 +182,11 @@ namespace OpenSim.Data.SQLite
{ {
DataTable inventoryItemTable = ds.Tables["inventoryitems"]; DataTable inventoryItemTable = ds.Tables["inventoryitems"];
DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.inventoryID)); DataRow inventoryRow = inventoryItemTable.Rows.Find(Util.ToRawUuidString(item.ID));
if (inventoryRow == null) if (inventoryRow == null)
{ {
if (! add) if (! add)
m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.inventoryID); m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory item: {0}", item.ID);
inventoryRow = inventoryItemTable.NewRow(); inventoryRow = inventoryItemTable.NewRow();
fillItemRow(inventoryRow, item); fillItemRow(inventoryRow, item);
@ -195,7 +195,7 @@ namespace OpenSim.Data.SQLite
else else
{ {
if (add) if (add)
m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.inventoryID); m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID);
fillItemRow(inventoryRow, item); fillItemRow(inventoryRow, item);
} }
@ -439,7 +439,7 @@ namespace OpenSim.Data.SQLite
List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId)); List<InventoryItemBase> items = getInventoryInFolder(Util.ToRawUuidString(folderId));
foreach (InventoryItemBase i in items) foreach (InventoryItemBase i in items)
deleteInventoryItem(Util.ToRawUuidString(i.inventoryID)); deleteInventoryItem(Util.ToRawUuidString(i.ID));
} }
/// <summary> /// <summary>

View File

@ -171,21 +171,21 @@ namespace OpenSim.Framework.Communications.Cache
{ {
if ((userID == UserProfile.UUID) && (RootFolder != null)) if ((userID == UserProfile.UUID) && (RootFolder != null))
{ {
if (itemInfo.parentFolderID == RootFolder.folderID) if (itemInfo.Folder == RootFolder.folderID)
{ {
if (!RootFolder.Items.ContainsKey(itemInfo.inventoryID)) if (!RootFolder.Items.ContainsKey(itemInfo.ID))
{ {
RootFolder.Items.Add(itemInfo.inventoryID, itemInfo); RootFolder.Items.Add(itemInfo.ID, itemInfo);
} }
} }
else else
{ {
InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.parentFolderID); InventoryFolderImpl folder = RootFolder.HasSubFolder(itemInfo.Folder);
if (folder != null) if (folder != null)
{ {
if (!folder.Items.ContainsKey(itemInfo.inventoryID)) if (!folder.Items.ContainsKey(itemInfo.ID))
{ {
folder.Items.Add(itemInfo.inventoryID, itemInfo); folder.Items.Add(itemInfo.ID, itemInfo);
} }
} }
} }
@ -214,7 +214,7 @@ namespace OpenSim.Framework.Communications.Cache
bool result = false; bool result = false;
if ((userID == UserProfile.UUID) && (RootFolder != null)) if ((userID == UserProfile.UUID) && (RootFolder != null))
{ {
result = RootFolder.DeleteItem(item.inventoryID); result = RootFolder.DeleteItem(item.ID);
if (result) if (result)
{ {
m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item); m_parentCommsManager.InventoryService.DeleteInventoryItem(userID, item);

View File

@ -116,19 +116,19 @@ namespace OpenSim.Framework.Communications.Cache
int assetType, int invType, LLUUID parentFolderID) int assetType, int invType, LLUUID parentFolderID)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = libOwner; item.Owner = libOwner;
item.creatorsID = libOwner; item.Creator = libOwner;
item.inventoryID = inventoryID; item.ID = inventoryID;
item.assetID = assetID; item.AssetID = assetID;
item.inventoryDescription = description; item.Description = description;
item.inventoryName = name; item.Name = name;
item.assetType = assetType; item.AssetType = assetType;
item.invType = invType; item.InvType = invType;
item.parentFolderID = parentFolderID; item.Folder = parentFolderID;
item.inventoryBasePermissions = 0x7FFFFFFF; item.BasePermissions = 0x7FFFFFFF;
item.inventoryEveryOnePermissions = 0x7FFFFFFF; item.EveryOnePermissions = 0x7FFFFFFF;
item.inventoryCurrentPermissions = 0x7FFFFFFF; item.CurrentPermissions = 0x7FFFFFFF;
item.inventoryNextPermissions = 0x7FFFFFFF; item.NextPermissions = 0x7FFFFFFF;
return item; return item;
} }
@ -204,31 +204,31 @@ namespace OpenSim.Framework.Communications.Cache
private void ReadItemFromConfig(IConfig config) private void ReadItemFromConfig(IConfig config)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = libOwner; item.Owner = libOwner;
item.creatorsID = libOwner; item.Creator = libOwner;
item.inventoryID = new LLUUID(config.GetString("inventoryID", folderID.ToString())); item.ID = new LLUUID(config.GetString("inventoryID", folderID.ToString()));
item.assetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString())); item.AssetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString()));
item.parentFolderID = new LLUUID(config.GetString("folderID", folderID.ToString())); item.Folder = new LLUUID(config.GetString("folderID", folderID.ToString()));
item.inventoryDescription = config.GetString("description", System.String.Empty); item.Description = config.GetString("description", System.String.Empty);
item.inventoryName = config.GetString("name", System.String.Empty); item.Name = config.GetString("name", System.String.Empty);
item.assetType = config.GetInt("assetType", 0); item.AssetType = config.GetInt("assetType", 0);
item.invType = config.GetInt("inventoryType", 0); item.InvType = config.GetInt("inventoryType", 0);
item.inventoryCurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF); item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
item.inventoryNextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF); item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
item.inventoryEveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF); item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
item.inventoryBasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF); item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
if (libraryFolders.ContainsKey(item.parentFolderID)) if (libraryFolders.ContainsKey(item.Folder))
{ {
InventoryFolderImpl parentFolder = libraryFolders[item.parentFolderID]; InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
parentFolder.Items.Add(item.inventoryID, item); parentFolder.Items.Add(item.ID, item);
} }
else else
{ {
m_log.WarnFormat( m_log.WarnFormat(
"[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", "[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
item.inventoryName, item.inventoryID, item.parentFolderID); item.Name, item.ID, item.Folder);
} }
} }

View File

@ -294,14 +294,14 @@ namespace OpenSim.Region.Capabilities
private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem) private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem)
{ {
LLSDInventoryItem llsdItem = new LLSDInventoryItem(); LLSDInventoryItem llsdItem = new LLSDInventoryItem();
llsdItem.asset_id = invItem.assetID; llsdItem.asset_id = invItem.AssetID;
llsdItem.created_at = 1000; llsdItem.created_at = 1000;
llsdItem.desc = invItem.inventoryDescription; llsdItem.desc = invItem.Description;
llsdItem.flags = 0; llsdItem.flags = 0;
llsdItem.item_id = invItem.inventoryID; llsdItem.item_id = invItem.ID;
llsdItem.name = invItem.inventoryName; llsdItem.name = invItem.Name;
llsdItem.parent_id = invItem.parentFolderID; llsdItem.parent_id = invItem.Folder;
llsdItem.type = Enum.GetName(typeof(AssetType), invItem.assetType).ToLower(); llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
// XXX Temporary fix for 'objects not appearing in inventory' problem. The asset type from libsecondlife is // XXX Temporary fix for 'objects not appearing in inventory' problem. The asset type from libsecondlife is
// returning "primitive" when it should returning "object"! It looks like this is fixed in the latest libsecondlife, // returning "primitive" when it should returning "object"! It looks like this is fixed in the latest libsecondlife,
@ -311,17 +311,17 @@ namespace OpenSim.Region.Capabilities
llsdItem.type = "object"; llsdItem.type = "object";
} }
llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.invType).ToLower(); llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower();
llsdItem.permissions = new LLSDPermissions(); llsdItem.permissions = new LLSDPermissions();
llsdItem.permissions.creator_id = invItem.creatorsID; llsdItem.permissions.creator_id = invItem.Creator;
llsdItem.permissions.base_mask = (int)invItem.inventoryCurrentPermissions; llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
llsdItem.permissions.everyone_mask = (int)invItem.inventoryEveryOnePermissions; llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
llsdItem.permissions.group_id = LLUUID.Zero; llsdItem.permissions.group_id = LLUUID.Zero;
llsdItem.permissions.group_mask = 0; llsdItem.permissions.group_mask = 0;
llsdItem.permissions.is_owner_group = false; llsdItem.permissions.is_owner_group = false;
llsdItem.permissions.next_owner_mask = (int)invItem.inventoryNextPermissions; llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions;
llsdItem.permissions.owner_id = m_agentID; // FixMe llsdItem.permissions.owner_id = m_agentID; // FixMe
llsdItem.permissions.owner_mask = (int)invItem.inventoryCurrentPermissions; llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
llsdItem.sale_info = new LLSDSaleInfo(); llsdItem.sale_info = new LLSDSaleInfo();
llsdItem.sale_info.sale_price = 10; llsdItem.sale_info.sale_price = 10;
llsdItem.sale_info.sale_type = "not"; llsdItem.sale_info.sale_type = "not";
@ -587,17 +587,17 @@ namespace OpenSim.Region.Capabilities
m_assetCache.AddAsset(asset); m_assetCache.AddAsset(asset);
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = m_agentID; item.Owner = m_agentID;
item.creatorsID = m_agentID; item.Creator = m_agentID;
item.inventoryID = inventoryItem; item.ID = inventoryItem;
item.assetID = asset.FullID; item.AssetID = asset.FullID;
item.inventoryDescription = assetDescription; item.Description = assetDescription;
item.inventoryName = assetName; item.Name = assetName;
item.assetType = assType; item.AssetType = assType;
item.invType = inType; item.InvType = inType;
item.parentFolderID = parentFolder; item.Folder = parentFolder;
item.inventoryCurrentPermissions = 2147483647; item.CurrentPermissions = 2147483647;
item.inventoryNextPermissions = 2147483647; item.NextPermissions = 2147483647;
if (AddNewInventoryItem != null) if (AddNewInventoryItem != null)
{ {

View File

@ -218,7 +218,7 @@ namespace OpenSim.Framework.Communications
{ {
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{ {
plugin.Value.deleteInventoryItem(item.inventoryID); plugin.Value.deleteInventoryItem(item.ID);
} }
} }

View File

@ -40,66 +40,185 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// A UUID containing the ID for the inventory item itself /// A UUID containing the ID for the inventory item itself
/// </summary> /// </summary>
public LLUUID inventoryID; private LLUUID _id;
/// <summary> /// <summary>
/// The UUID of the associated asset on the asset server /// The UUID of the associated asset on the asset server
/// </summary> /// </summary>
public LLUUID assetID; private LLUUID _assetID;
/// <summary> /// <summary>
/// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
/// </summary> /// </summary>
public int assetType; private int _assetType;
/// <summary> /// <summary>
/// The type of inventory item. (Can be slightly different to the asset type /// The type of inventory item. (Can be slightly different to the asset type
/// </summary> /// </summary>
public int invType; private int _invType;
/// <summary> /// <summary>
/// The folder this item is contained in /// The folder this item is contained in
/// </summary> /// </summary>
public LLUUID parentFolderID; private LLUUID _folder;
/// <summary> /// <summary>
/// The owner of this inventory item /// The owner of this inventory item
/// </summary> /// </summary>
public LLUUID avatarID; private LLUUID _owner;
/// <summary> /// <summary>
/// The creator of this item /// The creator of this item
/// </summary> /// </summary>
public LLUUID creatorsID; private LLUUID _creator;
/// <summary> /// <summary>
/// The name of the inventory item (must be less than 64 characters) /// The name of the inventory item (must be less than 64 characters)
/// </summary> /// </summary>
public string inventoryName; private string _name;
/// <summary> /// <summary>
/// The description of the inventory item (must be less than 64 characters) /// The description of the inventory item (must be less than 64 characters)
/// </summary> /// </summary>
public string inventoryDescription; private string _description;
/// <summary> /// <summary>
/// A mask containing the permissions for the next owner (cannot be enforced) /// A mask containing the permissions for the next owner (cannot be enforced)
/// </summary> /// </summary>
public uint inventoryNextPermissions; private uint _nextPermissions;
/// <summary> /// <summary>
/// A mask containing permissions for the current owner (cannot be enforced) /// A mask containing permissions for the current owner (cannot be enforced)
/// </summary> /// </summary>
public uint inventoryCurrentPermissions; private uint _currentPermissions;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public uint inventoryBasePermissions; private uint _basePermissions;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public uint inventoryEveryOnePermissions; private uint _everyOnePermissions;
public LLUUID ID {
get {
return _id;
}
set {
_id = value;
}
}
public int InvType {
get {
return _invType;
}
set {
_invType = value;
}
}
public LLUUID Folder {
get {
return _folder;
}
set {
_folder = value;
}
}
public LLUUID Owner {
get {
return _owner;
}
set {
_owner = value;
}
}
public LLUUID Creator {
get {
return _creator;
}
set {
_creator = value;
}
}
public string Name {
get {
return _name;
}
set {
_name = value;
}
}
public string Description {
get {
return _description;
}
set {
_description = value;
}
}
public uint NextPermissions {
get {
return _nextPermissions;
}
set {
_nextPermissions = value;
}
}
public uint CurrentPermissions {
get {
return _currentPermissions;
}
set {
_currentPermissions = value;
}
}
public uint BasePermissions {
get {
return _basePermissions;
}
set {
_basePermissions = value;
}
}
public uint EveryOnePermissions {
get {
return _everyOnePermissions;
}
set {
_everyOnePermissions = value;
}
}
public int AssetType {
get {
return _assetType;
}
set {
_assetType = value;
}
}
public LLUUID AssetID {
get {
return _assetID;
}
set {
_assetID = value;
}
}
} }
} }

View File

@ -189,10 +189,10 @@ namespace OpenSim.Grid.InventoryServer
// Right now, this actions act more like an update/insert combination than a simple create. // Right now, this actions act more like an update/insert combination than a simple create.
m_log.Info( m_log.Info(
"[AGENT INVENTORY]: " + "[AGENT INVENTORY]: " +
"Updating in " + item.parentFolderID.ToString() "Updating in " + item.Folder.ToString()
+ ", item " + item.inventoryName); + ", item " + item.Name);
AddNewInventoryItem(item.avatarID, item); AddNewInventoryItem(item.Owner, item);
return true; return true;
} }
@ -201,15 +201,15 @@ namespace OpenSim.Grid.InventoryServer
// extra spaces to align with other inventory messages // extra spaces to align with other inventory messages
m_log.Info( m_log.Info(
"[AGENT INVENTORY]: " + "[AGENT INVENTORY]: " +
"Deleting in " + item.parentFolderID.ToString() "Deleting in " + item.Folder.ToString()
+ ", item " + item.inventoryName); + ", item " + item.Name);
DeleteItem(item); DeleteItem(item);
} }
public bool DeleteInvItem(InventoryItemBase item) public bool DeleteInvItem(InventoryItemBase item)
{ {
DeleteInventoryItem(item.avatarID, item); DeleteInventoryItem(item.Owner, item);
return true; return true;
} }
} }

View File

@ -1219,25 +1219,25 @@ namespace OpenSim.Region.ClientStack
foreach (InventoryItemBase item in items) foreach (InventoryItemBase item in items)
{ {
descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock();
descend.ItemData[i].ItemID = item.inventoryID; descend.ItemData[i].ItemID = item.ID;
descend.ItemData[i].AssetID = item.assetID; descend.ItemData[i].AssetID = item.AssetID;
descend.ItemData[i].CreatorID = item.creatorsID; descend.ItemData[i].CreatorID = item.Creator;
descend.ItemData[i].BaseMask = item.inventoryBasePermissions; descend.ItemData[i].BaseMask = item.BasePermissions;
descend.ItemData[i].CreationDate = 1000; descend.ItemData[i].CreationDate = 1000;
descend.ItemData[i].Description = Helpers.StringToField(item.inventoryDescription); descend.ItemData[i].Description = Helpers.StringToField(item.Description);
descend.ItemData[i].EveryoneMask = item.inventoryEveryOnePermissions; descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
descend.ItemData[i].Flags = 1; descend.ItemData[i].Flags = 1;
descend.ItemData[i].FolderID = item.parentFolderID; descend.ItemData[i].FolderID = item.Folder;
descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
descend.ItemData[i].GroupMask = 0; descend.ItemData[i].GroupMask = 0;
descend.ItemData[i].InvType = (sbyte) item.invType; descend.ItemData[i].InvType = (sbyte) item.InvType;
descend.ItemData[i].Name = Helpers.StringToField(item.inventoryName); descend.ItemData[i].Name = Helpers.StringToField(item.Name);
descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions; descend.ItemData[i].NextOwnerMask = item.NextPermissions;
descend.ItemData[i].OwnerID = item.avatarID; descend.ItemData[i].OwnerID = item.Owner;
descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions; descend.ItemData[i].OwnerMask = item.CurrentPermissions;
descend.ItemData[i].SalePrice = 0; descend.ItemData[i].SalePrice = 0;
descend.ItemData[i].SaleType = 0; descend.ItemData[i].SaleType = 0;
descend.ItemData[i].Type = (sbyte) item.assetType; descend.ItemData[i].Type = (sbyte) item.AssetType;
descend.ItemData[i].CRC = descend.ItemData[i].CRC =
Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType, Helpers.InventoryCRC(descend.ItemData[i].CreationDate, descend.ItemData[i].SaleType,
descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].InvType, descend.ItemData[i].Type,
@ -1247,7 +1247,7 @@ namespace OpenSim.Region.ClientStack
descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID,
descend.ItemData[i].EveryoneMask, descend.ItemData[i].EveryoneMask,
descend.ItemData[i].Flags, descend.ItemData[i].OwnerMask, descend.ItemData[i].Flags, descend.ItemData[i].OwnerMask,
descend.ItemData[i].GroupMask, item.inventoryCurrentPermissions); descend.ItemData[i].GroupMask, item.CurrentPermissions);
i++; i++;
count++; count++;
@ -1364,26 +1364,26 @@ namespace OpenSim.Region.ClientStack
inventoryReply.AgentData.AgentID = AgentId; inventoryReply.AgentData.AgentID = AgentId;
inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1];
inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock(); inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock();
inventoryReply.InventoryData[0].ItemID = item.inventoryID; inventoryReply.InventoryData[0].ItemID = item.ID;
inventoryReply.InventoryData[0].AssetID = item.assetID; inventoryReply.InventoryData[0].AssetID = item.AssetID;
inventoryReply.InventoryData[0].CreatorID = item.creatorsID; inventoryReply.InventoryData[0].CreatorID = item.Creator;
inventoryReply.InventoryData[0].BaseMask = item.inventoryBasePermissions; inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
inventoryReply.InventoryData[0].CreationDate = inventoryReply.InventoryData[0].CreationDate =
(int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
inventoryReply.InventoryData[0].Description = Helpers.StringToField(item.inventoryDescription); inventoryReply.InventoryData[0].Description = Helpers.StringToField(item.Description);
inventoryReply.InventoryData[0].EveryoneMask = item.inventoryEveryOnePermissions; inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions;
inventoryReply.InventoryData[0].Flags = 0; inventoryReply.InventoryData[0].Flags = 0;
inventoryReply.InventoryData[0].FolderID = item.parentFolderID; inventoryReply.InventoryData[0].FolderID = item.Folder;
inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
inventoryReply.InventoryData[0].GroupMask = 0; inventoryReply.InventoryData[0].GroupMask = 0;
inventoryReply.InventoryData[0].InvType = (sbyte)item.invType; inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType;
inventoryReply.InventoryData[0].Name = Helpers.StringToField(item.inventoryName); inventoryReply.InventoryData[0].Name = Helpers.StringToField(item.Name);
inventoryReply.InventoryData[0].NextOwnerMask = item.inventoryNextPermissions; inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions;
inventoryReply.InventoryData[0].OwnerID = item.avatarID; inventoryReply.InventoryData[0].OwnerID = item.Owner;
inventoryReply.InventoryData[0].OwnerMask = item.inventoryCurrentPermissions; inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions;
inventoryReply.InventoryData[0].SalePrice = 0; inventoryReply.InventoryData[0].SalePrice = 0;
inventoryReply.InventoryData[0].SaleType = 0; inventoryReply.InventoryData[0].SaleType = 0;
inventoryReply.InventoryData[0].Type = (sbyte)item.assetType; inventoryReply.InventoryData[0].Type = (sbyte)item.AssetType;
inventoryReply.InventoryData[0].CRC = inventoryReply.InventoryData[0].CRC =
Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType,
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
@ -1416,25 +1416,25 @@ namespace OpenSim.Region.ClientStack
bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[1]; bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[1];
bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock(); bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock();
bulkUpdate.ItemData[0].ItemID = item.inventoryID; bulkUpdate.ItemData[0].ItemID = item.ID;
bulkUpdate.ItemData[0].AssetID = item.assetID; bulkUpdate.ItemData[0].AssetID = item.AssetID;
bulkUpdate.ItemData[0].CreatorID = item.creatorsID; bulkUpdate.ItemData[0].CreatorID = item.Creator;
bulkUpdate.ItemData[0].BaseMask = item.inventoryBasePermissions; bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
bulkUpdate.ItemData[0].CreationDate = 1000; bulkUpdate.ItemData[0].CreationDate = 1000;
bulkUpdate.ItemData[0].Description = Helpers.StringToField(item.inventoryDescription); bulkUpdate.ItemData[0].Description = Helpers.StringToField(item.Description);
bulkUpdate.ItemData[0].EveryoneMask = item.inventoryEveryOnePermissions; bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions;
bulkUpdate.ItemData[0].Flags = 0; bulkUpdate.ItemData[0].Flags = 0;
bulkUpdate.ItemData[0].FolderID = item.parentFolderID; bulkUpdate.ItemData[0].FolderID = item.Folder;
bulkUpdate.ItemData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); bulkUpdate.ItemData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
bulkUpdate.ItemData[0].GroupMask = 0; bulkUpdate.ItemData[0].GroupMask = 0;
bulkUpdate.ItemData[0].InvType = (sbyte)item.invType; bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType;
bulkUpdate.ItemData[0].Name = Helpers.StringToField(item.inventoryName); bulkUpdate.ItemData[0].Name = Helpers.StringToField(item.Name);
bulkUpdate.ItemData[0].NextOwnerMask = item.inventoryNextPermissions; bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions;
bulkUpdate.ItemData[0].OwnerID = item.avatarID; bulkUpdate.ItemData[0].OwnerID = item.Owner;
bulkUpdate.ItemData[0].OwnerMask = item.inventoryCurrentPermissions; bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions;
bulkUpdate.ItemData[0].SalePrice = 100; bulkUpdate.ItemData[0].SalePrice = 100;
bulkUpdate.ItemData[0].SaleType = 0; bulkUpdate.ItemData[0].SaleType = 0;
bulkUpdate.ItemData[0].Type = (sbyte)item.assetType; bulkUpdate.ItemData[0].Type = (sbyte)item.AssetType;
bulkUpdate.ItemData[0].CRC = bulkUpdate.ItemData[0].CRC =
Helpers.InventoryCRC(1000, 0, bulkUpdate.ItemData[0].InvType, Helpers.InventoryCRC(1000, 0, bulkUpdate.ItemData[0].InvType,
bulkUpdate.ItemData[0].Type, bulkUpdate.ItemData[0].AssetID, bulkUpdate.ItemData[0].Type, bulkUpdate.ItemData[0].AssetID,
@ -1461,25 +1461,25 @@ namespace OpenSim.Region.ClientStack
InventoryReply.AgentData.SimApproved = true; InventoryReply.AgentData.SimApproved = true;
InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1]; InventoryReply.InventoryData = new UpdateCreateInventoryItemPacket.InventoryDataBlock[1];
InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock(); InventoryReply.InventoryData[0] = new UpdateCreateInventoryItemPacket.InventoryDataBlock();
InventoryReply.InventoryData[0].ItemID = Item.inventoryID; InventoryReply.InventoryData[0].ItemID = Item.ID;
InventoryReply.InventoryData[0].AssetID = Item.assetID; InventoryReply.InventoryData[0].AssetID = Item.AssetID;
InventoryReply.InventoryData[0].CreatorID = Item.creatorsID; InventoryReply.InventoryData[0].CreatorID = Item.Creator;
InventoryReply.InventoryData[0].BaseMask = Item.inventoryBasePermissions; InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
InventoryReply.InventoryData[0].CreationDate = 1000; InventoryReply.InventoryData[0].CreationDate = 1000;
InventoryReply.InventoryData[0].Description = Helpers.StringToField(Item.inventoryDescription); InventoryReply.InventoryData[0].Description = Helpers.StringToField(Item.Description);
InventoryReply.InventoryData[0].EveryoneMask = Item.inventoryEveryOnePermissions; InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
InventoryReply.InventoryData[0].Flags = 0; InventoryReply.InventoryData[0].Flags = 0;
InventoryReply.InventoryData[0].FolderID = Item.parentFolderID; InventoryReply.InventoryData[0].FolderID = Item.Folder;
InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
InventoryReply.InventoryData[0].GroupMask = 0; InventoryReply.InventoryData[0].GroupMask = 0;
InventoryReply.InventoryData[0].InvType = (sbyte)Item.invType; InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType;
InventoryReply.InventoryData[0].Name = Helpers.StringToField(Item.inventoryName); InventoryReply.InventoryData[0].Name = Helpers.StringToField(Item.Name);
InventoryReply.InventoryData[0].NextOwnerMask = Item.inventoryNextPermissions; InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions;
InventoryReply.InventoryData[0].OwnerID = Item.avatarID; InventoryReply.InventoryData[0].OwnerID = Item.Owner;
InventoryReply.InventoryData[0].OwnerMask = Item.inventoryCurrentPermissions; InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions;
InventoryReply.InventoryData[0].SalePrice = 100; InventoryReply.InventoryData[0].SalePrice = 100;
InventoryReply.InventoryData[0].SaleType = 0; InventoryReply.InventoryData[0].SaleType = 0;
InventoryReply.InventoryData[0].Type = (sbyte)Item.assetType; InventoryReply.InventoryData[0].Type = (sbyte)Item.AssetType;
InventoryReply.InventoryData[0].CRC = InventoryReply.InventoryData[0].CRC =
Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,

View File

@ -232,7 +232,7 @@ namespace OpenSim.Region.Environment.Modules
{ {
m_log.DebugFormat( m_log.DebugFormat(
"[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}", "[TRANSACTIONS MANAGER] Called HandleItemUpdateFromTransaction with item {0}",
item.inventoryName); item.Name);
AgentAssetTransactions transactions AgentAssetTransactions transactions
= GetUserTransactions(remoteClient.AgentId); = GetUserTransactions(remoteClient.AgentId);

View File

@ -342,7 +342,7 @@ namespace OpenSim.Region.Environment.Modules
AssetBase asset AssetBase asset
= m_userTransactions.Manager.MyScene.CommsManager.AssetCache.GetAsset( = m_userTransactions.Manager.MyScene.CommsManager.AssetCache.GetAsset(
assetID, (item.assetType == (int) AssetType.Texture ? true : false)); assetID, (item.AssetType == (int) AssetType.Texture ? true : false));
if (asset == null) if (asset == null)
{ {
@ -351,11 +351,11 @@ namespace OpenSim.Region.Environment.Modules
if (asset != null && asset.FullID == assetID) if (asset != null && asset.FullID == assetID)
{ {
asset.Name = item.inventoryName; asset.Name = item.Name;
asset.Description = item.inventoryDescription; asset.Description = item.Description;
asset.InvType = (sbyte) item.invType; asset.InvType = (sbyte) item.InvType;
asset.Type = (sbyte) item.assetType; asset.Type = (sbyte) item.AssetType;
item.assetID = asset.FullID; item.AssetID = asset.FullID;
m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset); m_userTransactions.Manager.MyScene.CommsManager.AssetCache.AddAsset(Asset);
} }
@ -374,18 +374,18 @@ namespace OpenSim.Region.Environment.Modules
if (userInfo != null) if (userInfo != null)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = ourClient.AgentId; item.Owner = ourClient.AgentId;
item.creatorsID = ourClient.AgentId; item.Creator = ourClient.AgentId;
item.inventoryID = LLUUID.Random(); item.ID = LLUUID.Random();
item.assetID = Asset.FullID; item.AssetID = Asset.FullID;
item.inventoryDescription = m_description; item.Description = m_description;
item.inventoryName = m_name; item.Name = m_name;
item.assetType = type; item.AssetType = type;
item.invType = invType; item.InvType = invType;
item.parentFolderID = InventFolder; item.Folder = InventFolder;
item.inventoryBasePermissions = 2147483647; item.BasePermissions = 2147483647;
item.inventoryCurrentPermissions = 2147483647; item.CurrentPermissions = 2147483647;
item.inventoryNextPermissions = nextPerm; item.NextPermissions = nextPerm;
userInfo.AddItem(ourClient.AgentId, item); userInfo.AddItem(ourClient.AgentId, item);
ourClient.SendInventoryItemCreateUpdate(item); ourClient.SendInventoryItemCreateUpdate(item);

View File

@ -114,19 +114,19 @@ namespace OpenSim.Region.Environment.Scenes
if (item != null) if (item != null)
{ {
AssetBase asset = AssetBase asset =
CreateAsset(item.inventoryName, item.inventoryDescription, (sbyte) item.invType, CreateAsset(item.Name, item.Description, (sbyte) item.InvType,
(sbyte) item.assetType, data); (sbyte) item.AssetType, data);
AssetCache.AddAsset(asset); AssetCache.AddAsset(asset);
item.assetID = asset.FullID; item.AssetID = asset.FullID;
userInfo.UpdateItem(remoteClient.AgentId, item); userInfo.UpdateItem(remoteClient.AgentId, item);
// remoteClient.SendInventoryItemCreateUpdate(item); // remoteClient.SendInventoryItemCreateUpdate(item);
if ((InventoryType) item.invType == InventoryType.Notecard) if ((InventoryType) item.InvType == InventoryType.Notecard)
{ {
//do we want to know about updated note cards? //do we want to know about updated note cards?
} }
else if ((InventoryType) item.invType == InventoryType.LSL) else if ((InventoryType) item.InvType == InventoryType.LSL)
{ {
// do we want to know about updated scripts // do we want to know about updated scripts
} }
@ -258,9 +258,9 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (LLUUID.Zero == transactionID) if (LLUUID.Zero == transactionID)
{ {
item.inventoryName = name; item.Name = name;
item.inventoryDescription = description; item.Description = description;
item.inventoryNextPermissions = nextOwnerMask; item.NextPermissions = nextOwnerMask;
userInfo.UpdateItem(remoteClient.AgentId, item); userInfo.UpdateItem(remoteClient.AgentId, item);
} }
@ -319,20 +319,20 @@ namespace OpenSim.Region.Environment.Scenes
{ {
// Insert a copy of the item into the recipient // Insert a copy of the item into the recipient
InventoryItemBase itemCopy = new InventoryItemBase(); InventoryItemBase itemCopy = new InventoryItemBase();
itemCopy.avatarID = recipientClient.AgentId; itemCopy.Owner = recipientClient.AgentId;
itemCopy.creatorsID = senderId; itemCopy.Creator = senderId;
itemCopy.inventoryID = LLUUID.Random(); itemCopy.ID = LLUUID.Random();
itemCopy.assetID = item.assetID; itemCopy.AssetID = item.AssetID;
itemCopy.inventoryDescription = item.inventoryDescription; itemCopy.Description = item.Description;
itemCopy.inventoryName = item.inventoryName; itemCopy.Name = item.Name;
itemCopy.assetType = item.assetType; itemCopy.AssetType = item.AssetType;
itemCopy.invType = item.invType; itemCopy.InvType = item.InvType;
itemCopy.parentFolderID = recipientUserInfo.RootFolder.folderID; itemCopy.Folder = recipientUserInfo.RootFolder.folderID;
itemCopy.inventoryCurrentPermissions = 2147483647; itemCopy.CurrentPermissions = 2147483647;
itemCopy.inventoryNextPermissions = 2147483647; itemCopy.NextPermissions = 2147483647;
itemCopy.inventoryEveryOnePermissions = item.inventoryEveryOnePermissions; itemCopy.EveryOnePermissions = item.EveryOnePermissions;
itemCopy.inventoryBasePermissions = item.inventoryBasePermissions; itemCopy.BasePermissions = item.BasePermissions;
itemCopy.inventoryCurrentPermissions = item.inventoryCurrentPermissions; itemCopy.CurrentPermissions = item.CurrentPermissions;
recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy); recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy);
@ -343,8 +343,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}", "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}",
recipientClient.Name, recipientClient.AgentId, item.inventoryName, recipientClient.Name, recipientClient.AgentId, item.Name,
item.inventoryID, senderId); item.ID, senderId);
} }
} }
else else
@ -397,19 +397,19 @@ namespace OpenSim.Region.Environment.Scenes
AssetBase asset AssetBase asset
= AssetCache.GetAsset( = AssetCache.GetAsset(
item.assetID, (item.assetType == (int)AssetType.Texture ? true : false)); item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false));
if (asset != null) if (asset != null)
{ {
// TODO: preserve current permissions? // TODO: preserve current permissions?
CreateNewInventoryItem( CreateNewInventoryItem(
remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions); remoteClient, newFolderID, callbackID, asset, item.NextPermissions);
} }
else else
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found", "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
item.inventoryName, item.assetID); item.Name, item.AssetID);
} }
} }
@ -445,9 +445,9 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (newName != System.String.Empty) if (newName != System.String.Empty)
{ {
item.inventoryName = newName; item.Name = newName;
} }
item.parentFolderID = folderID; item.Folder = folderID;
userInfo.DeleteItem(remoteClient.AgentId, item); userInfo.DeleteItem(remoteClient.AgentId, item);
// TODO: preserve current permissions? // TODO: preserve current permissions?
@ -483,17 +483,17 @@ namespace OpenSim.Region.Environment.Scenes
if (userInfo != null) if (userInfo != null)
{ {
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = remoteClient.AgentId; item.Owner = remoteClient.AgentId;
item.creatorsID = remoteClient.AgentId; item.Creator = remoteClient.AgentId;
item.inventoryID = LLUUID.Random(); item.ID = LLUUID.Random();
item.assetID = asset.FullID; item.AssetID = asset.FullID;
item.inventoryDescription = asset.Description; item.Description = asset.Description;
item.inventoryName = asset.Name; item.Name = asset.Name;
item.assetType = asset.Type; item.AssetType = asset.Type;
item.invType = asset.InvType; item.InvType = asset.InvType;
item.parentFolderID = folderID; item.Folder = folderID;
item.inventoryCurrentPermissions = 2147483647; item.CurrentPermissions = 2147483647;
item.inventoryNextPermissions = nextOwnerMask; item.NextPermissions = nextOwnerMask;
userInfo.AddItem(remoteClient.AgentId, item); userInfo.AddItem(remoteClient.AgentId, item);
remoteClient.SendInventoryItemCreateUpdate(item); remoteClient.SendInventoryItemCreateUpdate(item);
@ -708,12 +708,12 @@ namespace OpenSim.Region.Environment.Scenes
if (item != null) if (item != null)
{ {
if (item.assetType == 0 || item.assetType == 1 || item.assetType == 10) if (item.AssetType == 0 || item.AssetType == 1 || item.AssetType == 10)
{ {
group.AddInventoryItem(remoteClient, primLocalID, item, copyID); group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
m_log.InfoFormat( m_log.InfoFormat(
"[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
item.inventoryName, primLocalID, remoteClient.Name); item.Name, primLocalID, remoteClient.Name);
group.GetProperties(remoteClient); group.GetProperties(remoteClient);
} }
else else
@ -725,7 +725,7 @@ namespace OpenSim.Region.Environment.Scenes
// nasty way it is done to be changed). // nasty way it is done to be changed).
m_log.WarnFormat( m_log.WarnFormat(
"[PRIM INVENTORY]: Sorry, prim inventory storage of asset type {0} is not yet supported", "[PRIM INVENTORY]: Sorry, prim inventory storage of asset type {0} is not yet supported",
item.assetType); item.AssetType);
} }
} }
else else
@ -790,7 +790,7 @@ namespace OpenSim.Region.Environment.Scenes
"[PRIM INVENTORY]: " + "[PRIM INVENTORY]: " +
"Could not rez script {0} into prim local ID {1} for user {2}" "Could not rez script {0} into prim local ID {1} for user {2}"
+ " because the prim could not be found in the region!", + " because the prim could not be found in the region!",
item.inventoryName, localID, remoteClient.Name); item.Name, localID, remoteClient.Name);
} }
} }
else else
@ -863,21 +863,21 @@ namespace OpenSim.Region.Environment.Scenes
AssetCache.AddAsset(asset); AssetCache.AddAsset(asset);
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase();
item.avatarID = remoteClient.AgentId; item.Owner = remoteClient.AgentId;
item.creatorsID = remoteClient.AgentId; item.Creator = remoteClient.AgentId;
item.inventoryID = LLUUID.Random(); item.ID = LLUUID.Random();
item.assetID = asset.FullID; item.AssetID = asset.FullID;
item.inventoryDescription = asset.Description; item.Description = asset.Description;
item.inventoryName = asset.Name; item.Name = asset.Name;
item.assetType = asset.Type; item.AssetType = asset.Type;
item.invType = asset.InvType; item.InvType = asset.InvType;
item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; item.Folder = DeRezPacket.AgentBlock.DestinationID;
item.inventoryCurrentPermissions = 2147483647; item.CurrentPermissions = 2147483647;
item.inventoryNextPermissions = 2147483647; item.NextPermissions = 2147483647;
item.inventoryEveryOnePermissions = item.EveryOnePermissions =
((SceneObjectGroup) selectedEnt).RootPart.EveryoneMask; ((SceneObjectGroup) selectedEnt).RootPart.EveryoneMask;
item.inventoryBasePermissions = ((SceneObjectGroup) selectedEnt).RootPart.BaseMask; item.BasePermissions = ((SceneObjectGroup) selectedEnt).RootPart.BaseMask;
item.inventoryCurrentPermissions = ((SceneObjectGroup) selectedEnt).RootPart.OwnerMask; item.CurrentPermissions = ((SceneObjectGroup) selectedEnt).RootPart.OwnerMask;
userInfo.AddItem(remoteClient.AgentId, item); userInfo.AddItem(remoteClient.AgentId, item);
remoteClient.SendInventoryItemCreateUpdate(item); remoteClient.SendInventoryItemCreateUpdate(item);
@ -942,7 +942,7 @@ namespace OpenSim.Region.Environment.Scenes
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
if (item != null) if (item != null)
{ {
AssetBase rezAsset = AssetCache.GetAsset(item.assetID, false); AssetBase rezAsset = AssetCache.GetAsset(item.AssetID, false);
if (rezAsset != null) if (rezAsset != null)
{ {
@ -956,8 +956,8 @@ namespace OpenSim.Region.Environment.Scenes
// Since renaming the item in the inventory does not affect the name stored // Since renaming the item in the inventory does not affect the name stored
// in the serialization, transfer the correct name from the inventory to the // in the serialization, transfer the correct name from the inventory to the
// object itself before we rez. // object itself before we rez.
rootPart.Name = item.inventoryName; rootPart.Name = item.Name;
rootPart.Description = item.inventoryDescription; rootPart.Description = item.Description;
rootPart.TrimPermissions(); rootPart.TrimPermissions();
group.ApplyPhysics(m_physicalPrim); group.ApplyPhysics(m_physicalPrim);

View File

@ -178,7 +178,7 @@ namespace OpenSim.Region.Environment.Scenes
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, public bool AddInventoryItem(IClientAPI remoteClient, uint localID,
InventoryItemBase item, LLUUID copyItemID) InventoryItemBase item, LLUUID copyItemID)
{ {
LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.inventoryID; LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.ID;
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
if (part != null) if (part != null)
@ -186,13 +186,13 @@ namespace OpenSim.Region.Environment.Scenes
TaskInventoryItem taskItem = new TaskInventoryItem(); TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ItemID = newItemId; taskItem.ItemID = newItemId;
taskItem.AssetID = item.assetID; taskItem.AssetID = item.AssetID;
taskItem.Name = item.inventoryName; taskItem.Name = item.Name;
taskItem.Description = item.inventoryDescription; taskItem.Description = item.Description;
taskItem.OwnerID = item.avatarID; taskItem.OwnerID = item.Owner;
taskItem.CreatorID = item.creatorsID; taskItem.CreatorID = item.Creator;
taskItem.Type = item.assetType; taskItem.Type = item.AssetType;
taskItem.InvType = item.invType; taskItem.InvType = item.InvType;
part.AddInventoryItem(taskItem); part.AddInventoryItem(taskItem);
return true; return true;

View File

@ -303,7 +303,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID);
if (baseItem != null) if (baseItem != null)
{ {
assetId = baseItem.assetID; assetId = baseItem.AssetID;
avatAppearance.Wearables[wear.Type].AssetID = assetId; avatAppearance.Wearables[wear.Type].AssetID = assetId;
avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID;