diff options
author | gareth | 2007-04-02 12:19:13 +0000 |
---|---|---|
committer | gareth | 2007-04-02 12:19:13 +0000 |
commit | 9a0b105ad78f802d6fe08806a1b975cd9fdf317f (patch) | |
tree | cdabea85cb406c085cfdd68ecb5460f042cb8555 /OpenGridServices.UserServer/Main.cs | |
parent | Finished adding Db4o support to user profile manager (diff) | |
download | opensim-SC-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.zip opensim-SC-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.gz opensim-SC-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.bz2 opensim-SC-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.xz |
Added DB backing for user profiles
Added "create profile command"
Diffstat (limited to 'OpenGridServices.UserServer/Main.cs')
-rw-r--r-- | OpenGridServices.UserServer/Main.cs | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/OpenGridServices.UserServer/Main.cs b/OpenGridServices.UserServer/Main.cs index 53d3fb1..d7d6102 100644 --- a/OpenGridServices.UserServer/Main.cs +++ b/OpenGridServices.UserServer/Main.cs | |||
@@ -107,9 +107,35 @@ namespace OpenGridServices.UserServer | |||
107 | m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)"); | 107 | m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)"); |
108 | break; | 108 | break; |
109 | 109 | ||
110 | case "shutdown": | 110 | case "create user": |
111 | m_console.WriteLine("Creating new user profile"); | ||
112 | string tempfirstname; | ||
113 | string templastname; | ||
114 | string tempMD5Passwd; | ||
115 | |||
116 | tempfirstname=m_console.CmdPrompt("First name: "); | ||
117 | templastname=m_console.CmdPrompt("Last name: "); | ||
118 | tempMD5Passwd=m_console.PasswdPrompt("Password: "); | ||
119 | |||
120 | System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider(); | ||
121 | byte[] bs = System.Text.Encoding.UTF8.GetBytes(tempMD5Passwd); | ||
122 | bs = x.ComputeHash(bs); | ||
123 | System.Text.StringBuilder s = new System.Text.StringBuilder(); | ||
124 | foreach (byte b in bs) | ||
125 | { | ||
126 | s.Append(b.ToString("x2").ToLower()); | ||
127 | } | ||
128 | tempMD5Passwd = "$1$" + s.ToString(); | ||
129 | |||
130 | UserProfile newuser=_profilemanager.CreateNewProfile(tempfirstname,templastname,tempMD5Passwd); | ||
131 | newuser.homelookat = new LLVector3(-0.57343f, -0.819255f, 0f); | ||
132 | newuser.homepos = new LLVector3(128f,128f,23f); | ||
133 | _profilemanager.SaveUserProfiles(); | ||
134 | break; | ||
135 | |||
136 | case "shutdown": | ||
111 | m_console.Close(); | 137 | m_console.Close(); |
112 | Environment.Exit(0); | 138 | Environment.Exit(0); |
113 | break; | 139 | break; |
114 | } | 140 | } |
115 | } | 141 | } |