From 0862627b341641ec0223bb4191dfee8d85724c9e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 28 Nov 2008 15:34:30 +0000 Subject: * refactor: move CreateUser into UserServiceAdmin --- .../RemoteController/RemoteAdminPlugin.cs | 12 +++- .../Communications/CommunicationsManager.cs | 63 ++------------------ .../Framework/Communications/IUserServiceAdmin.cs | 30 +++++----- .../Communications/InventoryServiceBase.cs | 1 - .../Framework/Communications/UserManagerBase.cs | 68 +++++++++++++++------- OpenSim/Grid/MessagingServer/UserManager.cs | 11 +++- OpenSim/Grid/UserServer/Main.cs | 64 ++++++-------------- OpenSim/Grid/UserServer/UserLoginService.cs | 6 +- OpenSim/Grid/UserServer/UserManager.cs | 8 +++ OpenSim/Region/Application/OpenSim.cs | 4 +- OpenSim/Region/Application/OpenSimBase.cs | 8 +-- .../Communications/Local/LocalLoginService.cs | 11 +--- .../Communications/Local/LocalUserServices.cs | 23 ++------ .../Modules/InterGrid/OpenGridProtocolModule.cs | 6 +- .../Environment/Scenes/Tests/SceneObjectTests.cs | 3 +- .../Scenes/Tests/TestCommunicationsManager.cs | 8 +-- 16 files changed, 135 insertions(+), 191 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index db99450..7f7689d 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -474,7 +474,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.InfoFormat("master avatar does not exist, creating it"); // ...or create new user - userID = m_app.CreateUser(masterFirst, masterLast, masterPassword, "", region.RegionLocX, region.RegionLocY); + userID = m_app.CommunicationsManager.UserServiceAdmin.AddUser( + masterFirst, masterLast, masterPassword, "", region.RegionLocX, region.RegionLocY); + if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", masterFirst, masterLast)); } @@ -668,7 +670,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (null != userProfile) throw new Exception(String.Format("avatar {0} {1} already exists", firstname, lastname)); - UUID userID = m_app.CreateUser(firstname, lastname, passwd, email, regX, regY); + UUID userID + = m_app.CommunicationsManager.UserServiceAdmin.AddUser( + firstname, lastname, passwd, email, regX, regY); if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", firstname, lastname)); @@ -764,7 +768,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (null != userProfile) throw new Exception(String.Format("avatar {0} {1} already exists", firstname, lastname)); - UUID userID = m_app.CreateUser(firstname, lastname, passwd, email, regX, regY); + UUID userID + = m_app.CommunicationsManager.UserServiceAdmin.AddUser( + firstname, lastname, passwd, email, regX, regY); if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", firstname, lastname)); diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index bcf9bed..a5ead3f 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -106,8 +106,12 @@ namespace OpenSim.Framework.Communications protected NetworkServersInfo m_networkServersInfo; /// - /// Interface to administrative user service calls. + /// Interface to user service for administrating users. /// + public IUserServiceAdmin UserServiceAdmin + { + get { return m_userServiceAdmin; } + } protected IUserServiceAdmin m_userServiceAdmin; public BaseHttpServer HttpServer @@ -247,63 +251,6 @@ namespace OpenSim.Framework.Communications } #endregion - - /// - /// Persistently adds a user to OpenSim. - /// - /// - /// - /// - /// - /// - /// - /// The UUID of the added user. Returns UUID.Zero if the add was unsuccessful - public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY) - { - string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY); - UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); - if (userProf == null) - { - return UUID.Zero; - } - else - { - InterServiceInventoryService.CreateNewUserInventory(userProf.ID); - m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); - return userProf.ID; - } - } - - /// - /// Adds the user. - /// - /// The first name. - /// The last name. - /// The password. - /// The email. - /// The reg X. - /// The reg Y. - /// The set UUID. - /// - public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) - { - string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY, SetUUID); - UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); - if (userProf == null) - { - return UUID.Zero; - } - else - { - InterServiceInventoryService.CreateNewUserInventory(userProf.ID); - m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); - return userProf.ID; - } - } /// /// Reset a user password diff --git a/OpenSim/Framework/Communications/IUserServiceAdmin.cs b/OpenSim/Framework/Communications/IUserServiceAdmin.cs index a120add..b1f974b 100644 --- a/OpenSim/Framework/Communications/IUserServiceAdmin.cs +++ b/OpenSim/Framework/Communications/IUserServiceAdmin.cs @@ -32,29 +32,29 @@ namespace OpenSim.Framework.Communications public interface IUserServiceAdmin { /// - /// Add a new user profile + /// Add a new user /// - /// The first name. - /// The last name. + /// The first name + /// The last name /// password of avatar /// email of user - /// region X. - /// region Y. - /// - UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY); + /// region X + /// region Y + /// The UUID of the created user profile. On failure, returns UUID.Zero + UUID AddUser(string firstName, string lastName, string pass, string email, uint regX, uint regY); /// - /// Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances! + /// Add a new user with a specified UUID. SHOULD ONLY BE USED in very special circumstances from modules! /// - /// The first name. - /// The last name. + /// The first name + /// The last name /// password of avatar /// email of user - /// region X. - /// region Y. - /// The set UUID. - /// - UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID setUUID); + /// region X + /// region Y + /// The set UUID + /// The UUID of the created user profile. On failure, returns UUID.Zero + UUID AddUser(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID setUUID); /// /// Reset a user password diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index 777e15b..7a44420 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -82,7 +82,6 @@ namespace OpenSim.Framework.Communications get { return "default"; } } - // See IInventoryServices public List GetInventorySkeleton(UUID userId) { // m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index a5ca654..3946ea3 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -52,6 +52,17 @@ namespace OpenSim.Framework.Communications /// List of plugins to search for user data /// private List _plugins = new List(); + + private IInterServiceInventoryServices m_interServiceInventoryService; + + /// + /// Constructor + /// + /// + public UserManagerBase(IInterServiceInventoryServices interServiceInventoryService) + { + m_interServiceInventoryService = interServiceInventoryService; + } /// /// Add a new user data plugin - plugins will be requested in the order they were added. @@ -80,7 +91,7 @@ namespace OpenSim.Framework.Communications _plugins.AddRange(loader.Plugins); } - #region Get UserProfile + #region Get UserProfile // see IUserService public UserProfileData GetUserProfile(string fname, string lname) @@ -586,39 +597,42 @@ namespace OpenSim.Framework.Communications #endregion /// - /// Add a new user profile + /// Add a new user /// - /// first name. - /// last name. - /// password - /// email. - /// location X. - /// location Y. - /// - public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY) + /// first name + /// last name + /// password + /// email + /// location X + /// location Y + /// The UUID of the created user profile. On failure, returns UUID.Zero + public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY) { - return AddUserProfile(firstName, lastName, pass, email, regX, regY, UUID.Random()); + return AddUser(firstName, lastName, password, email, regX, regY, UUID.Random()); } /// - /// Adds the user profile. + /// Add a new user /// - /// first name. - /// last name. - /// password - /// email. - /// location X. - /// location Y. + /// first name + /// last name + /// password + /// email + /// location X + /// location Y /// UUID of avatar. - /// - public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID SetUUID) + /// The UUID of the created user profile. On failure, returns UUID.Zero + public UUID AddUser( + string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) { + string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); + UserProfileData user = new UserProfileData(); user.HomeLocation = new Vector3(128, 128, 100); user.ID = SetUUID; user.FirstName = firstName; user.SurName = lastName; - user.PasswordHash = pass; + user.PasswordHash = md5PasswdHash; user.PasswordSalt = String.Empty; user.Created = Util.UnixTimeSinceEpoch(); user.HomeLookAt = new Vector3(100, 100, 100); @@ -638,7 +652,17 @@ namespace OpenSim.Framework.Communications } } - return user.ID; + UserProfileData userProf = GetUserProfile(firstName, lastName); + if (userProf == null) + { + return UUID.Zero; + } + else + { + m_interServiceInventoryService.CreateNewUserInventory(userProf.ID); + + return userProf.ID; + } } /// diff --git a/OpenSim/Grid/MessagingServer/UserManager.cs b/OpenSim/Grid/MessagingServer/UserManager.cs index 6fa5113..fc8f703 100644 --- a/OpenSim/Grid/MessagingServer/UserManager.cs +++ b/OpenSim/Grid/MessagingServer/UserManager.cs @@ -41,6 +41,15 @@ namespace OpenSim.Grid.MessagingServer { class UserManager : UserManagerBase { + /// + /// Constructor. + /// + /// Passing null to parent because we never use any function that requires an interservice inventory call. + public UserManager() + : base(null) + { + } + public UserAgentData GetUserAgentData(UUID AgentID) { UserProfileData userProfile = GetUserProfile(AgentID); @@ -53,8 +62,6 @@ namespace OpenSim.Grid.MessagingServer return null; } - - public override UserProfileData SetupMasterUser(string firstName, string lastName) { //throw new Exception("The method or operation is not implemented."); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 9c8fe23..cab5860 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -56,7 +56,6 @@ namespace OpenSim.Grid.UserServer public UserLoginService m_loginService; public GridInfoService m_gridInfoService; public MessageServersConnector m_messagesService; - protected IInterServiceInventoryServices m_interServiceInventoryService; private UUID m_lastCreatedUser = UUID.Random(); @@ -94,17 +93,16 @@ namespace OpenSim.Grid.UserServer m_stats = StatsManager.StartCollectingUserStats(); - m_log.Info("[REGION]: Establishing data connection"); - - StartupUserManager(); + m_log.Info("[STARTUP]: Establishing data connection"); + + IInterServiceInventoryServices inventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); + StartupUserManager(inventoryService); m_userManager.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); m_gridInfoService = new GridInfoService(); - m_interServiceInventoryService = new OGS1InterServiceInventoryService(Cfg.InventoryUrl); - - StartupLoginService(); + StartupLoginService(inventoryService); m_messagesService = new MessageServersConnector(); @@ -116,22 +114,30 @@ namespace OpenSim.Grid.UserServer m_messagesService.OnRegionStartup += HandleRegionStartup; m_messagesService.OnRegionShutdown += HandleRegionShutdown; - m_log.Info("[REGION]: Starting HTTP process"); + m_log.Info("[STARTUP]: Starting HTTP process"); m_httpServer = new BaseHttpServer(Cfg.HttpPort); AddHttpHandlers(); m_httpServer.Start(); } - protected virtual void StartupUserManager() + /// + /// Start up the user manager + /// + /// + protected virtual void StartupUserManager(IInterServiceInventoryServices inventoryService) { - m_userManager = new UserManager(); + m_userManager = new UserManager(new OGS1InterServiceInventoryService(Cfg.InventoryUrl)); } - protected virtual void StartupLoginService() + /// + /// Start up the login service + /// + /// + protected virtual void StartupLoginService(IInterServiceInventoryServices inventoryService) { m_loginService = new UserLoginService( - m_userManager, m_interServiceInventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); + m_userManager, inventoryService, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); } protected virtual void AddHttpHandlers() @@ -256,39 +262,7 @@ namespace OpenSim.Grid.UserServer if (null == m_userManager.GetUserProfile(firstName, lastName)) { - password = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - - UUID userID = new UUID(); - - try - { - userID = m_userManager.AddUserProfile(firstName, lastName, password, email, regX, regY); - } - catch (Exception ex) - { - m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); - } - - try - { - if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) - { - throw new Exception( - String.Format("The inventory creation request for user {0} did not succeed." - + " Please contact your inventory service provider for more information.", userID)); - } - } - catch (WebException) - { - m_log.ErrorFormat("[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", - Cfg.InventoryUrl + "CreateInventory/", userID); - } - catch (Exception e) - { - m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); - } - - m_lastCreatedUser = userID; + m_lastCreatedUser = m_userManager.AddUser(firstName, lastName, password, email, regX, regY); } else { diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 82d5af5..2308910 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -44,6 +44,9 @@ namespace OpenSim.Grid.UserServer ulong regionhandle, float positionX, float positionY, float positionZ, string firstname, string lastname); + /// + /// Login service used in grid mode. + /// public class UserLoginService : LoginService { protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -65,17 +68,16 @@ namespace OpenSim.Grid.UserServer m_config = config; m_inventoryService = inventoryService; } + public void setloginlevel(int level) { m_minLoginLevel = level; m_log.InfoFormat("[GRID] Login Level set to {0} ", level); - } public void setwelcometext(string text) { m_welcomeMessage = text; m_log.InfoFormat("[GRID] Login text set to {0} ", text); - } public override void LogOffUser(UserProfileData theUser, string message) diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 76f83b7..377ff3a 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -46,6 +46,14 @@ namespace OpenSim.Grid.UserServer public event logOffUser OnLogOffUser; private logOffUser handlerLogOffUser; + + /// + /// Constructor + /// + /// + public UserManager(IInterServiceInventoryServices interServiceInventoryService) + : base(interServiceInventoryService) + {} /// /// Deletes an active agent session diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index d44eedf..d29d0e4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -535,7 +535,7 @@ namespace OpenSim } else { - m_console.Notice("Create user is not available in grid mode, use the user-server."); + m_console.Notice("Create user is not available in grid mode, use the user server."); } break; } @@ -800,7 +800,7 @@ namespace OpenSim if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) { - CreateUser(firstName, lastName, password, email, regX, regY); + m_commsManager.UserServiceAdmin.AddUser(firstName, lastName, password, email, regX, regY); } else { diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index fb620c3..7ccb3d4 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -298,11 +298,6 @@ namespace OpenSim m_assetCache = new AssetCache(assetServer); } - public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, string email, uint regX, uint regY) - { - return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, email, regX, regY); - } - public void ProcessLogin(bool LoginEnabled) { if (LoginEnabled) @@ -314,8 +309,7 @@ namespace OpenSim { m_log.Info("[Login] Login are now disabled "); m_commsManager.GridService.RegionLoginsEnabled = false; - } - + } } /// diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 81cbbb4..50a8e16 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -94,16 +94,11 @@ namespace OpenSim.Region.Communications.Local //no current user account so make one m_log.Info("[LOGIN]: No user account found so creating a new one."); - m_userManager.AddUserProfile(firstname, lastname, "test", "", defaultHomeX, defaultHomeY); + m_userManager.AddUser(firstname, lastname, "test", "", defaultHomeX, defaultHomeY); - profile = m_userManager.GetUserProfile(firstname, lastname); - if (profile != null) - { - m_interServiceInventoryService.CreateNewUserInventory(profile.ID); - } - - return profile; + return m_userManager.GetUserProfile(firstname, lastname); } + return null; } diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 8649d61..e0c9c83 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -34,13 +34,11 @@ namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase { - // private readonly NetworkServersInfo m_serversInfo; private readonly uint m_defaultHomeX; private readonly uint m_defaultHomeY; - private IInterServiceInventoryServices m_interServiceInventoryService; /// - /// + /// User services used when OpenSim is running in standalone mode. /// /// /// @@ -49,13 +47,12 @@ namespace OpenSim.Region.Communications.Local /// Can be null if stats collection is not required. public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, IInterServiceInventoryServices interServiceInventoryService) + : base(interServiceInventoryService) { // m_serversInfo = serversInfo; m_defaultHomeX = defaultHomeLocX; m_defaultHomeY = defaultHomeLocY; - - m_interServiceInventoryService = interServiceInventoryService; } public override UserProfileData SetupMasterUser(string firstName, string lastName) @@ -72,20 +69,8 @@ namespace OpenSim.Region.Communications.Local } Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); - AddUserProfile(firstName, lastName, password, "", m_defaultHomeX, m_defaultHomeY); - - profile = GetUserProfile(firstName, lastName); - - if (profile == null) - { - Console.WriteLine("[LOCAL USER SERVICES]: Unknown Master User after creation attempt. No clue what to do here."); - } - else - { - m_interServiceInventoryService.CreateNewUserInventory(profile.ID); - } - - return profile; + AddUser(firstName, lastName, password, "", m_defaultHomeX, m_defaultHomeY); + return GetUserProfile(firstName, lastName); } public override UserProfileData SetupMasterUser(UUID uuid) diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index e3e69b0..a855617 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -530,7 +530,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // get seed capagentData.firstname = FirstName;agentData.lastname = LastName; if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode) { - homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), "", homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID); + homeScene.CommsManager.UserServiceAdmin.AddUser( + agentData.firstname, agentData.lastname, CreateRandomStr(7), "", + homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID); + UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID); if (userProfile2 != null) { @@ -539,7 +542,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid userProfile.FirstLifeAboutText = "OGP USER"; homeScene.CommsManager.UserService.UpdateUserProfile(userProfile); } - } // Stick our data in the cache so the region will know something about us diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs index 7f6fa3c..6577fe3 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs @@ -105,7 +105,8 @@ namespace OpenSim.Region.Environment.Scenes.Tests ((LocalInventoryService)scene.CommsManager.InventoryService).AddPlugin(new TestInventoryDataPlugin()); Assert.That( - scene.CommsManager.AddUser("Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), + scene.CommsManager.UserServiceAdmin.AddUser( + "Bob", "Hoskins", "test", "test@test.com", 1000, 1000, agentId), Is.EqualTo(agentId)); IClientAPI client = SceneTestUtils.AddRootAgent(scene, agentId); diff --git a/OpenSim/Region/Environment/Scenes/Tests/TestCommunicationsManager.cs b/OpenSim/Region/Environment/Scenes/Tests/TestCommunicationsManager.cs index 07cd429..b9804d9 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/TestCommunicationsManager.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/TestCommunicationsManager.cs @@ -38,13 +38,13 @@ namespace OpenSim.Region.Environment.Scenes.Tests public TestCommunicationsManager() : base(null, null, null, false, null) { - LocalUserServices lus = new LocalUserServices(null, 991, 992, null); - m_userService = lus; - m_userServiceAdmin = lus; - LocalInventoryService lis = new LocalInventoryService(); m_interServiceInventoryService = lis; AddInventoryService(lis); + + LocalUserServices lus = new LocalUserServices(null, 991, 992, lis); + m_userService = lus; + m_userServiceAdmin = lus; } } } -- cgit v1.1