aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.UserServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGridServices.UserServer/Main.cs61
-rw-r--r--OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build94
2 files changed, 83 insertions, 72 deletions
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
99 _httpd = new UserHTTPServer(); 99 _httpd = new UserHTTPServer();
100 } 100 }
101 101
102
103 public void do_create(string what)
104 {
105 switch(what)
106 {
107 case "user":
108 m_console.WriteLine("Creating new user profile");
109 string tempfirstname;
110 string templastname;
111 string tempMD5Passwd;
112
113 tempfirstname=m_console.CmdPrompt("First name: ");
114 templastname=m_console.CmdPrompt("Last name: ");
115 tempMD5Passwd=m_console.PasswdPrompt("Password: ");
116
117 System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
118 byte[] bs = System.Text.Encoding.UTF8.GetBytes(tempMD5Passwd);
119 bs = x.ComputeHash(bs);
120 System.Text.StringBuilder s = new System.Text.StringBuilder();
121 foreach (byte b in bs)
122 {
123 s.Append(b.ToString("x2").ToLower());
124 }
125 tempMD5Passwd = s.ToString();
126
127 UserProfile newuser=_profilemanager.CreateNewProfile(tempfirstname,templastname,tempMD5Passwd);
128 newuser.homelookat = new LLVector3(-0.57343f, -0.819255f, 0f);
129 newuser.homepos = new LLVector3(128f,128f,23f);
130 _profilemanager.SaveUserProfiles();
131 break;
132 }
133 }
134
102 public void RunCmd(string cmd, string[] cmdparams) 135 public void RunCmd(string cmd, string[] cmdparams)
103 { 136 {
104 switch (cmd) 137 switch (cmd)
@@ -108,31 +141,9 @@ namespace OpenGridServices.UserServer
108 m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)"); 141 m_console.WriteLine("shutdown - shutdown the grid (USE CAUTION!)");
109 break; 142 break;
110 143
111 case "create user": 144 case "create":
112 m_console.WriteLine("Creating new user profile"); 145 do_create(cmdparams[0]);
113 string tempfirstname; 146 break;
114 string templastname;
115 string tempMD5Passwd;
116
117 tempfirstname=m_console.CmdPrompt("First name: ");
118 templastname=m_console.CmdPrompt("Last name: ");
119 tempMD5Passwd=m_console.PasswdPrompt("Password: ");
120
121 System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
122 byte[] bs = System.Text.Encoding.UTF8.GetBytes(tempMD5Passwd);
123 bs = x.ComputeHash(bs);
124 System.Text.StringBuilder s = new System.Text.StringBuilder();
125 foreach (byte b in bs)
126 {
127 s.Append(b.ToString("x2").ToLower());
128 }
129 tempMD5Passwd = "$1$" + s.ToString();
130
131 UserProfile newuser=_profilemanager.CreateNewProfile(tempfirstname,templastname,tempMD5Passwd);
132 newuser.homelookat = new LLVector3(-0.57343f, -0.819255f, 0f);
133 newuser.homepos = new LLVector3(128f,128f,23f);
134 _profilemanager.SaveUserProfiles();
135 break;
136 147
137 case "shutdown": 148 case "shutdown":
138 m_console.Close(); 149 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 @@
1<?xml version="1.0" ?> 1<?xml version="1.0" ?>
2<project name="OpenGridServices.UserServer" default="build"> 2<project name="OpenGridServices.UserServer" default="build">
3 <target name="build"> 3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> 4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" /> 5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}"> 6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}"> 7 <fileset basedir="${project::get-base-directory()}">
8 </fileset> 8 </fileset>
9 </copy> 9 </copy>
10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe"> 10 <csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenGridServices.UserServer" dynamicprefix="true" > 11 <resources prefix="OpenGridServices.UserServer" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="Main.cs" /> 14 <include name="Main.cs" />
15 <include name="UserHttp.cs" /> 15 <include name="UserHttp.cs" />
16 <include name="Properties/AssemblyInfo.cs" /> 16 <include name="Properties/AssemblyInfo.cs" />
17 </sources> 17 </sources>
18 <references basedir="${project::get-base-directory()}"> 18 <references basedir="${project::get-base-directory()}">
19 <lib> 19 <lib>
20 <include name="${project::get-base-directory()}" /> 20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" /> 21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib> 22 </lib>
23 <include name="System.dll" /> 23 <include name="System.dll" />
24 <include name="System.Data.dll" /> 24 <include name="System.Data.dll" />
25 <include name="System.Xml.dll" /> 25 <include name="System.Xml.dll" />
26 <include name="../bin/OpenSim.Framework.dll" /> 26 <include name="../bin/OpenSim.Framework.dll" />
27 <include name="../bin/OpenSim.Framework.Console.dll" /> 27 <include name="../bin/OpenSim.Framework.Console.dll" />
28 <include name="../bin/libsecondlife.dll" /> 28 <include name="../bin/libsecondlife.dll" />
29 <include name="../bin/Db4objects.Db4o.dll" /> 29 <include name="../bin/Db4objects.Db4o.dll" />
30 </references> 30 </references>
31 </csc> 31 </csc>
32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> 32 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
33 <mkdir dir="${project::get-base-directory()}/../bin/"/> 33 <mkdir dir="${project::get-base-directory()}/../bin/"/>
34 <copy todir="${project::get-base-directory()}/../bin/"> 34 <copy todir="${project::get-base-directory()}/../bin/">
35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" > 35 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
36 <include name="*.dll"/> 36 <include name="*.dll"/>
37 <include name="*.exe"/> 37 <include name="*.exe"/>
38 </fileset> 38 </fileset>
39 </copy> 39 </copy>
40 </target> 40 </target>
41 <target name="clean"> 41 <target name="clean">
42 <delete dir="${bin.dir}" failonerror="false" /> 42 <delete dir="${bin.dir}" failonerror="false" />
43 <delete dir="${obj.dir}" failonerror="false" /> 43 <delete dir="${obj.dir}" failonerror="false" />
44 </target> 44 </target>
45 <target name="doc" description="Creates documentation."> 45 <target name="doc" description="Creates documentation.">
46 </target> 46 </target>
47</project> 47</project>