From d939668d6a54bb25cbc56ec840058c08992fe536 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 13 Jan 2010 10:15:14 -0800 Subject: [PATCH] Bug fix in create user: create inventory was missing. --- .../UserAccountService/UserAccountService.cs | 12 ++++++++++++ bin/OpenSim.Server.ini.example | 6 ++++++ bin/config-include/StandaloneHypergrid.ini | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index a1dbb1e1fc..c55013fa1b 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -47,6 +47,7 @@ namespace OpenSim.Services.UserAccountService protected IGridService m_GridService; protected IAuthenticationService m_AuthenticationService; protected IPresenceService m_PresenceService; + protected IInventoryService m_InventoryService; public UserAccountService(IConfigSource config) : base(config) @@ -72,6 +73,10 @@ namespace OpenSim.Services.UserAccountService if (presenceServiceDll != string.Empty) m_PresenceService = LoadPlugin(presenceServiceDll, new Object[] { config }); + string invServiceDll = userConfig.GetString("InventoryService", string.Empty); + if (invServiceDll != string.Empty) + m_InventoryService = LoadPlugin(invServiceDll, new Object[] { config }); + MainConsole.Instance.Commands.AddCommand("UserService", false, "create user", "create user [ [ [ []]]]", @@ -291,6 +296,13 @@ namespace OpenSim.Services.UserAccountService m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.", firstName, lastName); + if (m_InventoryService != null) + success = m_InventoryService.CreateUserInventory(account.PrincipalID); + if (!success) + m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.", + firstName, lastName); + + m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", firstName, lastName); } } diff --git a/bin/OpenSim.Server.ini.example b/bin/OpenSim.Server.ini.example index d072ed4e6f..81b5302825 100644 --- a/bin/OpenSim.Server.ini.example +++ b/bin/OpenSim.Server.ini.example @@ -88,6 +88,12 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S StorageProvider = "OpenSim.Data.MySQL.dll" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" ; Realm = "useraccounts" + ;; These are for creating new accounts by the service + AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" + PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" + GridService = "OpenSim.Services.GridService.dll:GridService" + InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" + [PresenceService] ; for the server connector diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 277d05a592..a3e0547a2c 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -72,10 +72,11 @@ [UserAccountService] LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" - ;; These are for creating new accounts + ;; These are for creating new accounts by the service AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" + InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" [LoginService] LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService"