changes prompting of create user console command to only ask for unspecified parameters and avoid an exception if the wrong number of parameters are supplied

0.6.0-stable
Dahlia Trimble 2008-07-05 08:13:22 +00:00
parent c0af057588
commit 8465f378ac
1 changed files with 16 additions and 12 deletions

View File

@ -183,21 +183,25 @@ namespace OpenSim.Framework.Communications
uint regY = 1000;
if (cmmdParams.Length < 2)
{
firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
else firstName = cmmdParams[1];
if ( cmmdParams.Length < 3 )
lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
else lastName = cmmdParams[2];
if ( cmmdParams.Length < 4 )
password = MainConsole.Instance.PasswdPrompt("Password");
regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", "1000"));
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", "1000"));
}
else
{
firstName = cmmdParams[1];
lastName = cmmdParams[2];
password = cmmdParams[3];
regX = Convert.ToUInt32(cmmdParams[4]);
regY = Convert.ToUInt32(cmmdParams[5]);
}
else password = cmmdParams[3];
if ( cmmdParams.Length < 5 )
regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
else regX = Convert.ToUInt32(cmmdParams[4]);
if ( cmmdParams.Length < 6 )
regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
else regY = Convert.ToUInt32(cmmdParams[5]);
if (null == m_userService.GetUserProfile(firstName, lastName))
{