using System; using System.Collections.Generic; using System.Text; using libsecondlife; 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); this.m_parent.InventoryServer.RequestInventoryForUser(userID, userInfo.FolderReceive, userInfo.ItemReceive); if (userInfo.UserProfile != null) { this.UserProfiles.Add(userID, userInfo); } else { //no profile for this user, what do we do now? } } 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) { } /// /// 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) { } /// /// Make sure UserProfile is updated on user server /// /// private void UpdateUserProfileToServer(LLUUID userID) { } /// /// Update Inventory data to Inventory server /// /// private void UpdateInventoryToServer(LLUUID userID) { } } }