aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/LoginService.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Communications/LoginService.cs
parent* Deleted .user file (diff)
downloadopensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Communications/LoginService.cs')
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs53
1 files changed, 22 insertions, 31 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 66b91e1..497cc5d 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -28,16 +28,10 @@
28 28
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Collections.Generic;
32using System.Reflection;
33using System.Security.Cryptography;
34using libsecondlife; 31using libsecondlife;
35using Nwc.XmlRpc; 32using Nwc.XmlRpc;
36using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
37 34
38using OpenSim.Framework;
39using InventoryFolder = OpenSim.Framework.InventoryFolder;
40
41namespace OpenSim.Framework.UserManagement 35namespace OpenSim.Framework.UserManagement
42{ 36{
43 public class LoginService 37 public class LoginService
@@ -61,12 +55,12 @@ namespace OpenSim.Framework.UserManagement
61 /// <returns>The response to send</returns> 55 /// <returns>The response to send</returns>
62 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) 56 public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
63 { 57 {
64 58 MainLog.Instance.Verbose("LOGIN", "Attempting login now...");
65 MainLog.Instance.Verbose("LOGIN","Attempting login now...");
66 XmlRpcResponse response = new XmlRpcResponse(); 59 XmlRpcResponse response = new XmlRpcResponse();
67 Hashtable requestData = (Hashtable)request.Params[0]; 60 Hashtable requestData = (Hashtable) request.Params[0];
68 61
69 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); 62 bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") &&
63 requestData.Contains("passwd"));
70 bool GoodLogin = false; 64 bool GoodLogin = false;
71 65
72 UserProfileData userProfile; 66 UserProfileData userProfile;
@@ -74,9 +68,9 @@ namespace OpenSim.Framework.UserManagement
74 68
75 if (GoodXML) 69 if (GoodXML)
76 { 70 {
77 string firstname = (string)requestData["first"]; 71 string firstname = (string) requestData["first"];
78 string lastname = (string)requestData["last"]; 72 string lastname = (string) requestData["last"];
79 string passwd = (string)requestData["passwd"]; 73 string passwd = (string) requestData["passwd"];
80 74
81 userProfile = GetTheUser(firstname, lastname); 75 userProfile = GetTheUser(firstname, lastname);
82 if (userProfile == null) 76 if (userProfile == null)
@@ -110,7 +104,7 @@ namespace OpenSim.Framework.UserManagement
110 LLUUID agentID = userProfile.UUID; 104 LLUUID agentID = userProfile.UUID;
111 105
112 // Inventory Library Section 106 // Inventory Library Section
113 InventoryData inventData = this.CreateInventoryData(agentID); 107 InventoryData inventData = CreateInventoryData(agentID);
114 ArrayList AgentInventoryArray = inventData.InventoryArray; 108 ArrayList AgentInventoryArray = inventData.InventoryArray;
115 109
116 Hashtable InventoryRootHash = new Hashtable(); 110 Hashtable InventoryRootHash = new Hashtable();
@@ -120,7 +114,7 @@ namespace OpenSim.Framework.UserManagement
120 userProfile.rootInventoryFolderID = inventData.RootFolderID; 114 userProfile.rootInventoryFolderID = inventData.RootFolderID;
121 115
122 // Circuit Code 116 // Circuit Code
123 uint circode = (uint)(Util.RandomClass.Next()); 117 uint circode = (uint) (Util.RandomClass.Next());
124 118
125 logResponse.Lastname = userProfile.surname; 119 logResponse.Lastname = userProfile.surname;
126 logResponse.Firstname = userProfile.username; 120 logResponse.Firstname = userProfile.username;
@@ -129,20 +123,20 @@ namespace OpenSim.Framework.UserManagement
129 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); 123 logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
130 logResponse.InventoryRoot = InventoryRoot; 124 logResponse.InventoryRoot = InventoryRoot;
131 logResponse.InventorySkeleton = AgentInventoryArray; 125 logResponse.InventorySkeleton = AgentInventoryArray;
132 logResponse.InventoryLibrary = this.GetInventoryLibrary(); 126 logResponse.InventoryLibrary = GetInventoryLibrary();
133 logResponse.InventoryLibraryOwner = this.GetLibraryOwner(); 127 logResponse.InventoryLibraryOwner = GetLibraryOwner();
134 logResponse.CircuitCode = (Int32)circode; 128 logResponse.CircuitCode = (Int32) circode;
135 //logResponse.RegionX = 0; //overwritten 129 //logResponse.RegionX = 0; //overwritten
136 //logResponse.RegionY = 0; //overwritten 130 //logResponse.RegionY = 0; //overwritten
137 logResponse.Home = "!!null temporary value {home}!!"; // Overwritten 131 logResponse.Home = "!!null temporary value {home}!!"; // Overwritten
138 //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n"; 132 //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
139 //logResponse.SimAddress = "127.0.0.1"; //overwritten 133 //logResponse.SimAddress = "127.0.0.1"; //overwritten
140 //logResponse.SimPort = 0; //overwritten 134 //logResponse.SimPort = 0; //overwritten
141 logResponse.Message = this.GetMessage(); 135 logResponse.Message = GetMessage();
142 136
143 try 137 try
144 { 138 {
145 this.CustomiseResponse(logResponse, userProfile); 139 CustomiseResponse(logResponse, userProfile);
146 } 140 }
147 catch (Exception e) 141 catch (Exception e)
148 { 142 {
@@ -152,7 +146,6 @@ namespace OpenSim.Framework.UserManagement
152 } 146 }
153 CommitAgent(ref userProfile); 147 CommitAgent(ref userProfile);
154 return logResponse.ToXmlRpcResponse(); 148 return logResponse.ToXmlRpcResponse();
155
156 } 149 }
157 150
158 catch (Exception E) 151 catch (Exception E)
@@ -162,7 +155,6 @@ namespace OpenSim.Framework.UserManagement
162 //} 155 //}
163 } 156 }
164 return response; 157 return response;
165
166 } 158 }
167 159
168 /// <summary> 160 /// <summary>
@@ -174,7 +166,7 @@ namespace OpenSim.Framework.UserManagement
174 { 166 {
175 } 167 }
176 168
177 /// <summary> 169 /// <summary>
178 /// Saves a target agent to the database 170 /// Saves a target agent to the database
179 /// </summary> 171 /// </summary>
180 /// <param name="profile">The users profile</param> 172 /// <param name="profile">The users profile</param>
@@ -194,8 +186,7 @@ namespace OpenSim.Framework.UserManagement
194 /// <returns>Authenticated?</returns> 186 /// <returns>Authenticated?</returns>
195 public virtual bool AuthenticateUser(UserProfileData profile, string password) 187 public virtual bool AuthenticateUser(UserProfileData profile, string password)
196 { 188 {
197 189 MainLog.Instance.Verbose("LOGIN", "Authenticating " + profile.username + " " + profile.surname);
198 MainLog.Instance.Verbose("LOGIN","Authenticating " + profile.username + " " + profile.surname);
199 190
200 password = password.Remove(0, 3); //remove $1$ 191 password = password.Remove(0, 3); //remove $1$
201 192
@@ -211,7 +202,7 @@ namespace OpenSim.Framework.UserManagement
211 /// <param name="request"></param> 202 /// <param name="request"></param>
212 public void CreateAgent(UserProfileData profile, XmlRpcRequest request) 203 public void CreateAgent(UserProfileData profile, XmlRpcRequest request)
213 { 204 {
214 this.m_userManager.CreateAgent(profile, request); 205 m_userManager.CreateAgent(profile, request);
215 } 206 }
216 207
217 /// <summary> 208 /// <summary>
@@ -222,7 +213,7 @@ namespace OpenSim.Framework.UserManagement
222 /// <returns></returns> 213 /// <returns></returns>
223 public virtual UserProfileData GetTheUser(string firstname, string lastname) 214 public virtual UserProfileData GetTheUser(string firstname, string lastname)
224 { 215 {
225 return this.m_userManager.GetUserProfile(firstname, lastname); 216 return m_userManager.GetUserProfile(firstname, lastname);
226 } 217 }
227 218
228 /// <summary> 219 /// <summary>
@@ -286,8 +277,8 @@ namespace OpenSim.Framework.UserManagement
286 TempHash = new Hashtable(); 277 TempHash = new Hashtable();
287 TempHash["name"] = InvFolder.FolderName; 278 TempHash["name"] = InvFolder.FolderName;
288 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); 279 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
289 TempHash["version"] = (Int32)InvFolder.Version; 280 TempHash["version"] = (Int32) InvFolder.Version;
290 TempHash["type_default"] = (Int32)InvFolder.DefaultType; 281 TempHash["type_default"] = (Int32) InvFolder.DefaultType;
291 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); 282 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
292 AgentInventoryArray.Add(TempHash); 283 AgentInventoryArray.Add(TempHash);
293 } 284 }
@@ -307,4 +298,4 @@ namespace OpenSim.Framework.UserManagement
307 } 298 }
308 } 299 }
309 } 300 }
310} 301} \ No newline at end of file