aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs
diff options
context:
space:
mode:
authorDan Lake2012-03-27 12:51:58 -0700
committerDan Lake2012-03-27 12:51:58 -0700
commit971d32fda3cf8384987a6709cd2242afecce13ab (patch)
tree2607c27fad429ff0036fe7b7d275ddf717397282 /OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs
parentWhen loading objects from DB, first add to scene, then call TriggerOnSceneObj... (diff)
parentHG: beginning of a more restrictive inventory access procedure (optional). Ex... (diff)
downloadopensim-SC-971d32fda3cf8384987a6709cd2242afecce13ab.zip
opensim-SC-971d32fda3cf8384987a6709cd2242afecce13ab.tar.gz
opensim-SC-971d32fda3cf8384987a6709cd2242afecce13ab.tar.bz2
opensim-SC-971d32fda3cf8384987a6709cd2242afecce13ab.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs')
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HGFriendServerConnector.cs26
1 files changed, 16 insertions, 10 deletions
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
36{ 36{
37 public class HGFriendsServerConnector : ServiceConnector 37 public class HGFriendsServerConnector : ServiceConnector
38 { 38 {
39 private IFriendsService m_FriendsService;
40 private IUserAgentService m_UserAgentService; 39 private IUserAgentService m_UserAgentService;
40 private IHGFriendsService m_TheService;
41 private string m_ConfigName = "HGFriendsService"; 41 private string m_ConfigName = "HGFriendsService";
42 42
43 // Called from Robust
43 public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName) : 44 public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName) :
44 base(config, server, configName) 45 this(config, server, configName, null)
45 { 46 {
46 if (configName != string.Empty) 47
48 }
49
50 // Called from standalone configurations
51 public HGFriendsServerConnector(IConfigSource config, IHttpServer server, string configName, IFriendsSimConnector localConn)
52 : base(config, server, configName)
53 {
54 if (configName != string.Empty)
47 m_ConfigName = configName; 55 m_ConfigName = configName;
48 56
57 Object[] args = new Object[] { config, m_ConfigName, localConn };
58
49 IConfig serverConfig = config.Configs[m_ConfigName]; 59 IConfig serverConfig = config.Configs[m_ConfigName];
50 if (serverConfig == null) 60 if (serverConfig == null)
51 throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); 61 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
52 62
53 string theService = serverConfig.GetString("LocalServiceModule", 63 string theService = serverConfig.GetString("LocalServiceModule",
54 String.Empty); 64 String.Empty);
55
56 if (theService == String.Empty) 65 if (theService == String.Empty)
57 throw new Exception("No LocalServiceModule in config file"); 66 throw new Exception("No LocalServiceModule in config file");
58 67 m_TheService = ServerUtils.LoadPlugin<IHGFriendsService>(theService, args);
59 Object[] args = new Object[] { config };
60 m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);
61 68
62 theService = serverConfig.GetString("UserAgentService", string.Empty); 69 theService = serverConfig.GetString("UserAgentService", string.Empty);
63 if (theService == String.Empty) 70 if (theService == String.Empty)
64 throw new Exception("No UserAgentService in " + m_ConfigName); 71 throw new Exception("No UserAgentService in " + m_ConfigName);
72 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(theService, new Object[] { config, localConn });
65 73
66 m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(theService, args); 74 server.AddStreamHandler(new HGFriendsServerPostHandler(m_TheService, m_UserAgentService, localConn));
67
68 server.AddStreamHandler(new HGFriendsServerPostHandler(m_FriendsService, m_UserAgentService));
69 } 75 }
70 } 76 }
71} 77}