aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/LLLoginService
diff options
context:
space:
mode:
authorDiva Canto2010-02-25 16:11:04 -0800
committerDiva Canto2010-02-25 16:11:04 -0800
commit679ad9575083370204a6d83e9933323c9f60ae45 (patch)
treec2701a8f894e127a0b1ad32802bffe3374bd378c /OpenSim/Services/LLLoginService
parentImplement initial online notifications (diff)
downloadopensim-SC_OLD-679ad9575083370204a6d83e9933323c9f60ae45.zip
opensim-SC_OLD-679ad9575083370204a6d83e9933323c9f60ae45.tar.gz
opensim-SC_OLD-679ad9575083370204a6d83e9933323c9f60ae45.tar.bz2
opensim-SC_OLD-679ad9575083370204a6d83e9933323c9f60ae45.tar.xz
List of friends now retrieved upon login. Configured and tested in standalone only.
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs26
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs17
2 files changed, 27 insertions, 16 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 4db6a05..11a7473 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Capabilities; 35using OpenSim.Framework.Capabilities;
36using OpenSim.Services.Interfaces; 36using OpenSim.Services.Interfaces;
37using GridRegion = OpenSim.Services.Interfaces.GridRegion; 37using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
38 39
39using log4net; 40using log4net;
40using OpenMetaverse; 41using OpenMetaverse;
@@ -215,7 +216,7 @@ namespace OpenSim.Services.LLLoginService
215 } 216 }
216 217
217 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo, 218 public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, PresenceInfo pinfo,
218 GridRegion destination, List<InventoryFolderBase> invSkel, ILibraryService libService, 219 GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
219 string where, string startlocation, Vector3 position, Vector3 lookAt, string message, 220 string where, string startlocation, Vector3 position, Vector3 lookAt, string message,
220 GridRegion home, IPEndPoint clientIP) 221 GridRegion home, IPEndPoint clientIP)
221 : this() 222 : this()
@@ -230,8 +231,7 @@ namespace OpenSim.Services.LLLoginService
230 SecureSessionID = aCircuit.SecureSessionID; 231 SecureSessionID = aCircuit.SecureSessionID;
231 Message = message; 232 Message = message;
232 // While we don't have friends... 233 // While we don't have friends...
233 //BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID)); 234 BuddList = ConvertFriendListItem(friendsList);
234 BuddList = new LLLoginResponse.BuddyList();
235 StartLocation = where; 235 StartLocation = where;
236 236
237 FillOutHomeData(pinfo, home); 237 FillOutHomeData(pinfo, home);
@@ -607,15 +607,15 @@ namespace OpenSim.Services.LLLoginService
607 } 607 }
608 608
609 609
610 private static LLLoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL) 610 private static LLLoginResponse.BuddyList ConvertFriendListItem(FriendInfo[] friendsList)
611 { 611 {
612 LLLoginResponse.BuddyList buddylistreturn = new LLLoginResponse.BuddyList(); 612 LLLoginResponse.BuddyList buddylistreturn = new LLLoginResponse.BuddyList();
613 foreach (FriendListItem fl in LFL) 613 foreach (FriendInfo finfo in friendsList)
614 { 614 {
615 LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(fl.Friend); 615 LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(finfo.Friend);
616 buddyitem.BuddyID = fl.Friend; 616 buddyitem.BuddyID = finfo.Friend;
617 buddyitem.BuddyRightsHave = (int)fl.FriendListOwnerPerms; 617 buddyitem.BuddyRightsHave = (int)finfo.TheirFlags;
618 buddyitem.BuddyRightsGiven = (int)fl.FriendPerms; 618 buddyitem.BuddyRightsGiven = (int)finfo.MyFlags;
619 buddylistreturn.AddNewBuddy(buddyitem); 619 buddylistreturn.AddNewBuddy(buddyitem);
620 } 620 }
621 return buddylistreturn; 621 return buddylistreturn;
@@ -945,16 +945,16 @@ namespace OpenSim.Services.LLLoginService
945 { 945 {
946 public int BuddyRightsHave = 1; 946 public int BuddyRightsHave = 1;
947 public int BuddyRightsGiven = 1; 947 public int BuddyRightsGiven = 1;
948 public UUID BuddyID; 948 public string BuddyID;
949 949
950 public BuddyInfo(string buddyID) 950 public BuddyInfo(string buddyID)
951 { 951 {
952 BuddyID = new UUID(buddyID); 952 BuddyID = buddyID;
953 } 953 }
954 954
955 public BuddyInfo(UUID buddyID) 955 public BuddyInfo(UUID buddyID)
956 { 956 {
957 BuddyID = buddyID; 957 BuddyID = buddyID.ToString();
958 } 958 }
959 959
960 public Hashtable ToHashTable() 960 public Hashtable ToHashTable()
@@ -962,7 +962,7 @@ namespace OpenSim.Services.LLLoginService
962 Hashtable hTable = new Hashtable(); 962 Hashtable hTable = new Hashtable();
963 hTable["buddy_rights_has"] = BuddyRightsHave; 963 hTable["buddy_rights_has"] = BuddyRightsHave;
964 hTable["buddy_rights_given"] = BuddyRightsGiven; 964 hTable["buddy_rights_given"] = BuddyRightsGiven;
965 hTable["buddy_id"] = BuddyID.ToString(); 965 hTable["buddy_id"] = BuddyID;
966 return hTable; 966 return hTable;
967 } 967 }
968 } 968 }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index ba50e3f..143e5f1 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -14,6 +14,7 @@ using OpenSim.Framework.Console;
14using OpenSim.Server.Base; 14using OpenSim.Server.Base;
15using OpenSim.Services.Interfaces; 15using OpenSim.Services.Interfaces;
16using GridRegion = OpenSim.Services.Interfaces.GridRegion; 16using GridRegion = OpenSim.Services.Interfaces.GridRegion;
17using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
17using OpenSim.Services.Connectors.Hypergrid; 18using OpenSim.Services.Connectors.Hypergrid;
18 19
19namespace OpenSim.Services.LLLoginService 20namespace OpenSim.Services.LLLoginService
@@ -31,6 +32,7 @@ namespace OpenSim.Services.LLLoginService
31 private ISimulationService m_LocalSimulationService; 32 private ISimulationService m_LocalSimulationService;
32 private ISimulationService m_RemoteSimulationService; 33 private ISimulationService m_RemoteSimulationService;
33 private ILibraryService m_LibraryService; 34 private ILibraryService m_LibraryService;
35 private IFriendsService m_FriendsService;
34 private IAvatarService m_AvatarService; 36 private IAvatarService m_AvatarService;
35 private IUserAgentService m_UserAgentService; 37 private IUserAgentService m_UserAgentService;
36 38
@@ -57,6 +59,7 @@ namespace OpenSim.Services.LLLoginService
57 string gridService = m_LoginServerConfig.GetString("GridService", String.Empty); 59 string gridService = m_LoginServerConfig.GetString("GridService", String.Empty);
58 string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty); 60 string presenceService = m_LoginServerConfig.GetString("PresenceService", String.Empty);
59 string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty); 61 string libService = m_LoginServerConfig.GetString("LibraryService", String.Empty);
62 string friendsService = m_LoginServerConfig.GetString("FriendsService", String.Empty);
60 string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty); 63 string avatarService = m_LoginServerConfig.GetString("AvatarService", String.Empty);
61 string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty); 64 string simulationService = m_LoginServerConfig.GetString("SimulationService", String.Empty);
62 65
@@ -79,6 +82,8 @@ namespace OpenSim.Services.LLLoginService
79 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); 82 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
80 if (avatarService != string.Empty) 83 if (avatarService != string.Empty)
81 m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args); 84 m_AvatarService = ServerUtils.LoadPlugin<IAvatarService>(avatarService, args);
85 if (friendsService != string.Empty)
86 m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(friendsService, args);
82 if (simulationService != string.Empty) 87 if (simulationService != string.Empty)
83 m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); 88 m_RemoteSimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
84 if (agentService != string.Empty) 89 if (agentService != string.Empty)
@@ -228,12 +233,18 @@ namespace OpenSim.Services.LLLoginService
228 return LLFailedLoginResponse.AuthorizationProblem; 233 return LLFailedLoginResponse.AuthorizationProblem;
229 234
230 } 235 }
231 // TODO: Get Friends list... 236 // Get Friends list
237 FriendInfo[] friendsList = new FriendInfo[0];
238 if (m_FriendsService != null)
239 {
240 friendsList = m_FriendsService.GetFriends(account.PrincipalID);
241 m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
242 }
232 243
233 // 244 //
234 // Finally, fill out the response and return it 245 // Finally, fill out the response and return it
235 // 246 //
236 LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, m_LibraryService, 247 LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, friendsList, m_LibraryService,
237 where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP); 248 where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);
238 249
239 return response; 250 return response;
@@ -587,7 +598,7 @@ namespace OpenSim.Services.LLLoginService
587 598
588 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason) 599 private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, out string reason)
589 { 600 {
590 m_log.Debug("XXX Launching agent at {0}" + destination.RegionName); 601 m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
591 return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); 602 return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason);
592 } 603 }
593 604