From 5ee75998ce4d941efd937848d28f3a4dac6ba6cc Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 7 Apr 2008 23:27:05 +0000 Subject: more refactoring, this time on InventoryFolderBase * wrap attributes in properties * clean up names a little bit * clean up name styles --- .../Communications/Cache/CachedUserInfo.cs | 26 ++++++------ .../Communications/Cache/InventoryFolderImpl.cs | 24 +++++------ .../Communications/Cache/LibraryRootFolder.cs | 40 +++++++++---------- .../Cache/UserProfileCacheService.cs | 46 +++++++++++----------- 4 files changed, 68 insertions(+), 68 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index cb1eb5a..e39333b 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache /// 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 /// 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)) { diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index 20edf51..37907a0 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -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; diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index 12a07eb..cb82850 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -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); diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index c3f51da..6f11d60 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -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"); -- cgit v1.1