From d08ad6459a03a6a5a6a551fd2b275f1c7da94d8e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 20 Mar 2012 17:14:19 -0700 Subject: HG Friends: allow the establishment of HG friendships without requiring co-presence in the same sim. Using avatar picker, users can now search for names such as "first.last@grid.com:9000", find them, and request friendship. Friendship requests are stored if target user is offline. TESTED ON STANDALONE ONLY. --- .../Handlers/Hypergrid/HGFriendServerConnector.cs | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs') diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs index 82a7220..6c79c60 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs @@ -36,36 +36,42 @@ namespace OpenSim.Server.Handlers.Hypergrid { public class HGFriendsServerConnector : ServiceConnector { - private IFriendsService m_FriendsService; private IUserAgentService m_UserAgentService; + private IHGFriendsService m_TheService; private string m_ConfigName = "HGFriendsService"; + // Called from Robust public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName) : - base(config, server, configName) + this(config, server, configName, null) { - if (configName != string.Empty) + + } + + // Called from standalone configurations + public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName, IFriendsSimConnector localConn) + : base(config, server, configName) + { + if (configName != string.Empty) m_ConfigName = configName; + Object[] args = new Object[] { config, m_ConfigName, localConn }; + IConfig serverConfig = config.Configs[m_ConfigName]; if (serverConfig == null) throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); string theService = serverConfig.GetString("LocalServiceModule", String.Empty); - if (theService == String.Empty) throw new Exception("No LocalServiceModule in config file"); - - Object[] args = new Object[] { config }; - m_FriendsService = ServerUtils.LoadPlugin(theService, args); + m_TheService = ServerUtils.LoadPlugin(theService, args); theService = serverConfig.GetString("UserAgentService", string.Empty); if (theService == String.Empty) throw new Exception("No UserAgentService in " + m_ConfigName); + m_UserAgentService = ServerUtils.LoadPlugin(theService, new Object[] { config, localConn }); - m_UserAgentService = ServerUtils.LoadPlugin(theService, args); - - server.AddStreamHandler(new HGFriendsServerPostHandler(m_FriendsService, m_UserAgentService)); + server.AddStreamHandler(new HGFriendsServerPostHandler(m_TheService, m_UserAgentService, localConn)); } } } -- cgit v1.1