From 522d6261f11ffaf8320c3f0775beb5d0608ce226 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Sep 2011 00:12:12 +0100 Subject: Correctly create a freshly created estate owner's default items and avatar entries on standalone if applicable. --- OpenSim/Region/Application/OpenSimBase.cs | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 92e8ed1..3060169 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -41,11 +41,14 @@ using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Framework.Statistics; using OpenSim.Region.ClientStack; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Services.UserAccountService; namespace OpenSim { @@ -362,6 +365,53 @@ namespace OpenSim scene.SetModuleInterfaces(); + // FIXME: Put me into a separate method! + while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) + { + MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); + List excluded = new List(new char[1]{' '}); + string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); + string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); + + UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); + + if (account == null) + { + m_log.DebugFormat("A {0}", scene.UserAccountService.GetType()); + +// if (scene.UserAccountService is LocalUserAccountServicesConnector) +// { +// IUserAccountService innerUas +// = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService; +// +// m_log.DebugFormat("B {0}", innerUas.GetType()); +// +// if (innerUas is UserAccountService) +// { + + if (scene.UserAccountService is UserAccountService) + { + string password = MainConsole.Instance.PasswdPrompt("Password"); + string email = MainConsole.Instance.CmdPrompt("Email", ""); + + // TODO: Where do we put m_regInfo.ScopeID? + account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email); + } +// } + } + + if (account == null) + { + m_log.ErrorFormat( + "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); + } + else + { + regionInfo.EstateSettings.EstateOwner = account.PrincipalID; + regionInfo.EstateSettings.Save(); + } + } + // Prims have to be loaded after module configuration since some modules may be invoked during the load scene.LoadPrimsFromStorage(regionInfo.originRegionID); -- cgit v1.1 From 4ae4b14b5da9b828bbb7c4e5b05693ad8528556a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Sep 2011 00:24:23 +0100 Subject: refactor: move estate owner setup code into separate method --- OpenSim/Region/Application/OpenSimBase.cs | 95 ++++++++++++++++--------------- 1 file changed, 50 insertions(+), 45 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 3060169..8662ea8 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -365,52 +365,8 @@ namespace OpenSim scene.SetModuleInterfaces(); - // FIXME: Put me into a separate method! while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) - { - MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); - List excluded = new List(new char[1]{' '}); - string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); - string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); - - UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); - - if (account == null) - { - m_log.DebugFormat("A {0}", scene.UserAccountService.GetType()); - -// if (scene.UserAccountService is LocalUserAccountServicesConnector) -// { -// IUserAccountService innerUas -// = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService; -// -// m_log.DebugFormat("B {0}", innerUas.GetType()); -// -// if (innerUas is UserAccountService) -// { - - if (scene.UserAccountService is UserAccountService) - { - string password = MainConsole.Instance.PasswdPrompt("Password"); - string email = MainConsole.Instance.CmdPrompt("Email", ""); - - // TODO: Where do we put m_regInfo.ScopeID? - account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email); - } -// } - } - - if (account == null) - { - m_log.ErrorFormat( - "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); - } - else - { - regionInfo.EstateSettings.EstateOwner = account.PrincipalID; - regionInfo.EstateSettings.Save(); - } - } + SetUpEstateOwner(scene); // Prims have to be loaded after module configuration since some modules may be invoked during the load scene.LoadPrimsFromStorage(regionInfo.originRegionID); @@ -466,6 +422,55 @@ namespace OpenSim return clientServer; } + private void SetUpEstateOwner(Scene scene) + { + RegionInfo regionInfo = scene.RegionInfo; + + MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); + List excluded = new List(new char[1]{' '}); + string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); + string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); + + UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); + + if (account == null) + { + + // XXX: The LocalUserAccountServicesConnector is currently registering its inner service rather than + // itself! +// if (scene.UserAccountService is LocalUserAccountServicesConnector) +// { +// IUserAccountService innerUas +// = ((LocalUserAccountServicesConnector)scene.UserAccountService).UserAccountService; +// +// m_log.DebugFormat("B {0}", innerUas.GetType()); +// +// if (innerUas is UserAccountService) +// { + + if (scene.UserAccountService is UserAccountService) + { + string password = MainConsole.Instance.PasswdPrompt("Password"); + string email = MainConsole.Instance.CmdPrompt("Email", ""); + + // TODO: Where do we put m_regInfo.ScopeID? + account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email); + } +// } + } + + if (account == null) + { + m_log.ErrorFormat( + "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); + } + else + { + regionInfo.EstateSettings.EstateOwner = account.PrincipalID; + regionInfo.EstateSettings.Save(); + } + } + private void ShutdownRegion(Scene scene) { m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName); -- cgit v1.1 From 90466515839eb34d7fd9984c92f1970ab5d6f3ad Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Sep 2011 00:36:43 +0100 Subject: Pass any region scope through to the CreateUser() method --- OpenSim/Region/Application/OpenSimBase.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 8662ea8..54caac4 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -422,6 +422,14 @@ namespace OpenSim return clientServer; } + /// + /// Try to set up the estate owner for the given scene. + /// + /// + /// The involves asking the user for information about the user on the console. If the user does not already + /// exist then it is created. + /// + /// private void SetUpEstateOwner(Scene scene) { RegionInfo regionInfo = scene.RegionInfo; @@ -453,8 +461,9 @@ namespace OpenSim string password = MainConsole.Instance.PasswdPrompt("Password"); string email = MainConsole.Instance.CmdPrompt("Email", ""); - // TODO: Where do we put m_regInfo.ScopeID? - account = ((UserAccountService)scene.UserAccountService).CreateUser(first, last, password, email); + account + = ((UserAccountService)scene.UserAccountService).CreateUser( + regionInfo.ScopeID, first, last, password, email); } // } } -- cgit v1.1 From a00327d0e5f512ccf56e18082c7e7c7366517379 Mon Sep 17 00:00:00 2001 From: justincc Date: Fri, 16 Sep 2011 19:54:23 +0100 Subject: Fix build errors on Windows by adding missing OpenSim.Services.Base reference --- OpenSim/Region/Application/OpenSimBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 54caac4..866ba9a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -46,7 +46,8 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; -using OpenSim.Server.Base; +using OpenSim.Server.Base; +using OpenSim.Services.Base; using OpenSim.Services.Interfaces; using OpenSim.Services.UserAccountService; -- cgit v1.1 From 8caf3ed49ec3403843e25db018cc9db63e2ca643 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 24 Sep 2011 02:22:47 +0100 Subject: Remove the unimplented "clear assets" command. This was a bizarre relic of a bygone age that had no implementations. If you're using and want to clear the flotsam asset cache then please use the existing "fcache clear" command --- OpenSim/Region/Application/OpenSim.cs | 9 --------- 1 file changed, 9 deletions(-) (limited to 'OpenSim/Region/Application') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e5b9dcb..09958b1 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -210,10 +210,6 @@ namespace OpenSim /// private void RegisterConsoleCommands() { - m_console.Commands.AddCommand("region", false, "clear assets", - "clear assets", - "Clear the asset cache", HandleClearAssets); - m_console.Commands.AddCommand("region", false, "force update", "force update", "Force the update of all objects on clients", @@ -509,11 +505,6 @@ namespace OpenSim } } - private void HandleClearAssets(string module, string[] args) - { - MainConsole.Instance.Output("Not implemented."); - } - /// /// Force resending of all updates to all clients in active region(s) /// -- cgit v1.1