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 ++--- .../Communications/CommunicationsManager.cs | 2 +- .../Communications/InventoryServiceBase.cs | 216 ++++++++++----------- OpenSim/Framework/Communications/LoginService.cs | 10 +- OpenSim/Framework/InventoryFolderBase.cs | 66 ++++++- 8 files changed, 242 insertions(+), 188 deletions(-) (limited to 'OpenSim/Framework') 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"); diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index d96709d..6b5ef1b 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.AgentID) { remote_client.SendNameReply(uuid, "Mr", "OpenSim"); } diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index f41bd27..4abfc5a 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -95,7 +95,7 @@ namespace OpenSim.Framework.Communications foreach (KeyValuePair plugin in m_plugins) { - IList folders = plugin.Value.getFolderHierarchy(rootFolder.folderID); + IList 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 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); } } } diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 413a934..6f558a0 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -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); } diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index bf43577..19d3d40 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -40,31 +40,85 @@ namespace OpenSim.Framework /// /// The name of the folder (64 characters or less) /// - public string name; + private string _name; /// /// The agent who's inventory this is contained by /// - public LLUUID agentID; + private LLUUID _agentID; /// /// The folder this folder is contained in /// - public LLUUID parentID; + private LLUUID _parentID; /// /// The UUID for this folder /// - public LLUUID folderID; + private LLUUID _id; /// /// Type of items normally stored in this folder /// - public short type; + private short _type; /// /// /// - 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; + } + } } } -- cgit v1.1