From 70fa30204272e874b8e3acccdc2e22cd4e42b2b2 Mon Sep 17 00:00:00 2001 From: MW Date: Sun, 22 Jul 2007 11:44:36 +0000 Subject: * Some work in progress code: Inventory cache, start of inventory server/service, userprofile cache, inventory handling. (non of it is enabled yet (or at least it shouldn't be). * Fixed some of the problems with crossing regions when flying: you should no longer sink to ground level when crossing (should keep roughly your right height). Should no longer sometimes get sent back to the centre of the current region when attempting to border cross. But instead sometimes you will find you avatar stop at the edge of region and you will need to start moving again to retry the crossing (which should then work). This code is partly based on Babblefrog's issue #212 patch. [I think I have some ideas of how to solve the stopping at edges problem, just want to get the inventory code done first] * Capabilities code has now been moved to the OpenSim.Framework.Communications project as some of the caps code will be tightly tied to inventory/asset handling and it was causing a two way reference problem when it was in its own project/dll. This is a Big commit as I was going to keep my inventory work local until I had it in a working state, in case it brakes anything, but its getting harder to keep in sync with svn. --- .../Communications/caches/UserProfileCache.cs | 168 --------------------- 1 file changed, 168 deletions(-) delete mode 100644 OpenSim/Framework/Communications/caches/UserProfileCache.cs (limited to 'OpenSim/Framework/Communications/caches/UserProfileCache.cs') diff --git a/OpenSim/Framework/Communications/caches/UserProfileCache.cs b/OpenSim/Framework/Communications/caches/UserProfileCache.cs deleted file mode 100644 index bfb6f07..0000000 --- a/OpenSim/Framework/Communications/caches/UserProfileCache.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using libsecondlife; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Data; -using OpenSim.Framework.Communications; - -namespace OpenSim.Framework.Communications.Caches -{ - public class UserProfileCache - { - public Dictionary UserProfiles = new Dictionary(); - - private CommunicationsManager m_parent; - - public UserProfileCache(CommunicationsManager parent) - { - m_parent = parent; - } - - /// - /// A new user has moved into a region in this instance - /// so get info from servers - /// - /// - public void AddNewUser(LLUUID userID) - { - if (!this.UserProfiles.ContainsKey(userID)) - { - CachedUserInfo userInfo = new CachedUserInfo(); - userInfo.UserProfile = this.RequestUserProfileForUser(userID); - - if (userInfo.UserProfile != null) - { - this.RequestInventoryForUser(userID, userInfo); - this.UserProfiles.Add(userID, userInfo); - } - else - { - //no profile for this user, what do we do now? - Console.WriteLine("UserProfileCache.cs: user profile for user not found"); - - } - } - else - { - //already have a cached profile for this user - //we should make sure its upto date with the user server version - } - } - - /// - /// A new user has moved into a region in this instance - /// so get info from servers - /// - /// - /// - public void AddNewUser(string firstName, string lastName) - { - - } - - /// - /// A user has left this instance - /// so make sure servers have been updated - /// Then remove cached info - /// - /// - public void UserLogOut(LLUUID userID) - { - - } - - public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType, string folderName, LLUUID parentID) - { - if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) - { - CachedUserInfo userInfo = this.UserProfiles[remoteClient.AgentId]; - if (userInfo.RootFolder.folderID == parentID) - { - userInfo.RootFolder.CreateNewSubFolder(folderID, folderName, folderType); - } - else - { - InventoryFolder parentFolder = userInfo.RootFolder.HasSubFolder(parentID); - if (parentFolder != null) - { - parentFolder.CreateNewSubFolder(folderID, folderName, folderType); - } - } - } - } - - public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) - { - if (this.UserProfiles.ContainsKey(remoteClient.AgentId)) - { - CachedUserInfo userInfo = this.UserProfiles[remoteClient.AgentId]; - if (userInfo.RootFolder.folderID == folderID) - { - if (fetchItems) - { - remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, userInfo.RootFolder.RequestListOfItems()); - } - } - else - { - InventoryFolder parentFolder = userInfo.RootFolder.HasSubFolder(folderID); - if(parentFolder != null) - { - if(fetchItems) - { - remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, parentFolder.RequestListOfItems()); - } - } - } - } - } - - /// - /// Request the user profile from User server - /// - /// - private UserProfileData RequestUserProfileForUser(LLUUID userID) - { - return this.m_parent.UserServer.GetUserProfile(userID); - } - - /// - /// Request Iventory Info from Inventory server - /// - /// - private void RequestInventoryForUser(LLUUID userID, CachedUserInfo userInfo) - { - // this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); - - //for now we manually create the root folder, - // but should be requesting all inventory from inventory server. - InventoryFolder rootFolder = new InventoryFolder(); - rootFolder.agentID = userID; - rootFolder.folderID = userInfo.UserProfile.rootInventoryFolderID; - rootFolder.name = "My Inventory"; - rootFolder.parentID = LLUUID.Zero; - rootFolder.type = 8; - rootFolder.version = 1; - userInfo.FolderReceive(userID, rootFolder); - } - - /// - /// Make sure UserProfile is updated on user server - /// - /// - private void UpdateUserProfileToServer(LLUUID userID) - { - - } - - /// - /// Update Inventory data to Inventory server - /// - /// - private void UpdateInventoryToServer(LLUUID userID) - { - - } - } -} -- cgit v1.1