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... --- .../Region/Communications/Local/LocalLoginService.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Communications/Local') 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 -- cgit v1.1