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.

remove-scene-viewer
Diva Canto 2011-10-13 18:03:19 -07:00
parent aa19ccf65c
commit 83c7b9b609
1 changed files with 43 additions and 45 deletions

View File

@ -62,10 +62,6 @@ 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)
@ -89,8 +85,11 @@ namespace OpenSim.Services.UserAccountService
m_CreateDefaultAvatarEntries = userConfig.GetBoolean("CreateDefaultAvatarEntries", false);
if (MainConsole.Instance != null)
// 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 [<first> [<last> [<pass> [<email> [<user id>]]]]]",
@ -115,7 +114,6 @@ namespace OpenSim.Services.UserAccountService
"Show account details for the given user", HandleShowAccount);
}
}
}
#region IUserAccountService