From b4c9b6bd19c0725ae5bf60172db75ebc63ba72c6 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 1 Jan 2008 06:12:04 +0000 Subject: * You can add and remove a friend in standalone now within the same simulator. It saves. * You can add and remove a friend in grid mode now within the same simulator. It doesn't save yet. * I got rid of Mr. OpenSim as a friend.. he bothers me /:b... --- .../Communications/Local/LocalLoginService.cs | 18 ++++++++- .../Region/Communications/OGS1/OGS1UserServices.cs | 43 ++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Communications') diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 0fb86af..2c92491 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -138,8 +138,8 @@ namespace OpenSim.Region.Communications.Local theUser.currentAgent.currentHandle = reg.RegionHandle; LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList(); - buddyList.AddNewBuddy(new LoginResponse.BuddyList.BuddyInfo("11111111-1111-0000-0000-000100bba000")); - response.BuddList = buddyList; + + response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.UUID)); Login _login = new Login(); //copy data to login object @@ -162,7 +162,20 @@ namespace OpenSim.Region.Communications.Local MainLog.Instance.Warn("LOGIN", "Not found region " + currentRegion); } } + private LoginResponse.BuddyList ConvertFriendListItem(List LFL) + { + LoginResponse.BuddyList buddylistreturn = new LoginResponse.BuddyList(); + foreach (FriendListItem fl in LFL) + { + LoginResponse.BuddyList.BuddyInfo buddyitem = new LoginResponse.BuddyList.BuddyInfo(fl.Friend); + buddyitem.BuddyID = fl.Friend; + buddyitem.BuddyRightsHave = (int)fl.FriendListOwnerPerms; + buddyitem.BuddyRightsGiven = (int)fl.FriendPerms; + buddylistreturn.AddNewBuddy(buddyitem); + } + return buddylistreturn; + } protected override InventoryData CreateInventoryData(LLUUID userID) { List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); @@ -207,6 +220,7 @@ namespace OpenSim.Region.Communications.Local return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); } + } } } \ No newline at end of file diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 3a2e138..c205d08 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -213,5 +213,48 @@ namespace OpenSim.Region.Communications.OGS1 { throw new Exception("The method or operation is not implemented."); } + + #region IUserServices Friend Methods + /// + /// Adds a new friend to the database for XUser + /// + /// The agent that who's friends list is being added to + /// The agent that being added to the friends list of the friends list owner + /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects + public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) + { + + } + + /// + /// Delete friend on friendlistowner's friendlist. + /// + /// The agent that who's friends list is being updated + /// The Ex-friend agent + public void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) + { + + } + + /// + /// Update permissions for friend on friendlistowner's friendlist. + /// + /// The agent that who's friends list is being updated + /// The agent that is getting or loosing permissions + /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects + public void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) + { + + } + /// + /// Returns a list of FriendsListItems that describe the friends and permissions in the friend relationship for LLUUID friendslistowner + /// + /// The agent that we're retreiving the friends Data. + public List GetUserFriendList(LLUUID friendlistowner) + { + return new List(); + } + + #endregion } } \ No newline at end of file -- cgit v1.1