mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Added DB backing for user profiles
Added "create profile command"
This commit is contained in:
@@ -107,9 +107,35 @@ namespace OpenGridServices.UserServer
|
||||
m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)");
|
||||
break;
|
||||
|
||||
case "shutdown":
|
||||
case "create user":
|
||||
m_console.WriteLine("Creating new user profile");
|
||||
string tempfirstname;
|
||||
string templastname;
|
||||
string tempMD5Passwd;
|
||||
|
||||
tempfirstname=m_console.CmdPrompt("First name: ");
|
||||
templastname=m_console.CmdPrompt("Last name: ");
|
||||
tempMD5Passwd=m_console.PasswdPrompt("Password: ");
|
||||
|
||||
System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
|
||||
byte[] bs = System.Text.Encoding.UTF8.GetBytes(tempMD5Passwd);
|
||||
bs = x.ComputeHash(bs);
|
||||
System.Text.StringBuilder s = new System.Text.StringBuilder();
|
||||
foreach (byte b in bs)
|
||||
{
|
||||
s.Append(b.ToString("x2").ToLower());
|
||||
}
|
||||
tempMD5Passwd = "$1$" + s.ToString();
|
||||
|
||||
UserProfile newuser=_profilemanager.CreateNewProfile(tempfirstname,templastname,tempMD5Passwd);
|
||||
newuser.homelookat = new LLVector3(-0.57343f, -0.819255f, 0f);
|
||||
newuser.homepos = new LLVector3(128f,128f,23f);
|
||||
_profilemanager.SaveUserProfiles();
|
||||
break;
|
||||
|
||||
case "shutdown":
|
||||
m_console.Close();
|
||||
Environment.Exit(0);
|
||||
Environment.Exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user