From b907a66f394b279d3ca2b1ac620bc7bb13cc6dd2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 4 Oct 2011 23:48:35 +0100 Subject: 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. --- OpenSim/Region/Application/OpenSimBase.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Application/OpenSimBase.cs') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 866ba9a..a6b91a3 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); } // } } -- cgit v1.1