From f1986d54bb3569e6b075b2125e860f31842a60cc Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 22:48:28 +0100 Subject: [PATCH 1/3] Clarify explanation of DeleteScriptsOnStartup switch in [XEngine]. --- bin/OpenSim.ini.example | 10 +++++----- bin/OpenSimDefaults.ini | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index c3d32165e6..40612e97d2 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -223,11 +223,11 @@ ;; server to send mail through. ; emailmodule = DefaultEmailModule - ; Controls whether previously compiled scripts are deleted on sim restart. If you disable this - ; then startup will be faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the - ; compiled scripts if you're recompiling OpenSim from source code and internal interfaces used - ; by scripts have changed. - ; Default is false + ;# {DeleteScriptsOnRestart} {} {Delete compiled script DLLs on restart?} (true false) true + ;; Controls whether previously compiled scripts DLLs are deleted on sim restart. If you set this to false + ;; then startup will be considerably faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the + ;; compiled scripts if you're recompiling OpenSim from source code and internal interfaces used + ;; by scripts have changed. ; DeleteScriptsOnStartup = true diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index cd69e2a16a..c4f5592816 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1194,12 +1194,11 @@ ;; Path to script assemblies ; ScriptEnginesPath = "ScriptEngines" - ; Controls whether previously compiled scripts are deleted on sim restart. If you disable this - ; then startup will be faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the + ; Controls whether previously compiled scripts DLLs are deleted on sim restart. If you set this to false + ; then startup will be considerably faster since scripts won't need to be recompiled. However, then it becomes your responsibility to delete the ; compiled scripts if you're recompiling OpenSim from source code and internal interfaces used ; by scripts have changed. - ; Default is false - ; DeleteScriptsOnStartup = true + ; DeleteScriptsOnStartup = false [OpenGridProtocol] From b229a72a5fb929d4886117f39ed6bd17a6d56aef Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Tue, 4 Oct 2011 15:43:41 -0700 Subject: [PATCH 2/3] Turn off keepalives when commands are specified --- .../ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 08f3dc7e9e..96725dd230 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -170,7 +170,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController { foreach (string enabledMethod in enabledMethods.Split('|')) { - m_httpServer.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]); + m_httpServer.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod], false); } } } From b907a66f394b279d3ca2b1ac620bc7bb13cc6dd2 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 4 Oct 2011 23:48:35 +0100 Subject: [PATCH 3/3] When creating a new user on the comand line, give the option of allowing a UUID to be specified to override the randomly generated one. This can be useful in some migration cases where recreating user accounts with known IDs will preserve region scene object ownership. --- .../RemoteController/RemoteAdminPlugin.cs | 2 +- OpenSim/Region/Application/OpenSimBase.cs | 11 ++++++++++- .../Interfaces/IUserAccountService.cs | 4 ++-- .../UserAccountService/UserAccountService.cs | 19 +++++++++++++++---- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 08f3dc7e9e..c270428e10 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -3115,7 +3115,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController UserAccount account = userAccountService.GetUserAccount(scopeID, firstName, lastName); if (null == account) { - account = new UserAccount(scopeID, firstName, lastName, email); + account = new UserAccount(scopeID, UUID.Random(), firstName, lastName, email); if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) { account.ServiceURLs = new Dictionary(); diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 866ba9a8d4..a6b91a3e34 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -462,9 +462,18 @@ namespace OpenSim string password = MainConsole.Instance.PasswdPrompt("Password"); string email = MainConsole.Instance.CmdPrompt("Email", ""); + string rawPrincipalId = MainConsole.Instance.CmdPrompt("ID", UUID.Random().ToString()); + + UUID principalId = UUID.Zero; + if (!UUID.TryParse(rawPrincipalId, out principalId)) + { + m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId); + return; + } + account = ((UserAccountService)scene.UserAccountService).CreateUser( - regionInfo.ScopeID, first, last, password, email); + regionInfo.ScopeID, principalId, first, last, password, email); } // } } diff --git a/OpenSim/Services/Interfaces/IUserAccountService.cs b/OpenSim/Services/Interfaces/IUserAccountService.cs index 9c992e04a6..20414f6550 100644 --- a/OpenSim/Services/Interfaces/IUserAccountService.cs +++ b/OpenSim/Services/Interfaces/IUserAccountService.cs @@ -44,9 +44,9 @@ namespace OpenSim.Services.Interfaces PrincipalID = principalID; } - public UserAccount(UUID scopeID, string firstName, string lastName, string email) + public UserAccount(UUID scopeID, UUID principalID, string firstName, string lastName, string email) { - PrincipalID = UUID.Random(); + PrincipalID = principalID; ScopeID = scopeID; FirstName = firstName; LastName = lastName; diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index e071b94dd5..923be7e9df 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -93,7 +93,7 @@ namespace OpenSim.Services.UserAccountService { MainConsole.Instance.Commands.AddCommand("UserService", false, "create user", - "create user [ [ [ []]]]", + "create user [ [ [ [ []]]]]", "Create a new user", HandleCreateUser); MainConsole.Instance.Commands.AddCommand("UserService", false, @@ -321,6 +321,7 @@ namespace OpenSim.Services.UserAccountService string lastName; string password; string email; + string rawPrincipalId; List excluded = new List(new char[]{' '}); @@ -340,7 +341,16 @@ namespace OpenSim.Services.UserAccountService email = MainConsole.Instance.CmdPrompt("Email", ""); else email = cmdparams[5]; - CreateUser(UUID.Zero, firstName, lastName, password, email); + if (cmdparams.Length < 7) + rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString()); + else + rawPrincipalId = cmdparams[6]; + + UUID principalId = UUID.Zero; + if (!UUID.TryParse(rawPrincipalId, out principalId)) + throw new Exception(string.Format("ID {0} is not a valid UUID", rawPrincipalId)); + + CreateUser(UUID.Zero, principalId, firstName, lastName, password, email); } protected void HandleShowAccount(string module, string[] cmdparams) @@ -453,16 +463,17 @@ namespace OpenSim.Services.UserAccountService /// Create a user /// /// Allows hosting of multiple grids in a single database. Normally left as UUID.Zero + /// ID of the user /// /// /// /// - public UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) + public UserAccount CreateUser(UUID scopeID, UUID principalID, string firstName, string lastName, string password, string email) { UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName); if (null == account) { - account = new UserAccount(UUID.Zero, firstName, lastName, email); + account = new UserAccount(UUID.Zero, principalID, firstName, lastName, email); if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0)) { account.ServiceURLs = new Dictionary();