aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2010-02-25 23:34:58 +0000
committerMelanie2010-02-25 23:34:58 +0000
commit12432b175142b4e8cf5900913da82f5e64ef6895 (patch)
tree6313ce198128a796367289f795578cc2e7999212 /OpenSim
parentImplement local online/offline notifications (diff)
parentMerge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/open... (diff)
downloadopensim-SC-12432b175142b4e8cf5900913da82f5e64ef6895.zip
opensim-SC-12432b175142b4e8cf5900913da82f5e64ef6895.tar.gz
opensim-SC-12432b175142b4e8cf5900913da82f5e64ef6895.tar.bz2
opensim-SC-12432b175142b4e8cf5900913da82f5e64ef6895.tar.xz
Merge branch 'presence-refactor' of melanie@opensimulator.org:/var/git/opensim into presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Services/Friends/FriendsServiceBase.cs8
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs1
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginResponse.cs26
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs17
4 files changed, 33 insertions, 19 deletions
diff --git a/OpenSim/Services/Friends/FriendsServiceBase.cs b/OpenSim/Services/Friends/FriendsServiceBase.cs
index cabe944..9858972 100644
--- a/OpenSim/Services/Friends/FriendsServiceBase.cs
+++ b/OpenSim/Services/Friends/FriendsServiceBase.cs
@@ -71,12 +71,14 @@ namespace OpenSim.Services.Friends
71 // 71 //
72 // We tried, but this doesn't exist. We can't proceed. 72 // We tried, but this doesn't exist. We can't proceed.
73 // 73 //
74 if (dllName.Equals(String.Empty)) 74 if (String.Empty.Equals(dllName))
75 throw new Exception("No StorageProvider configured"); 75 throw new Exception("No StorageProvider configured");
76 76
77 string realm = friendsConfig.GetString("Realm", "Friends"); 77 string realm = "Friends";
78 if (friendsConfig != null)
79 realm = friendsConfig.GetString("Realm", realm);
78 80
79 m_Database = LoadPlugin<IFriendsData>(dllName, new Object[] {connString, realm}); 81 m_Database = LoadPlugin<IFriendsData>(dllName, new Object[] { connString, realm });
80 if (m_Database == null) 82 if (m_Database == null)
81 throw new Exception("Could not find a storage interface in the given module"); 83 throw new Exception("Could not find a storage interface in the given module");
82 } 84 }
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index e2d0eb8..56744b6 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -306,6 +306,7 @@ namespace OpenSim.Services.HypergridService
306 return false; 306 return false;
307 307
308 string addressee = parts[0]; 308 string addressee = parts[0];
309 m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, m_ExternalName);
309 return (addressee == m_ExternalName); 310 return (addressee == m_ExternalName);
310 } 311 }
311 312
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