more refactoring, this time on InventoryFolderBase

* wrap attributes in properties
 * clean up names a little bit
 * clean up name styles
0.6.0-stable
Sean Dague 2008-04-07 23:27:05 +00:00
parent f436815107
commit 5ee75998ce
20 changed files with 348 additions and 294 deletions

View File

@ -370,12 +370,12 @@ namespace OpenSim.Data.MSSQL
try
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.agentID = new LLUUID((string) reader["agentID"]);
folder.parentID = new LLUUID((string) reader["parentFolderID"]);
folder.folderID = new LLUUID((string) reader["folderID"]);
folder.name = (string) reader["folderName"];
folder.type = (short) reader["type"];
folder.version = (ushort) ((int) reader["version"]);
folder.AgentID = new LLUUID((string) reader["agentID"]);
folder.ParentID = new LLUUID((string) reader["parentFolderID"]);
folder.ID = new LLUUID((string) reader["folderID"]);
folder.Name = (string) reader["folderName"];
folder.Type = (short) reader["type"];
folder.Version = (ushort) ((int) reader["version"]);
return folder;
}
catch (Exception e)
@ -557,12 +557,12 @@ namespace OpenSim.Data.MSSQL
Dictionary<string, string> param = new Dictionary<string, string>();
param["folderID"] = folder.folderID.ToString();
param["agentID"] = folder.agentID.ToString();
param["parentFolderID"] = folder.parentID.ToString();
param["folderName"] = folder.name;
param["type"] = Convert.ToString(folder.type);
param["version"] = Convert.ToString(folder.version);
param["folderID"] = folder.ID.ToString();
param["agentID"] = folder.AgentID.ToString();
param["parentFolderID"] = folder.ParentID.ToString();
param["folderName"] = folder.Name;
param["type"] = Convert.ToString(folder.Type);
param["version"] = Convert.ToString(folder.Version);
try
{
@ -589,13 +589,13 @@ namespace OpenSim.Data.MSSQL
"type = @type," +
"version = @version where " +
"folderID = @keyFolderID;", database.getConnection());
SqlParameter param1 = new SqlParameter("@folderID", folder.folderID.ToString());
SqlParameter param2 = new SqlParameter("@agentID", folder.agentID.ToString());
SqlParameter param3 = new SqlParameter("@parentFolderID", folder.parentID.ToString());
SqlParameter param4 = new SqlParameter("@folderName", folder.name);
SqlParameter param5 = new SqlParameter("@type", folder.type);
SqlParameter param6 = new SqlParameter("@version", folder.version);
SqlParameter param7 = new SqlParameter("@keyFolderID", folder.folderID.ToString());
SqlParameter param1 = new SqlParameter("@folderID", folder.ID.ToString());
SqlParameter param2 = new SqlParameter("@agentID", folder.AgentID.ToString());
SqlParameter param3 = new SqlParameter("@parentFolderID", folder.ParentID.ToString());
SqlParameter param4 = new SqlParameter("@folderName", folder.Name);
SqlParameter param5 = new SqlParameter("@type", folder.Type);
SqlParameter param6 = new SqlParameter("@version", folder.Version);
SqlParameter param7 = new SqlParameter("@keyFolderID", folder.ID.ToString());
command.Parameters.Add(param1);
command.Parameters.Add(param2);
command.Parameters.Add(param3);
@ -623,9 +623,9 @@ namespace OpenSim.Data.MSSQL
SqlCommand command = new SqlCommand("UPDATE inventoryfolders set folderID = @folderID, " +
"parentFolderID = @parentFolderID," +
"folderID = @keyFolderID;", database.getConnection());
SqlParameter param1 = new SqlParameter("@folderID", folder.folderID.ToString());
SqlParameter param2 = new SqlParameter("@parentFolderID", folder.parentID.ToString());
SqlParameter param3 = new SqlParameter("@keyFolderID", folder.folderID.ToString());
SqlParameter param1 = new SqlParameter("@folderID", folder.ID.ToString());
SqlParameter param2 = new SqlParameter("@parentFolderID", folder.ParentID.ToString());
SqlParameter param3 = new SqlParameter("@keyFolderID", folder.ID.ToString());
command.Parameters.Add(param1);
command.Parameters.Add(param2);
command.Parameters.Add(param3);
@ -660,7 +660,7 @@ namespace OpenSim.Data.MSSQL
getInventoryFolders(ref folders, parentID);
for (int i = 0; i < folders.Count; i++)
getInventoryFolders(ref folders, folders[i].folderID);
getInventoryFolders(ref folders, folders[i].ID);
return folders;
}
@ -716,8 +716,8 @@ namespace OpenSim.Data.MSSQL
//Delete all sub-folders
foreach (InventoryFolderBase f in subFolders)
{
deleteOneFolder(f.folderID);
deleteItemsInFolder(f.folderID);
deleteOneFolder(f.ID);
deleteItemsInFolder(f.ID);
}
//Delete the actual row

View File

@ -381,12 +381,12 @@ namespace OpenSim.Data.MySQL
try
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.agentID = new LLUUID((string) reader["agentID"]);
folder.parentID = new LLUUID((string) reader["parentFolderID"]);
folder.folderID = new LLUUID((string) reader["folderID"]);
folder.name = (string) reader["folderName"];
folder.type = (short) reader["type"];
folder.version = (ushort) ((int) reader["version"]);
folder.AgentID = new LLUUID((string) reader["agentID"]);
folder.ParentID = new LLUUID((string) reader["parentFolderID"]);
folder.ID = new LLUUID((string) reader["folderID"]);
folder.Name = (string) reader["folderName"];
folder.Type = (short) reader["type"];
folder.Version = (ushort) ((int) reader["version"]);
return folder;
}
catch (Exception e)
@ -507,12 +507,12 @@ namespace OpenSim.Data.MySQL
sql += "(?folderID, ?agentID, ?parentFolderID, ?folderName, ?type, ?version)";
MySqlCommand cmd = new MySqlCommand(sql, database.Connection);
cmd.Parameters.AddWithValue("?folderID", folder.folderID.ToString());
cmd.Parameters.AddWithValue("?agentID", folder.agentID.ToString());
cmd.Parameters.AddWithValue("?parentFolderID", folder.parentID.ToString());
cmd.Parameters.AddWithValue("?folderName", folder.name);
cmd.Parameters.AddWithValue("?type", (short) folder.type);
cmd.Parameters.AddWithValue("?version", folder.version);
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
cmd.Parameters.AddWithValue("?agentID", folder.AgentID.ToString());
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
cmd.Parameters.AddWithValue("?folderName", folder.Name);
cmd.Parameters.AddWithValue("?type", (short) folder.Type);
cmd.Parameters.AddWithValue("?version", folder.Version);
try
{
@ -545,8 +545,8 @@ namespace OpenSim.Data.MySQL
"UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID";
MySqlCommand cmd = new MySqlCommand(sql, database.Connection);
cmd.Parameters.AddWithValue("?folderID", folder.folderID.ToString());
cmd.Parameters.AddWithValue("?parentFolderID", folder.parentID.ToString());
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
try
{
@ -581,7 +581,7 @@ namespace OpenSim.Data.MySQL
getInventoryFolders(ref folders, parentID);
for (int i = 0; i < folders.Count; i++)
getInventoryFolders(ref folders, folders[i].folderID);
getInventoryFolders(ref folders, folders[i].ID);
return folders;
}
@ -637,8 +637,8 @@ namespace OpenSim.Data.MySQL
//Delete all sub-folders
foreach (InventoryFolderBase f in subFolders)
{
deleteOneFolder(f.folderID);
deleteItemsInFolder(f.folderID);
deleteOneFolder(f.ID);
deleteItemsInFolder(f.ID);
}
//Delete the actual row

View File

@ -180,7 +180,7 @@ namespace OpenSim.Data.NHibernate
/// <param name="folder">The folder to be created</param>
public void addInventoryFolder(InventoryFolderBase folder)
{
if (!ExistsFolder(folder.folderID)) {
if (!ExistsFolder(folder.ID)) {
using(ISession session = factory.OpenSession()) {
using(ITransaction transaction = session.BeginTransaction()) {
session.Save(folder);
@ -188,7 +188,7 @@ namespace OpenSim.Data.NHibernate
}
}
} else {
m_log.ErrorFormat("Attempted to add Inventory Folder {0} that already exists, updating instead", folder.folderID);
m_log.ErrorFormat("Attempted to add Inventory Folder {0} that already exists, updating instead", folder.ID);
updateInventoryFolder(folder);
}
}
@ -199,7 +199,7 @@ namespace OpenSim.Data.NHibernate
/// <param name="folder">The updated folder</param>
public void updateInventoryFolder(InventoryFolderBase folder)
{
if (ExistsFolder(folder.folderID)) {
if (ExistsFolder(folder.ID)) {
using(ISession session = factory.OpenSession()) {
using(ITransaction transaction = session.BeginTransaction()) {
session.Update(folder);
@ -207,7 +207,7 @@ namespace OpenSim.Data.NHibernate
}
}
} else {
m_log.ErrorFormat("Attempted to add Inventory Folder {0} that already exists", folder.folderID);
m_log.ErrorFormat("Attempted to add Inventory Folder {0} that already exists", folder.ID);
}
}
@ -375,7 +375,7 @@ namespace OpenSim.Data.NHibernate
getInventoryFolders(ref folders, Util.ToRawUuidString(parentID));
for (int i = 0; i < folders.Count; i++)
getInventoryFolders(ref folders, Util.ToRawUuidString(folders[i].folderID));
getInventoryFolders(ref folders, Util.ToRawUuidString(folders[i].ID));
return folders;
}

View File

@ -132,11 +132,11 @@ namespace OpenSim.Data.SQLite
{
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
DataRow inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(folder.folderID));
DataRow inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(folder.ID));
if (inventoryRow == null)
{
if (! add)
m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory folder: {0}", folder.folderID);
m_log.ErrorFormat("Interface Misuse: Attempting to Update non-existant inventory folder: {0}", folder.ID);
inventoryRow = inventoryFolderTable.NewRow();
fillFolderRow(inventoryRow, folder);
@ -145,7 +145,7 @@ namespace OpenSim.Data.SQLite
else
{
if (add)
m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory folder that already exists: {0}", folder.folderID);
m_log.ErrorFormat("Interface Misuse: Attempting to Add inventory folder that already exists: {0}", folder.ID);
fillFolderRow(inventoryRow, folder);
}
@ -160,7 +160,7 @@ namespace OpenSim.Data.SQLite
{
DataTable inventoryFolderTable = ds.Tables["inventoryfolders"];
DataRow inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(folder.folderID));
DataRow inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(folder.ID));
if (inventoryRow == null)
{
inventoryRow = inventoryFolderTable.NewRow();
@ -339,7 +339,7 @@ namespace OpenSim.Data.SQLite
getInventoryFolders(ref folders, Util.ToRawUuidString(parentID));
for (int i = 0; i < folders.Count; i++)
getInventoryFolders(ref folders, Util.ToRawUuidString(folders[i].folderID));
getInventoryFolders(ref folders, Util.ToRawUuidString(folders[i].ID));
return folders;
}
@ -488,10 +488,10 @@ namespace OpenSim.Data.SQLite
//Delete all sub-folders
foreach (InventoryFolderBase f in subFolders)
{
inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(f.folderID));
inventoryRow = inventoryFolderTable.Rows.Find(Util.ToRawUuidString(f.ID));
if (inventoryRow != null)
{
deleteItemsInFolder(Util.ToRawUuidString(f.folderID));
deleteItemsInFolder(Util.ToRawUuidString(f.ID));
inventoryRow.Delete();
}
}
@ -590,29 +590,29 @@ namespace OpenSim.Data.SQLite
private InventoryFolderBase buildFolder(DataRow row)
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.folderID = new LLUUID((string) row["UUID"]);
folder.name = (string) row["name"];
folder.agentID = new LLUUID((string) row["agentID"]);
folder.parentID = new LLUUID((string) row["parentID"]);
folder.type = Convert.ToInt16(row["type"]);
folder.version = Convert.ToUInt16(row["version"]);
folder.ID = new LLUUID((string) row["UUID"]);
folder.Name = (string) row["name"];
folder.AgentID = new LLUUID((string) row["agentID"]);
folder.ParentID = new LLUUID((string) row["parentID"]);
folder.Type = Convert.ToInt16(row["type"]);
folder.Version = Convert.ToUInt16(row["version"]);
return folder;
}
private void fillFolderRow(DataRow row, InventoryFolderBase folder)
{
row["UUID"] = Util.ToRawUuidString(folder.folderID);
row["name"] = folder.name;
row["agentID"] = Util.ToRawUuidString(folder.agentID);
row["parentID"] = Util.ToRawUuidString(folder.parentID);
row["type"] = folder.type;
row["version"] = folder.version;
row["UUID"] = Util.ToRawUuidString(folder.ID);
row["name"] = folder.Name;
row["agentID"] = Util.ToRawUuidString(folder.AgentID);
row["parentID"] = Util.ToRawUuidString(folder.ParentID);
row["type"] = folder.Type;
row["version"] = folder.Version;
}
private void moveFolderRow(DataRow row, InventoryFolderBase folder)
{
row["UUID"] = Util.ToRawUuidString(folder.folderID);
row["parentID"] = Util.ToRawUuidString(folder.parentID);
row["UUID"] = Util.ToRawUuidString(folder.ID);
row["parentID"] = Util.ToRawUuidString(folder.ParentID);
}
/***********************************************************************

View File

@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="folder"></param>
private void AddPendingFolder(InventoryFolderImpl folder)
{
LLUUID parentFolderId = folder.parentID;
LLUUID parentFolderId = folder.ParentID;
if (pendingCategorizationFolders.ContainsKey(parentFolderId))
{
@ -83,17 +83,17 @@ namespace OpenSim.Framework.Communications.Cache
/// </param>
private void ResolvePendingFolders(InventoryFolderImpl parent)
{
if (pendingCategorizationFolders.ContainsKey(parent.folderID))
if (pendingCategorizationFolders.ContainsKey(parent.ID))
{
foreach (InventoryFolderImpl folder in pendingCategorizationFolders[parent.folderID])
foreach (InventoryFolderImpl folder in pendingCategorizationFolders[parent.ID])
{
// m_log.DebugFormat(
// "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}",
// folder.name, folder.folderID, parent.name, parent.folderID);
if (!parent.SubFolders.ContainsKey(folder.folderID))
if (!parent.SubFolders.ContainsKey(folder.ID))
{
parent.SubFolders.Add(folder.folderID, folder);
parent.SubFolders.Add(folder.ID, folder);
}
}
}
@ -118,16 +118,16 @@ namespace OpenSim.Framework.Communications.Cache
{
if (RootFolder == null)
{
if (folderInfo.parentID == LLUUID.Zero)
if (folderInfo.ParentID == LLUUID.Zero)
{
RootFolder = folderInfo;
}
}
else if (RootFolder.folderID == folderInfo.parentID)
else if (RootFolder.ID == folderInfo.ParentID)
{
if (!RootFolder.SubFolders.ContainsKey(folderInfo.folderID))
if (!RootFolder.SubFolders.ContainsKey(folderInfo.ID))
{
RootFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
RootFolder.SubFolders.Add(folderInfo.ID, folderInfo);
}
else
{
@ -136,12 +136,12 @@ namespace OpenSim.Framework.Communications.Cache
}
else
{
InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.parentID);
InventoryFolderImpl folder = RootFolder.HasSubFolder(folderInfo.ParentID);
if (folder != null)
{
if (!folder.SubFolders.ContainsKey(folderInfo.folderID))
if (!folder.SubFolders.ContainsKey(folderInfo.ID))
{
folder.SubFolders.Add(folderInfo.folderID, folderInfo);
folder.SubFolders.Add(folderInfo.ID, folderInfo);
}
}
else
@ -171,7 +171,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if ((userID == UserProfile.UUID) && (RootFolder != null))
{
if (itemInfo.Folder == RootFolder.folderID)
if (itemInfo.Folder == RootFolder.ID)
{
if (!RootFolder.Items.ContainsKey(itemInfo.ID))
{

View File

@ -45,12 +45,12 @@ namespace OpenSim.Framework.Communications.Cache
// Constructors
public InventoryFolderImpl(InventoryFolderBase folderbase)
{
agentID = folderbase.agentID;
folderID = folderbase.folderID;
name = folderbase.name;
parentID = folderbase.parentID;
type = folderbase.type;
version = folderbase.version;
AgentID = folderbase.AgentID;
ID = folderbase.ID;
Name = folderbase.Name;
ParentID = folderbase.ParentID;
Type = folderbase.Type;
Version = folderbase.Version;
}
public InventoryFolderImpl()
@ -63,12 +63,12 @@ namespace OpenSim.Framework.Communications.Cache
if (!SubFolders.ContainsKey(folderID))
{
InventoryFolderImpl subFold = new InventoryFolderImpl();
subFold.name = folderName;
subFold.folderID = folderID;
subFold.type = (short) type;
subFold.parentID = this.folderID;
subFold.agentID = agentID;
SubFolders.Add(subFold.folderID, subFold);
subFold.Name = folderName;
subFold.ID = folderID;
subFold.Type = (short) type;
subFold.ParentID = this.ID;
subFold.AgentID = AgentID;
SubFolders.Add(subFold.ID, subFold);
return subFold;
}
return null;

View File

@ -56,14 +56,14 @@ namespace OpenSim.Framework.Communications.Cache
{
m_log.Info("[LIBRARY INVENTORY]: Loading library inventory");
agentID = libOwner;
folderID = new LLUUID("00000112-000f-0000-0000-000100bba000");
name = "OpenSim Library";
parentID = LLUUID.Zero;
type = (short) 8;
version = (ushort) 1;
AgentID = libOwner;
ID = new LLUUID("00000112-000f-0000-0000-000100bba000");
Name = "OpenSim Library";
ParentID = LLUUID.Zero;
Type = (short) 8;
Version = (ushort) 1;
libraryFolders.Add(folderID, this);
libraryFolders.Add(ID, this);
LoadLibraries(Path.Combine(Util.inventoryDir(), "Libraries.xml"));
@ -172,20 +172,20 @@ namespace OpenSim.Framework.Communications.Cache
{
InventoryFolderImpl folderInfo = new InventoryFolderImpl();
folderInfo.folderID = new LLUUID(config.GetString("folderID", folderID.ToString()));
folderInfo.name = config.GetString("name", "unknown");
folderInfo.parentID = new LLUUID(config.GetString("parentFolderID", folderID.ToString()));
folderInfo.type = (short)config.GetInt("type", 8);
folderInfo.ID = new LLUUID(config.GetString("folderID", ID.ToString()));
folderInfo.Name = config.GetString("name", "unknown");
folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString()));
folderInfo.Type = (short)config.GetInt("type", 8);
folderInfo.agentID = libOwner;
folderInfo.version = 1;
folderInfo.AgentID = libOwner;
folderInfo.Version = 1;
if (libraryFolders.ContainsKey(folderInfo.parentID))
if (libraryFolders.ContainsKey(folderInfo.ParentID))
{
InventoryFolderImpl parentFolder = libraryFolders[folderInfo.parentID];
InventoryFolderImpl parentFolder = libraryFolders[folderInfo.ParentID];
libraryFolders.Add(folderInfo.folderID, folderInfo);
parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
libraryFolders.Add(folderInfo.ID, folderInfo);
parentFolder.SubFolders.Add(folderInfo.ID, folderInfo);
// m_log.InfoFormat("[LIBRARY INVENTORY]: Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID);
}
@ -193,7 +193,7 @@ namespace OpenSim.Framework.Communications.Cache
{
m_log.WarnFormat(
"[LIBRARY INVENTORY]: Couldn't add folder {0} ({1}) since parent folder with ID {2} does not exist!",
folderInfo.name, folderInfo.folderID, folderInfo.parentID);
folderInfo.Name, folderInfo.ID, folderInfo.ParentID);
}
}
@ -206,9 +206,9 @@ namespace OpenSim.Framework.Communications.Cache
InventoryItemBase item = new InventoryItemBase();
item.Owner = libOwner;
item.Creator = libOwner;
item.ID = new LLUUID(config.GetString("inventoryID", folderID.ToString()));
item.ID = new LLUUID(config.GetString("inventoryID", ID.ToString()));
item.AssetID = new LLUUID(config.GetString("assetID", LLUUID.Random().ToString()));
item.Folder = new LLUUID(config.GetString("folderID", folderID.ToString()));
item.Folder = new LLUUID(config.GetString("folderID", ID.ToString()));
item.Description = config.GetString("description", System.String.Empty);
item.Name = config.GetString("name", System.String.Empty);
item.AssetType = config.GetInt("assetType", 0);

View File

@ -105,7 +105,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if (userProfile.RootFolder != null)
{
if (userProfile.RootFolder.folderID == parentID)
if (userProfile.RootFolder.ID == parentID)
{
InventoryFolderImpl createdFolder =
userProfile.RootFolder.CreateNewSubFolder(folderID, folderName, folderType);
@ -113,12 +113,12 @@ namespace OpenSim.Framework.Communications.Cache
if (createdFolder != null)
{
InventoryFolderBase createdBaseFolder = new InventoryFolderBase();
createdBaseFolder.agentID = createdFolder.agentID;
createdBaseFolder.folderID = createdFolder.folderID;
createdBaseFolder.name = createdFolder.name;
createdBaseFolder.parentID = createdFolder.parentID;
createdBaseFolder.type = createdFolder.type;
createdBaseFolder.version = createdFolder.version;
createdBaseFolder.AgentID = createdFolder.AgentID;
createdBaseFolder.ID = createdFolder.ID;
createdBaseFolder.Name = createdFolder.Name;
createdBaseFolder.ParentID = createdFolder.ParentID;
createdBaseFolder.Type = createdFolder.Type;
createdBaseFolder.Version = createdFolder.Version;
m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, createdBaseFolder);
}
}
@ -156,12 +156,12 @@ namespace OpenSim.Framework.Communications.Cache
if (userProfile.RootFolder != null)
{
InventoryFolderBase baseFolder = new InventoryFolderBase();
baseFolder.agentID = remoteClient.AgentId;
baseFolder.folderID = folderID;
baseFolder.name = name;
baseFolder.parentID = parentID;
baseFolder.type = (short) type;
baseFolder.version = userProfile.RootFolder.version;
baseFolder.AgentID = remoteClient.AgentId;
baseFolder.ID = folderID;
baseFolder.Name = name;
baseFolder.ParentID = parentID;
baseFolder.Type = (short) type;
baseFolder.Version = userProfile.RootFolder.Version;
m_parent.InventoryService.AddNewInventoryFolder(remoteClient.AgentId, baseFolder);
}
}
@ -176,9 +176,9 @@ namespace OpenSim.Framework.Communications.Cache
if (userProfile.RootFolder != null)
{
InventoryFolderBase baseFolder = new InventoryFolderBase();
baseFolder.agentID = remoteClient.AgentId;
baseFolder.folderID = folderID;
baseFolder.parentID = parentID;
baseFolder.AgentID = remoteClient.AgentId;
baseFolder.ID = folderID;
baseFolder.ParentID = parentID;
m_parent.InventoryService.MoveInventoryFolder(remoteClient.AgentId, baseFolder);
}
}
@ -199,10 +199,10 @@ namespace OpenSim.Framework.Communications.Cache
// XXX We're not handling sortOrder yet!
InventoryFolderImpl fold = null;
if (folderID == libraryRoot.folderID)
if (folderID == libraryRoot.ID)
{
remoteClient.SendInventoryFolderDetails(
libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(),
libraryRoot.AgentID, libraryRoot.ID, libraryRoot.RequestListOfItems(),
libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems);
return;
@ -211,7 +211,7 @@ namespace OpenSim.Framework.Communications.Cache
if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
{
remoteClient.SendInventoryFolderDetails(
libraryRoot.agentID, folderID, fold.RequestListOfItems(),
libraryRoot.AgentID, folderID, fold.RequestListOfItems(),
fold.RequestListOfFolders(), fetchFolders, fetchItems);
return;
@ -242,7 +242,7 @@ namespace OpenSim.Framework.Communications.Cache
if (userProfile.RootFolder != null)
{
if (userProfile.RootFolder.folderID == folderID)
if (userProfile.RootFolder.ID == folderID)
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Found root folder {0} for client {1}",
@ -301,7 +301,7 @@ namespace OpenSim.Framework.Communications.Cache
// if (fetchItems)
// {
InventoryFolderImpl fold = null;
if (folderID == libraryRoot.folderID)
if (folderID == libraryRoot.ID)
{
return libraryRoot.RequestListOfItems();
}
@ -316,7 +316,7 @@ namespace OpenSim.Framework.Communications.Cache
{
if (userProfile.RootFolder != null)
{
if (userProfile.RootFolder.folderID == folderID)
if (userProfile.RootFolder.ID == folderID)
{
return userProfile.RootFolder.RequestListOfItems();
}
@ -377,7 +377,7 @@ namespace OpenSim.Framework.Communications.Cache
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
{
if (ownerID == libraryRoot.agentID)
if (ownerID == libraryRoot.AgentID)
{
//Console.WriteLine("request info for library item");

View File

@ -240,7 +240,7 @@ namespace OpenSim.Framework.Communications
public void HandleUUIDNameRequest(LLUUID uuid, IClientAPI remote_client)
{
if (uuid == m_userProfileCacheService.libraryRoot.agentID)
if (uuid == m_userProfileCacheService.libraryRoot.AgentID)
{
remote_client.SendNameReply(uuid, "Mr", "OpenSim");
}

View File

@ -95,7 +95,7 @@ namespace OpenSim.Framework.Communications
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.folderID);
IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.ID);
userFolders.AddRange(folders);
}
@ -190,7 +190,7 @@ namespace OpenSim.Framework.Communications
protected void AddFolder(InventoryFolderBase folder)
{
m_log.DebugFormat(
"[INVENTORY SERVICE BASE]: Adding folder {0}, {1} to {2}", folder.name, folder.folderID, folder.parentID);
"[INVENTORY SERVICE BASE]: Adding folder {0}, {1} to {2}", folder.Name, folder.ID, folder.ParentID);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
@ -239,141 +239,141 @@ namespace OpenSim.Framework.Communications
{
InventoryFolderBase folder = new InventoryFolderBase();
folder.parentID = LLUUID.Zero;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "My Inventory";
folder.type = (short)AssetType.Folder;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = LLUUID.Zero;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "My Inventory";
folder.Type = (short)AssetType.Folder;
folder.Version = 1;
Folders.Add(folder.ID, folder);
LLUUID rootFolder = folder.folderID;
LLUUID rootFolder = folder.ID;
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Animations";
folder.type = (short)AssetType.Animation;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Animations";
folder.Type = (short)AssetType.Animation;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Body Parts";
folder.type = (short)AssetType.Bodypart;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Body Parts";
folder.Type = (short)AssetType.Bodypart;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Calling Cards";
folder.type = (short)AssetType.CallingCard;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Calling Cards";
folder.Type = (short)AssetType.CallingCard;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Clothing";
folder.type = (short)AssetType.Clothing;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Clothing";
folder.Type = (short)AssetType.Clothing;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Gestures";
folder.type = (short)AssetType.Gesture;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Gestures";
folder.Type = (short)AssetType.Gesture;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Landmarks";
folder.type = (short)AssetType.Landmark;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Landmarks";
folder.Type = (short)AssetType.Landmark;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Lost And Found";
folder.type = (short)AssetType.LostAndFoundFolder;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Lost And Found";
folder.Type = (short)AssetType.LostAndFoundFolder;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Notecards";
folder.type = (short)AssetType.Notecard;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Notecards";
folder.Type = (short)AssetType.Notecard;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Objects";
folder.type = (short)AssetType.Primitive;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Objects";
folder.Type = (short)AssetType.Primitive;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Photo Album";
folder.type = (short)AssetType.SnapshotFolder;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Photo Album";
folder.Type = (short)AssetType.SnapshotFolder;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Scripts";
folder.type = (short)AssetType.LSLText;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Scripts";
folder.Type = (short)AssetType.LSLText;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Sounds";
folder.type = (short)AssetType.Sound;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Sounds";
folder.Type = (short)AssetType.Sound;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Textures";
folder.type = (short)AssetType.Texture;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Textures";
folder.Type = (short)AssetType.Texture;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.parentID = rootFolder;
folder.agentID = user;
folder.folderID = LLUUID.Random();
folder.name = "Trash";
folder.type = (short)AssetType.TrashFolder;
folder.version = 1;
Folders.Add(folder.folderID, folder);
folder.ParentID = rootFolder;
folder.AgentID = user;
folder.ID = LLUUID.Random();
folder.Name = "Trash";
folder.Type = (short)AssetType.TrashFolder;
folder.Version = 1;
Folders.Add(folder.ID, folder);
}
}
}

View File

@ -734,11 +734,11 @@ namespace OpenSim.Framework.UserManagement
foreach (InventoryFolderBase folder in rootFolders.Values)
{
Hashtable TempHash = new Hashtable();
TempHash["name"] = folder.name;
TempHash["parent_id"] = folder.parentID.ToString();
TempHash["version"] = (Int32)folder.version;
TempHash["type_default"] = (Int32)folder.type;
TempHash["folder_id"] = folder.folderID.ToString();
TempHash["name"] = folder.Name;
TempHash["parent_id"] = folder.ParentID.ToString();
TempHash["version"] = (Int32)folder.Version;
TempHash["type_default"] = (Int32)folder.Type;
TempHash["folder_id"] = folder.ID.ToString();
folderHashes.Add(TempHash);
}

View File

@ -40,31 +40,85 @@ namespace OpenSim.Framework
/// <summary>
/// The name of the folder (64 characters or less)
/// </summary>
public string name;
private string _name;
/// <summary>
/// The agent who's inventory this is contained by
/// </summary>
public LLUUID agentID;
private LLUUID _agentID;
/// <summary>
/// The folder this folder is contained in
/// </summary>
public LLUUID parentID;
private LLUUID _parentID;
/// <summary>
/// The UUID for this folder
/// </summary>
public LLUUID folderID;
private LLUUID _id;
/// <summary>
/// Type of items normally stored in this folder
/// </summary>
public short type;
private short _type;
/// <summary>
///
/// </summary>
public ushort version;
private ushort _version;
public string Name {
get {
return _name;
}
set {
_name = value;
}
}
public LLUUID AgentID {
get {
return _agentID;
}
set {
_agentID = value;
}
}
public LLUUID ParentID {
get {
return _parentID;
}
set {
_parentID = value;
}
}
public LLUUID ID {
get {
return _id;
}
set {
_id = value;
}
}
public short Type {
get {
return _type;
}
set {
_type = value;
}
}
public ushort Version {
get {
return _version;
}
set {
_version = value;
}
}
}
}

View File

@ -51,7 +51,7 @@ namespace OpenSim.Grid.InventoryServer
foreach (InventoryFolderBase folder in allFolders)
{
List<InventoryItemBase> items = RequestFolderItems(folder.folderID);
List<InventoryItemBase> items = RequestFolderItems(folder.ID);
if (items != null)
{
allItems.InsertRange(0, items);
@ -79,7 +79,7 @@ namespace OpenSim.Grid.InventoryServer
allFolders.InsertRange(0, folders);
foreach (InventoryFolderBase subfolder in folders)
{
List<InventoryFolderBase> subFolders = GetAllFolders(subfolder.folderID);
List<InventoryFolderBase> subFolders = GetAllFolders(subfolder.ID);
if (subFolders != null)
{
allFolders.InsertRange(0, subFolders);
@ -166,10 +166,10 @@ namespace OpenSim.Grid.InventoryServer
// Right now, this actions act more like an update/insert combination than a simple create.
m_log.Info(
"[AGENT INVENTORY]: " +
"Updating in " + folder.parentID.ToString()
+ ", folder " + folder.name);
"Updating in " + folder.ParentID.ToString()
+ ", folder " + folder.Name);
AddNewInventoryFolder(folder.agentID, folder);
AddNewInventoryFolder(folder.AgentID, folder);
return true;
}
@ -177,8 +177,8 @@ namespace OpenSim.Grid.InventoryServer
{
m_log.Info(
"[AGENT INVENTORY]: " +
"Moving folder " + folder.folderID
+ " to " + folder.parentID.ToString());
"Moving folder " + folder.ID
+ " to " + folder.ParentID.ToString());
MoveExistingInventoryFolder(folder);
return true;

View File

@ -104,25 +104,25 @@ namespace OpenSim.Grid.InventoryServer
bool modified = false;
// ensure we have a valid folder id
if (f.folderID == LLUUID.Zero)
if (f.ID == LLUUID.Zero)
{
f.folderID = LLUUID.Random();
f.ID = LLUUID.Random();
modified = true;
}
// ensure we have valid agent id
if (f.agentID == LLUUID.Zero)
if (f.AgentID == LLUUID.Zero)
{
if (parent != null)
f.agentID = parent.agentID;
f.AgentID = parent.AgentID;
else
f.agentID = f.folderID;
f.AgentID = f.ID;
modified = true;
}
if (f.parentID == LLUUID.Zero && parent != null)
if (f.ParentID == LLUUID.Zero && parent != null)
{
f.parentID = parent.folderID;
f.ParentID = parent.ID;
modified = true;
}

View File

@ -325,16 +325,16 @@ namespace OpenSim.Grid.UserServer
{
// m_log.DebugFormat("[LOGIN]: Received agent inventory folder {0}", InvFolder.name);
if (InvFolder.parentID == LLUUID.Zero)
if (InvFolder.ParentID == LLUUID.Zero)
{
rootID = InvFolder.folderID;
rootID = InvFolder.ID;
}
TempHash = new Hashtable();
TempHash["name"] = InvFolder.name;
TempHash["parent_id"] = InvFolder.parentID.ToString();
TempHash["version"] = (Int32) InvFolder.version;
TempHash["type_default"] = (Int32) InvFolder.type;
TempHash["folder_id"] = InvFolder.folderID.ToString();
TempHash["name"] = InvFolder.Name;
TempHash["parent_id"] = InvFolder.ParentID.ToString();
TempHash["version"] = (Int32) InvFolder.Version;
TempHash["type_default"] = (Int32) InvFolder.Type;
TempHash["folder_id"] = InvFolder.ID.ToString();
AgentInventoryArray.Add(TempHash);
}
return new InventoryData(AgentInventoryArray, rootID);

View File

@ -1307,10 +1307,10 @@ namespace OpenSim.Region.ClientStack
foreach (InventoryFolderBase folder in folders)
{
descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
descend.FolderData[i].FolderID = folder.folderID;
descend.FolderData[i].Name = Helpers.StringToField(folder.name);
descend.FolderData[i].ParentID = folder.parentID;
descend.FolderData[i].Type = (sbyte) folder.type;
descend.FolderData[i].FolderID = folder.ID;
descend.FolderData[i].Name = Helpers.StringToField(folder.Name);
descend.FolderData[i].ParentID = folder.ParentID;
descend.FolderData[i].Type = (sbyte) folder.Type;
i++;
count++;

View File

@ -49,7 +49,7 @@ namespace OpenSim.Region.Communications.Local
//need to make sure we send root folder first
foreach (InventoryFolderBase folder in folders)
{
if (folder.parentID == LLUUID.Zero)
if (folder.ParentID == LLUUID.Zero)
{
rootFolder = RequestInventoryFolder(userID, folder, folderCallBack, itemCallBack);
}
@ -59,7 +59,7 @@ namespace OpenSim.Region.Communications.Local
{
foreach (InventoryFolderBase folder in folders)
{
if (folder.folderID != rootFolder.folderID)
if (folder.ID != rootFolder.ID)
{
RequestInventoryFolder(userID, folder, folderCallBack, itemCallBack);
}
@ -112,7 +112,7 @@ namespace OpenSim.Region.Communications.Local
InventoryFolderImpl newFolder = new InventoryFolderImpl(folder);
folderCallBack(userID, newFolder);
List<InventoryItemBase> items = RequestFolderItems(newFolder.folderID);
List<InventoryItemBase> items = RequestFolderItems(newFolder.ID);
foreach (InventoryItemBase item in items)
{
itemCallBack(userID, item);

View File

@ -229,16 +229,16 @@ namespace OpenSim.Region.Communications.Local
Hashtable TempHash;
foreach (InventoryFolderBase InvFolder in folders)
{
if (InvFolder.parentID == LLUUID.Zero)
if (InvFolder.ParentID == LLUUID.Zero)
{
rootID = InvFolder.folderID;
rootID = InvFolder.ID;
}
TempHash = new Hashtable();
TempHash["name"] = InvFolder.name;
TempHash["parent_id"] = InvFolder.parentID.ToString();
TempHash["version"] = (Int32) InvFolder.version;
TempHash["type_default"] = (Int32) InvFolder.type;
TempHash["folder_id"] = InvFolder.folderID.ToString();
TempHash["name"] = InvFolder.Name;
TempHash["parent_id"] = InvFolder.ParentID.ToString();
TempHash["version"] = (Int32) InvFolder.Version;
TempHash["type_default"] = (Int32) InvFolder.Type;
TempHash["folder_id"] = InvFolder.ID.ToString();
AgentInventoryArray.Add(TempHash);
}

View File

@ -107,7 +107,7 @@ namespace OpenSim.Region.Communications.OGS1
InventoryRequest request = m_RequestingInventory[userID];
foreach (InventoryFolderBase folder in response.Folders)
{
if (folder.parentID == LLUUID.Zero)
if (folder.ParentID == LLUUID.Zero)
{
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
rootFolder = newfolder;
@ -119,7 +119,7 @@ namespace OpenSim.Region.Communications.OGS1
{
foreach (InventoryFolderBase folder in response.Folders)
{
if (folder.folderID != rootFolder.folderID)
if (folder.ID != rootFolder.ID)
{
InventoryFolderImpl newfolder = new InventoryFolderImpl(folder);
request.FolderCallBack(userID, newfolder);

View File

@ -327,7 +327,7 @@ namespace OpenSim.Region.Environment.Scenes
itemCopy.Name = item.Name;
itemCopy.AssetType = item.AssetType;
itemCopy.InvType = item.InvType;
itemCopy.Folder = recipientUserInfo.RootFolder.folderID;
itemCopy.Folder = recipientUserInfo.RootFolder.ID;
itemCopy.CurrentPermissions = 2147483647;
itemCopy.NextPermissions = 2147483647;
itemCopy.EveryOnePermissions = item.EveryOnePermissions;