From 950389a2633034fa8ff93dfa97dc14db46d40efc Mon Sep 17 00:00:00 2001
From: gareth
Date: Wed, 11 Apr 2007 08:51:39 +0000
Subject: Added POST handler for /sims/ in the grid server Removed asset/user
config in grid mode in the region server Added "create user" command in the
user server console Begun buggy code to send sim details to the grid at
startup Drank whole pack of red bull in one night and made stupid jokes in
SVN logs and C# comments
---
OpenGridServices.UserServer/Main.cs | 61 ++++++++------
.../OpenGridServices.UserServer.exe.build | 94 +++++++++++-----------
2 files changed, 83 insertions(+), 72 deletions(-)
(limited to 'OpenGridServices.UserServer')
diff --git a/OpenGridServices.UserServer/Main.cs b/OpenGridServices.UserServer/Main.cs
index 999d446..9c128d3 100644
--- a/OpenGridServices.UserServer/Main.cs
+++ b/OpenGridServices.UserServer/Main.cs
@@ -99,6 +99,39 @@ namespace OpenGridServices.UserServer
_httpd = new UserHTTPServer();
}
+
+ public void do_create(string what)
+ {
+ switch(what)
+ {
+ case "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 = 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;
+ }
+ }
+
public void RunCmd(string cmd, string[] cmdparams)
{
switch (cmd)
@@ -108,31 +141,9 @@ namespace OpenGridServices.UserServer
m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)");
break;
- 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 "create":
+ do_create(cmdparams[0]);
+ break;
case "shutdown":
m_console.Close();
diff --git a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
index 7212a7b..fd1be15 100644
--- a/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
+++ b/OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build
@@ -1,47 +1,47 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.1