From a6d27e09295cd0160d3439fbfa6598f08c431608 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 8 Apr 2008 23:26:31 +0000 Subject: further refactor and rename of InventoryFolderBase properties to reflect what they really are. --- OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 6 ++--- OpenSim/Data/MySQL/MySQLInventoryData.cs | 4 +-- OpenSim/Data/NHibernate/NHibernateInventoryData.cs | 8 +++--- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 4 +-- .../Communications/Cache/InventoryFolderImpl.cs | 4 +-- .../Communications/Cache/LibraryRootFolder.cs | 4 +-- .../Cache/UserProfileCacheService.cs | 12 ++++----- .../Communications/CommunicationsManager.cs | 2 +- .../Communications/InventoryServiceBase.cs | 30 +++++++++++----------- OpenSim/Framework/InventoryFolderBase.cs | 8 +++--- .../Grid/InventoryServer/GridInventoryService.cs | 2 +- OpenSim/Grid/InventoryServer/InventoryManager.cs | 6 ++--- 12 files changed, 45 insertions(+), 45 deletions(-) diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs index f53d9f9..09d4710 100644 --- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs @@ -370,7 +370,7 @@ namespace OpenSim.Data.MSSQL try { InventoryFolderBase folder = new InventoryFolderBase(); - folder.AgentID = new LLUUID((string) reader["agentID"]); + folder.Owner = new LLUUID((string) reader["agentID"]); folder.ParentID = new LLUUID((string) reader["parentFolderID"]); folder.ID = new LLUUID((string) reader["folderID"]); folder.Name = (string) reader["folderName"]; @@ -558,7 +558,7 @@ namespace OpenSim.Data.MSSQL Dictionary param = new Dictionary(); param["folderID"] = folder.ID.ToString(); - param["agentID"] = folder.AgentID.ToString(); + param["agentID"] = folder.Owner.ToString(); param["parentFolderID"] = folder.ParentID.ToString(); param["folderName"] = folder.Name; param["type"] = Convert.ToString(folder.Type); @@ -590,7 +590,7 @@ namespace OpenSim.Data.MSSQL "version = @version where " + "folderID = @keyFolderID;", database.getConnection()); SqlParameter param1 = new SqlParameter("@folderID", folder.ID.ToString()); - SqlParameter param2 = new SqlParameter("@agentID", folder.AgentID.ToString()); + SqlParameter param2 = new SqlParameter("@agentID", folder.Owner.ToString()); SqlParameter param3 = new SqlParameter("@parentFolderID", folder.ParentID.ToString()); SqlParameter param4 = new SqlParameter("@folderName", folder.Name); SqlParameter param5 = new SqlParameter("@type", folder.Type); diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 6cc8998..ce9829a 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -381,7 +381,7 @@ namespace OpenSim.Data.MySQL try { InventoryFolderBase folder = new InventoryFolderBase(); - folder.AgentID = new LLUUID((string) reader["agentID"]); + folder.Owner = new LLUUID((string) reader["agentID"]); folder.ParentID = new LLUUID((string) reader["parentFolderID"]); folder.ID = new LLUUID((string) reader["folderID"]); folder.Name = (string) reader["folderName"]; @@ -508,7 +508,7 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand(sql, database.Connection); cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString()); - cmd.Parameters.AddWithValue("?agentID", folder.AgentID.ToString()); + cmd.Parameters.AddWithValue("?agentID", folder.Owner.ToString()); cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString()); cmd.Parameters.AddWithValue("?folderName", folder.Name); cmd.Parameters.AddWithValue("?type", (short) folder.Type); diff --git a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs index 6bc2e62..9e35b76 100644 --- a/OpenSim/Data/NHibernate/NHibernateInventoryData.cs +++ b/OpenSim/Data/NHibernate/NHibernateInventoryData.cs @@ -73,11 +73,11 @@ namespace OpenSim.Data.NHibernate cfg.AddAssembly("OpenSim.Data.NHibernate"); HbmSerializer.Default.Validate = true; - // using ( System.IO.MemoryStream stream = - // HbmSerializer.Default.Serialize(System.Reflection.Assembly.GetExecutingAssembly())) - // cfg.AddInputStream(stream); + using ( System.IO.MemoryStream stream = + HbmSerializer.Default.Serialize(System.Reflection.Assembly.GetExecutingAssembly())) + cfg.AddInputStream(stream); - // new SchemaExport(cfg).Create(true, true); + new SchemaExport(cfg).Create(true, true); factory = cfg.BuildSessionFactory(); } diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index e8663b4..4ccea59 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -592,7 +592,7 @@ namespace OpenSim.Data.SQLite InventoryFolderBase folder = new InventoryFolderBase(); folder.ID = new LLUUID((string) row["UUID"]); folder.Name = (string) row["name"]; - folder.AgentID = new LLUUID((string) row["agentID"]); + folder.Owner = new LLUUID((string) row["agentID"]); folder.ParentID = new LLUUID((string) row["parentID"]); folder.Type = Convert.ToInt16(row["type"]); folder.Version = Convert.ToUInt16(row["version"]); @@ -603,7 +603,7 @@ namespace OpenSim.Data.SQLite { row["UUID"] = Util.ToRawUuidString(folder.ID); row["name"] = folder.Name; - row["agentID"] = Util.ToRawUuidString(folder.AgentID); + row["agentID"] = Util.ToRawUuidString(folder.Owner); row["parentID"] = Util.ToRawUuidString(folder.ParentID); row["type"] = folder.Type; row["version"] = folder.Version; diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index 37907a0..091a6a3 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache // Constructors public InventoryFolderImpl(InventoryFolderBase folderbase) { - AgentID = folderbase.AgentID; + Owner = folderbase.Owner; ID = folderbase.ID; Name = folderbase.Name; ParentID = folderbase.ParentID; @@ -67,7 +67,7 @@ namespace OpenSim.Framework.Communications.Cache subFold.ID = folderID; subFold.Type = (short) type; subFold.ParentID = this.ID; - subFold.AgentID = AgentID; + subFold.Owner = Owner; SubFolders.Add(subFold.ID, subFold); return subFold; } diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index cb82850..03036d0 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework.Communications.Cache { m_log.Info("[LIBRARY INVENTORY]: Loading library inventory"); - AgentID = libOwner; + Owner = libOwner; ID = new LLUUID("00000112-000f-0000-0000-000100bba000"); Name = "OpenSim Library"; ParentID = LLUUID.Zero; @@ -177,7 +177,7 @@ namespace OpenSim.Framework.Communications.Cache folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString())); folderInfo.Type = (short)config.GetInt("type", 8); - folderInfo.AgentID = libOwner; + folderInfo.Owner = libOwner; folderInfo.Version = 1; if (libraryFolders.ContainsKey(folderInfo.ParentID)) diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index b22c0af..2dc2374 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -113,7 +113,7 @@ namespace OpenSim.Framework.Communications.Cache if (createdFolder != null) { InventoryFolderBase createdBaseFolder = new InventoryFolderBase(); - createdBaseFolder.AgentID = createdFolder.AgentID; + createdBaseFolder.Owner = createdFolder.Owner; createdBaseFolder.ID = createdFolder.ID; createdBaseFolder.Name = createdFolder.Name; createdBaseFolder.ParentID = createdFolder.ParentID; @@ -156,7 +156,7 @@ namespace OpenSim.Framework.Communications.Cache if (userProfile.RootFolder != null) { InventoryFolderBase baseFolder = new InventoryFolderBase(); - baseFolder.AgentID = remoteClient.AgentId; + baseFolder.Owner = remoteClient.AgentId; baseFolder.ID = folderID; baseFolder.Name = name; baseFolder.ParentID = parentID; @@ -176,7 +176,7 @@ namespace OpenSim.Framework.Communications.Cache if (userProfile.RootFolder != null) { InventoryFolderBase baseFolder = new InventoryFolderBase(); - baseFolder.AgentID = remoteClient.AgentId; + baseFolder.Owner = remoteClient.AgentId; baseFolder.ID = folderID; baseFolder.ParentID = parentID; m_parent.InventoryService.MoveInventoryFolder(remoteClient.AgentId, baseFolder); @@ -202,7 +202,7 @@ namespace OpenSim.Framework.Communications.Cache if (folderID == libraryRoot.ID) { remoteClient.SendInventoryFolderDetails( - libraryRoot.AgentID, libraryRoot.ID, libraryRoot.RequestListOfItems(), + libraryRoot.Owner, 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.Owner, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fetchFolders, fetchItems); return; @@ -379,7 +379,7 @@ namespace OpenSim.Framework.Communications.Cache public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID) { - if (ownerID == libraryRoot.AgentID) + if (ownerID == libraryRoot.Owner) { //Console.WriteLine("request info for library item"); diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 6b5ef1b..95a0e05 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -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.Owner) { remote_client.SendNameReply(uuid, "Mr", "OpenSim"); } diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 1250f53..97d963d 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -240,7 +240,7 @@ namespace OpenSim.Framework.Communications InventoryFolderBase folder = new InventoryFolderBase(); folder.ParentID = LLUUID.Zero; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "My Inventory"; folder.Type = (short)AssetType.Folder; @@ -251,7 +251,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Animations"; folder.Type = (short)AssetType.Animation; @@ -260,7 +260,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Body Parts"; folder.Type = (short)AssetType.Bodypart; @@ -269,7 +269,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Calling Cards"; folder.Type = (short)AssetType.CallingCard; @@ -278,7 +278,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Clothing"; folder.Type = (short)AssetType.Clothing; @@ -287,7 +287,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Gestures"; folder.Type = (short)AssetType.Gesture; @@ -296,7 +296,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Landmarks"; folder.Type = (short)AssetType.Landmark; @@ -305,7 +305,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Lost And Found"; folder.Type = (short)AssetType.LostAndFoundFolder; @@ -314,7 +314,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Notecards"; folder.Type = (short)AssetType.Notecard; @@ -323,7 +323,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Objects"; folder.Type = (short)AssetType.Object; @@ -332,7 +332,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Photo Album"; folder.Type = (short)AssetType.SnapshotFolder; @@ -341,7 +341,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Scripts"; folder.Type = (short)AssetType.LSLText; @@ -350,7 +350,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Sounds"; folder.Type = (short)AssetType.Sound; @@ -359,7 +359,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Textures"; folder.Type = (short)AssetType.Texture; @@ -368,7 +368,7 @@ namespace OpenSim.Framework.Communications folder = new InventoryFolderBase(); folder.ParentID = rootFolder; - folder.AgentID = user; + folder.Owner = user; folder.ID = LLUUID.Random(); folder.Name = "Trash"; folder.Type = (short)AssetType.TrashFolder; diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index 19d3d40..3284c59 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -45,7 +45,7 @@ namespace OpenSim.Framework /// /// The agent who's inventory this is contained by /// - private LLUUID _agentID; + private LLUUID _owner; /// /// The folder this folder is contained in @@ -76,12 +76,12 @@ namespace OpenSim.Framework } } - public LLUUID AgentID { + public LLUUID Owner { get { - return _agentID; + return _owner; } set { - _agentID = value; + _owner = value; } } diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 46fbd3d..f08c1e5 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs @@ -169,7 +169,7 @@ namespace OpenSim.Grid.InventoryServer "Updating in " + folder.ParentID.ToString() + ", folder " + folder.Name); - AddNewInventoryFolder(folder.AgentID, folder); + AddNewInventoryFolder(folder.Owner, folder); return true; } diff --git a/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs index aad02c3..ed154a8 100644 --- a/OpenSim/Grid/InventoryServer/InventoryManager.cs +++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs @@ -111,12 +111,12 @@ namespace OpenSim.Grid.InventoryServer } // ensure we have valid agent id - if (f.AgentID == LLUUID.Zero) + if (f.Owner == LLUUID.Zero) { if (parent != null) - f.AgentID = parent.AgentID; + f.Owner = parent.Owner; else - f.AgentID = f.ID; + f.Owner = f.ID; modified = true; } -- cgit v1.1