From 83c7b9b609d3c78d099a0bf18de8685676184f94 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Oct 2011 18:03:19 -0700 Subject: Bug fix -- Test User on first run standalone might not be created properly: let all instances of UserAccountService have all its service references properly initialized, and register console commands on only one. --- .../UserAccountService/UserAccountService.cs | 90 +++++++++++----------- 1 file changed, 44 insertions(+), 46 deletions(-) (limited to 'OpenSim/Services/UserAccountService/UserAccountService.cs') diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 923be7e..e234c0a 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -62,58 +62,56 @@ namespace OpenSim.Services.UserAccountService if (userConfig == null) throw new Exception("No UserAccountService configuration"); - // In case there are several instances of this class in the same process, - // the console commands are only registered for the root instance - if (m_RootInstance == null) - { - m_RootInstance = this; - string gridServiceDll = userConfig.GetString("GridService", string.Empty); - if (gridServiceDll != string.Empty) - m_GridService = LoadPlugin(gridServiceDll, new Object[] { config }); + m_RootInstance = this; + string gridServiceDll = userConfig.GetString("GridService", string.Empty); + if (gridServiceDll != string.Empty) + m_GridService = LoadPlugin(gridServiceDll, new Object[] { config }); - string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); - if (authServiceDll != string.Empty) - m_AuthenticationService = LoadPlugin(authServiceDll, new Object[] { config }); + string authServiceDll = userConfig.GetString("AuthenticationService", string.Empty); + if (authServiceDll != string.Empty) + m_AuthenticationService = LoadPlugin(authServiceDll, new Object[] { config }); - string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); - if (presenceServiceDll != string.Empty) - m_GridUserService = LoadPlugin(presenceServiceDll, new Object[] { config }); + string presenceServiceDll = userConfig.GetString("GridUserService", string.Empty); + if (presenceServiceDll != string.Empty) + m_GridUserService = LoadPlugin(presenceServiceDll, new Object[] { config }); - string invServiceDll = userConfig.GetString("InventoryService", string.Empty); - if (invServiceDll != string.Empty) - m_InventoryService = LoadPlugin(invServiceDll, new Object[] { config }); + string invServiceDll = userConfig.GetString("InventoryService", string.Empty); + if (invServiceDll != string.Empty) + m_InventoryService = LoadPlugin(invServiceDll, new Object[] { config }); - string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); - if (avatarServiceDll != string.Empty) - m_AvatarService = LoadPlugin(avatarServiceDll, new Object[] { config }); + string avatarServiceDll = userConfig.GetString("AvatarService", string.Empty); + if (avatarServiceDll != string.Empty) + m_AvatarService = LoadPlugin(avatarServiceDll, new Object[] { config }); - m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); + m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false); - if (MainConsole.Instance != null) - { - MainConsole.Instance.Commands.AddCommand("UserService", false, - "create user", - "create user [ [ [ [ []]]]]", - "Create a new user", HandleCreateUser); - - MainConsole.Instance.Commands.AddCommand("UserService", false, - "reset user password", - "reset user password [ [ []]]", - "Reset a user password", HandleResetUserPassword); - - MainConsole.Instance.Commands.AddCommand("UserService", false, - "set user level", - "set user level [ [ []]]", - "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " - + "this account will be treated as god-moded. " - + "It will also affect the 'login level' command. ", - HandleSetUserLevel); - - MainConsole.Instance.Commands.AddCommand("UserService", false, - "show account", - "show account ", - "Show account details for the given user", HandleShowAccount); - } + // In case there are several instances of this class in the same process, + // the console commands are only registered for the root instance + if (m_RootInstance == null && MainConsole.Instance != null) + { + m_RootInstance = this; + MainConsole.Instance.Commands.AddCommand("UserService", false, + "create user", + "create user [ [ [ [ []]]]]", + "Create a new user", HandleCreateUser); + + MainConsole.Instance.Commands.AddCommand("UserService", false, + "reset user password", + "reset user password [ [ []]]", + "Reset a user password", HandleResetUserPassword); + + MainConsole.Instance.Commands.AddCommand("UserService", false, + "set user level", + "set user level [ [ []]]", + "Set user level. If >= 200 and 'allow_grid_gods = true' in OpenSim.ini, " + + "this account will be treated as god-moded. " + + "It will also affect the 'login level' command. ", + HandleSetUserLevel); + + MainConsole.Instance.Commands.AddCommand("UserService", false, + "show account", + "show account ", + "Show account details for the given user", HandleShowAccount); } } -- cgit v1.1