aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs (renamed from OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs)53
1 files changed, 22 insertions, 31 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
index 013462e..f17a8de 100644
--- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
@@ -25,46 +25,37 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using OpenSim.Framework; 28using System;
29using OpenSim.Framework.Communications; 29using Nini.Config;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Server.Base;
31using OpenSim.Framework.Servers; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Region.Communications.Local; 33using OpenSim.Server.Handlers.Base;
34using OpenSim.Data;
35 34
36namespace OpenSim.Tests.Common.Mock 35namespace OpenSim.Server.Handlers.UserAccounts
37{ 36{
38 public class TestCommunicationsManager : CommunicationsManager 37 public class UserAccountServiceConnector : ServiceConnector
39 { 38 {
40 public IUserDataPlugin UserDataPlugin 39 private IUserAccountService m_UserAccountService;
41 { 40 private string m_ConfigName = "UserAccountService";
42 get { return m_userDataPlugin; }
43 }
44 private IUserDataPlugin m_userDataPlugin;
45
46 // public IInventoryDataPlugin InventoryDataPlugin
47 // {
48 // get { return m_inventoryDataPlugin; }
49 // }
50 // private IInventoryDataPlugin m_inventoryDataPlugin;
51 41
52 public TestCommunicationsManager() 42 public UserAccountServiceConnector(IConfigSource config, IHttpServer server, string configName) :
53 : this(null) 43 base(config, server, configName)
54 { 44 {
55 } 45 IConfig serverConfig = config.Configs[m_ConfigName];
46 if (serverConfig == null)
47 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
56 48
57 public TestCommunicationsManager(NetworkServersInfo serversInfo) 49 string service = serverConfig.GetString("LocalServiceModule",
58 : base(serversInfo, null) 50 String.Empty);
59 { 51
52 if (service == String.Empty)
53 throw new Exception("No LocalServiceModule in config file");
60 54
61 LocalUserServices lus = new LocalUserServices(991, 992, this); 55 Object[] args = new Object[] { config };
62 lus.AddPlugin(new TemporaryUserProfilePlugin()); 56 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(service, args);
63 m_userDataPlugin = new TestUserDataPlugin();
64 lus.AddPlugin(m_userDataPlugin);
65 m_userService = lus;
66 m_userAdminService = lus;
67 57
58 server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService));
68 } 59 }
69 } 60 }
70} 61}