* So, ok, maybe renaming serialized fields on a friday wasn't the smartest of things. Reverting 2056.

afrisby
lbsa71 2007-10-05 13:54:16 +00:00
parent 82bdf535df
commit d4a4aafaf1
12 changed files with 456 additions and 456 deletions

View File

@ -162,8 +162,8 @@ namespace OpenSim.Framework.Communications
if (profileData != null) if (profileData != null)
{ {
LLUUID profileId = profileData.UUID; LLUUID profileId = profileData.UUID;
string firstname = profileData.Firstname; string firstname = profileData.username;
string lastname = profileData.Lastname; string lastname = profileData.surname;
remote_client.SendNameReply(profileId, firstname, lastname); remote_client.SendNameReply(profileId, firstname, lastname);
} }

View File

@ -1,287 +1,287 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using libsecondlife; using libsecondlife;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Inventory; using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.Framework.Configuration; using OpenSim.Framework.Configuration;
using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder; using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
namespace OpenSim.Framework.UserManagement namespace OpenSim.Framework.UserManagement
{ {
public class LoginService public class LoginService
{ {
protected string m_welcomeMessage = "Welcome to OpenSim"; protected string m_welcomeMessage = "Welcome to OpenSim";
protected UserManagerBase m_userManager = null; protected UserManagerBase m_userManager = null;
public LoginService(UserManagerBase userManager, string welcomeMess) public LoginService(UserManagerBase userManager, string welcomeMess)
{ {
m_userManager = userManager; m_userManager = userManager;
if (welcomeMess != "") if (welcomeMess != "")
{ {
m_welcomeMessage = welcomeMess; m_welcomeMessage = welcomeMess;
} }
} }
/// <summary> /// <summary>
/// Main user login function /// Main user login function
/// </summary> /// </summary>
/// <param name="request">The XMLRPC request</param> /// <param name="request">The XMLRPC request</param>
/// <returns>The response to send</returns> /// <returns>The response to send</returns>
public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{ {
System.Console.WriteLine("Attempting login now..."); System.Console.WriteLine("Attempting login now...");
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0]; Hashtable requestData = (Hashtable)request.Params[0];
bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd")); bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
bool GoodLogin = false; bool GoodLogin = false;
UserProfileData userProfile; UserProfileData userProfile;
LoginResponse logResponse = new LoginResponse(); LoginResponse logResponse = new LoginResponse();
if (GoodXML) if (GoodXML)
{ {
string firstname = (string)requestData["first"]; string firstname = (string)requestData["first"];
string lastname = (string)requestData["last"]; string lastname = (string)requestData["last"];
string passwd = (string)requestData["passwd"]; string passwd = (string)requestData["passwd"];
userProfile = GetTheUser(firstname, lastname); userProfile = GetTheUser(firstname, lastname);
if (userProfile == null) if (userProfile == null)
return logResponse.CreateLoginFailedResponse(); return logResponse.CreateLoginFailedResponse();
GoodLogin = AuthenticateUser(userProfile, passwd); GoodLogin = AuthenticateUser(userProfile, passwd);
} }
else else
{ {
return logResponse.CreateGridErrorResponse(); return logResponse.CreateGridErrorResponse();
} }
if (!GoodLogin) if (!GoodLogin)
{ {
return logResponse.CreateLoginFailedResponse(); return logResponse.CreateLoginFailedResponse();
} }
else else
{ {
// If we already have a session... // If we already have a session...
if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline) if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline)
{ {
// Reject the login // Reject the login
return logResponse.CreateAlreadyLoggedInResponse(); return logResponse.CreateAlreadyLoggedInResponse();
} }
// Otherwise... // Otherwise...
// Create a new agent session // Create a new agent session
CreateAgent(userProfile, request); CreateAgent(userProfile, request);
try try
{ {
LLUUID agentID = userProfile.UUID; LLUUID agentID = userProfile.UUID;
// Inventory Library Section // Inventory Library Section
InventoryData inventData = this.CreateInventoryData(agentID); InventoryData inventData = this.CreateInventoryData(agentID);
ArrayList AgentInventoryArray = inventData.InventoryArray; ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable(); Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated(); InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
ArrayList InventoryRoot = new ArrayList(); ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash); InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderId = inventData.RootFolderID; userProfile.rootInventoryFolderID = inventData.RootFolderID;
// Circuit Code // Circuit Code
uint circode = (uint)(Util.RandomClass.Next()); uint circode = (uint)(Util.RandomClass.Next());
logResponse.Lastname = userProfile.Lastname; logResponse.Lastname = userProfile.surname;
logResponse.Firstname = userProfile.Firstname; logResponse.Firstname = userProfile.username;
logResponse.AgentID = agentID.ToStringHyphenated(); logResponse.AgentID = agentID.ToStringHyphenated();
logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToStringHyphenated(); logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToStringHyphenated(); logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
logResponse.InventoryRoot = InventoryRoot; logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray; logResponse.InventorySkeleton = AgentInventoryArray;
logResponse.InventoryLibrary = this.GetInventoryLibrary(); logResponse.InventoryLibrary = this.GetInventoryLibrary();
logResponse.InventoryLibraryOwner = this.GetLibraryOwner(); logResponse.InventoryLibraryOwner = this.GetLibraryOwner();
logResponse.CircuitCode = (Int32)circode; logResponse.CircuitCode = (Int32)circode;
//logResponse.RegionX = 0; //overwritten //logResponse.RegionX = 0; //overwritten
//logResponse.RegionY = 0; //overwritten //logResponse.RegionY = 0; //overwritten
logResponse.Home = "!!null temporary value {home}!!"; // Overwritten logResponse.Home = "!!null temporary value {home}!!"; // Overwritten
//logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n"; //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
//logResponse.SimAddress = "127.0.0.1"; //overwritten //logResponse.SimAddress = "127.0.0.1"; //overwritten
//logResponse.SimPort = 0; //overwritten //logResponse.SimPort = 0; //overwritten
logResponse.Message = this.GetMessage(); logResponse.Message = this.GetMessage();
try try
{ {
this.CustomiseResponse(logResponse, userProfile); this.CustomiseResponse(logResponse, userProfile);
} }
catch (Exception e) catch (Exception e)
{ {
System.Console.WriteLine(e.ToString()); System.Console.WriteLine(e.ToString());
return logResponse.CreateDeadRegionResponse(); return logResponse.CreateDeadRegionResponse();
//return logResponse.ToXmlRpcResponse(); //return logResponse.ToXmlRpcResponse();
} }
CommitAgent(ref userProfile); CommitAgent(ref userProfile);
return logResponse.ToXmlRpcResponse(); return logResponse.ToXmlRpcResponse();
} }
catch (Exception E) catch (Exception E)
{ {
System.Console.WriteLine(E.ToString()); System.Console.WriteLine(E.ToString());
} }
//} //}
} }
return response; return response;
} }
/// <summary> /// <summary>
/// Customises the login response and fills in missing values. /// Customises the login response and fills in missing values.
/// </summary> /// </summary>
/// <param name="response">The existing response</param> /// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param> /// <param name="theUser">The user profile</param>
public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser) public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser)
{ {
} }
/// <summary> /// <summary>
/// Saves a target agent to the database /// Saves a target agent to the database
/// </summary> /// </summary>
/// <param name="profile">The users profile</param> /// <param name="profile">The users profile</param>
/// <returns>Successful?</returns> /// <returns>Successful?</returns>
public bool CommitAgent(ref UserProfileData profile) public bool CommitAgent(ref UserProfileData profile)
{ {
// Saves the agent to database // Saves the agent to database
return true; return true;
} }
/// <summary> /// <summary>
/// Checks a user against it's password hash /// Checks a user against it's password hash
/// </summary> /// </summary>
/// <param name="profile">The users profile</param> /// <param name="profile">The users profile</param>
/// <param name="password">The supplied password</param> /// <param name="password">The supplied password</param>
/// <returns>Authenticated?</returns> /// <returns>Authenticated?</returns>
public virtual bool AuthenticateUser(UserProfileData profile, string password) public virtual bool AuthenticateUser(UserProfileData profile, string password)
{ {
MainLog.Instance.Verbose( MainLog.Instance.Verbose(
"Authenticating " + profile.Firstname + " " + profile.Lastname); "Authenticating " + profile.username + " " + profile.surname);
password = password.Remove(0, 3); //remove $1$ password = password.Remove(0, 3); //remove $1$
string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
return profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase); return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="profile"></param> /// <param name="profile"></param>
/// <param name="request"></param> /// <param name="request"></param>
public void CreateAgent(UserProfileData profile, XmlRpcRequest request) public void CreateAgent(UserProfileData profile, XmlRpcRequest request)
{ {
this.m_userManager.CreateAgent(profile, request); this.m_userManager.CreateAgent(profile, request);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="firstname"></param> /// <param name="firstname"></param>
/// <param name="lastname"></param> /// <param name="lastname"></param>
/// <returns></returns> /// <returns></returns>
public virtual UserProfileData GetTheUser(string firstname, string lastname) public virtual UserProfileData GetTheUser(string firstname, string lastname)
{ {
return this.m_userManager.GetUserProfile(firstname, lastname); return this.m_userManager.GetUserProfile(firstname, lastname);
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public virtual string GetMessage() public virtual string GetMessage()
{ {
return m_welcomeMessage; return m_welcomeMessage;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
protected virtual ArrayList GetInventoryLibrary() protected virtual ArrayList GetInventoryLibrary()
{ {
//return new ArrayList(); //return new ArrayList();
Hashtable TempHash = new Hashtable(); Hashtable TempHash = new Hashtable();
TempHash["name"] = "OpenSim Library"; TempHash["name"] = "OpenSim Library";
TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated(); TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated();
TempHash["version"] = 1; TempHash["version"] = 1;
TempHash["type_default"] = -1; TempHash["type_default"] = -1;
TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000"; TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
ArrayList temp = new ArrayList(); ArrayList temp = new ArrayList();
temp.Add(TempHash); temp.Add(TempHash);
TempHash = new Hashtable(); TempHash = new Hashtable();
TempHash["name"] = "Texture Library"; TempHash["name"] = "Texture Library";
TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000"; TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
TempHash["version"] = 1; TempHash["version"] = 1;
TempHash["type_default"] = -1; TempHash["type_default"] = -1;
TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001"; TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
temp.Add(TempHash); temp.Add(TempHash);
return temp; return temp;
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
protected virtual ArrayList GetLibraryOwner() protected virtual ArrayList GetLibraryOwner()
{ {
//for now create random inventory library owner //for now create random inventory library owner
Hashtable TempHash = new Hashtable(); Hashtable TempHash = new Hashtable();
TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000"; TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000";
ArrayList inventoryLibOwner = new ArrayList(); ArrayList inventoryLibOwner = new ArrayList();
inventoryLibOwner.Add(TempHash); inventoryLibOwner.Add(TempHash);
return inventoryLibOwner; return inventoryLibOwner;
} }
protected virtual InventoryData CreateInventoryData(LLUUID userID) protected virtual InventoryData CreateInventoryData(LLUUID userID)
{ {
AgentInventory userInventory = new AgentInventory(); AgentInventory userInventory = new AgentInventory();
userInventory.CreateRootFolder(userID, false); userInventory.CreateRootFolder(userID, false);
ArrayList AgentInventoryArray = new ArrayList(); ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash; Hashtable TempHash;
foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
{ {
TempHash = new Hashtable(); TempHash = new Hashtable();
TempHash["name"] = InvFolder.FolderName; TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.Version; TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.DefaultType; TempHash["type_default"] = (Int32)InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash); AgentInventoryArray.Add(TempHash);
} }
return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
} }
public class InventoryData public class InventoryData
{ {
public ArrayList InventoryArray = null; public ArrayList InventoryArray = null;
public LLUUID RootFolderID = LLUUID.Zero; public LLUUID RootFolderID = LLUUID.Zero;
public InventoryData(ArrayList invList, LLUUID rootID) public InventoryData(ArrayList invList, LLUUID rootID)
{ {
InventoryArray = invList; InventoryArray = invList;
RootFolderID = rootID; RootFolderID = rootID;
} }
} }
} }
} }

View File

@ -96,7 +96,7 @@ namespace OpenSim.Framework.UserManagement
try try
{ {
UserProfileData profile = plugin.Value.GetUserByUUID(uuid); UserProfileData profile = plugin.Value.GetUserByUUID(uuid);
profile.CurrentAgent = getUserAgent(profile.UUID); profile.currentAgent = getUserAgent(profile.UUID);
return profile; return profile;
} }
catch (Exception e) catch (Exception e)
@ -121,7 +121,7 @@ namespace OpenSim.Framework.UserManagement
try try
{ {
UserProfileData profile = plugin.Value.GetUserByName(name); UserProfileData profile = plugin.Value.GetUserByName(name);
profile.CurrentAgent = getUserAgent(profile.UUID); profile.currentAgent = getUserAgent(profile.UUID);
return profile; return profile;
} }
catch (Exception e) catch (Exception e)
@ -148,7 +148,7 @@ namespace OpenSim.Framework.UserManagement
{ {
UserProfileData profile = plugin.Value.GetUserByName(fname,lname); UserProfileData profile = plugin.Value.GetUserByName(fname,lname);
profile.CurrentAgent = getUserAgent(profile.UUID); profile.currentAgent = getUserAgent(profile.UUID);
return profile; return profile;
} }
@ -233,7 +233,7 @@ namespace OpenSim.Framework.UserManagement
public void clearUserAgent(LLUUID agentID) public void clearUserAgent(LLUUID agentID)
{ {
UserProfileData profile = GetUserProfile(agentID); UserProfileData profile = GetUserProfile(agentID);
profile.CurrentAgent = null; profile.currentAgent = null;
setUserProfile(profile); setUserProfile(profile);
} }
@ -292,8 +292,8 @@ namespace OpenSim.Framework.UserManagement
agent.UUID = profile.UUID; agent.UUID = profile.UUID;
// Current position (from Home) // Current position (from Home)
agent.currentHandle = profile.HomeRegion; agent.currentHandle = profile.homeRegion;
agent.currentPos = profile.HomeLocation; agent.currentPos = profile.homeLocation;
// If user specified additional start, use that // If user specified additional start, use that
if (requestData.ContainsKey("start")) if (requestData.ContainsKey("start"))
@ -326,7 +326,7 @@ namespace OpenSim.Framework.UserManagement
agent.regionID = new LLUUID(); // Fill in later agent.regionID = new LLUUID(); // Fill in later
agent.currentRegion = new LLUUID(); // Fill in later agent.currentRegion = new LLUUID(); // Fill in later
profile.CurrentAgent = agent; profile.currentAgent = agent;
} }
/// <summary> /// <summary>
@ -349,16 +349,16 @@ namespace OpenSim.Framework.UserManagement
public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
{ {
UserProfileData user = new UserProfileData(); UserProfileData user = new UserProfileData();
user.HomeLocation = new LLVector3(128, 128, 100); user.homeLocation = new LLVector3(128, 128, 100);
user.UUID = LLUUID.Random(); user.UUID = LLUUID.Random();
user.Firstname = firstName; user.username = firstName;
user.Lastname = lastName; user.surname = lastName;
user.PasswordHash = pass; user.passwordHash = pass;
user.PasswordSalt = ""; user.passwordSalt = "";
user.Created = Util.UnixTimeSinceEpoch(); user.created = Util.UnixTimeSinceEpoch();
user.HomeLookAt = new LLVector3(100, 100, 100); user.homeLookAt = new LLVector3(100, 100, 100);
user.HomeRegionX = regX; user.homeRegionX = regX;
user.HomeRegionY = regY; user.homeRegionY = regY;
foreach (KeyValuePair<string, IUserData> plugin in _plugins) foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{ {

View File

@ -83,7 +83,7 @@ namespace OpenSim.Framework.Data.DB4o
{ {
foreach (UserProfileData profile in manager.userProfiles.Values) foreach (UserProfileData profile in manager.userProfiles.Values)
{ {
if (profile.Firstname == fname && profile.Lastname == lname) if (profile.username == fname && profile.surname == lname)
return profile; return profile;
} }
return null; return null;
@ -98,7 +98,7 @@ namespace OpenSim.Framework.Data.DB4o
{ {
try try
{ {
return GetUserByUUID(uuid).CurrentAgent; return GetUserByUUID(uuid).currentAgent;
} }
catch (Exception) catch (Exception)
{ {
@ -126,7 +126,7 @@ namespace OpenSim.Framework.Data.DB4o
{ {
try try
{ {
return GetUserByName(fname,lname).CurrentAgent; return GetUserByName(fname,lname).currentAgent;
} }
catch (Exception) catch (Exception)
{ {

View File

@ -313,36 +313,36 @@ namespace OpenSim.Framework.Data.MySQL
if (reader.Read()) if (reader.Read())
{ {
retval.UUID = new LLUUID((string)reader["UUID"]); retval.UUID = new LLUUID((string)reader["UUID"]);
retval.Firstname = (string)reader["username"]; retval.username = (string)reader["username"];
retval.Lastname = (string)reader["lastname"]; retval.surname = (string)reader["lastname"];
retval.PasswordHash = (string)reader["passwordHash"]; retval.passwordHash = (string)reader["passwordHash"];
retval.PasswordSalt = (string)reader["passwordSalt"]; retval.passwordSalt = (string)reader["passwordSalt"];
retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString()); retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
retval.HomeLocation = new LLVector3( retval.homeLocation = new LLVector3(
Convert.ToSingle(reader["homeLocationX"].ToString()), Convert.ToSingle(reader["homeLocationX"].ToString()),
Convert.ToSingle(reader["homeLocationY"].ToString()), Convert.ToSingle(reader["homeLocationY"].ToString()),
Convert.ToSingle(reader["homeLocationZ"].ToString())); Convert.ToSingle(reader["homeLocationZ"].ToString()));
retval.HomeLookAt = new LLVector3( retval.homeLookAt = new LLVector3(
Convert.ToSingle(reader["homeLookAtX"].ToString()), Convert.ToSingle(reader["homeLookAtX"].ToString()),
Convert.ToSingle(reader["homeLookAtY"].ToString()), Convert.ToSingle(reader["homeLookAtY"].ToString()),
Convert.ToSingle(reader["homeLookAtZ"].ToString())); Convert.ToSingle(reader["homeLookAtZ"].ToString()));
retval.Created = Convert.ToInt32(reader["created"].ToString()); retval.created = Convert.ToInt32(reader["created"].ToString());
retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
retval.UserInventoryUri = (string)reader["userInventoryURI"]; retval.userInventoryURI = (string)reader["userInventoryURI"];
retval.UserAssetUri = (string)reader["userAssetURI"]; retval.userAssetURI = (string)reader["userAssetURI"];
retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString()); retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString()); retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
retval.ProfileAboutText = (string)reader["profileAboutText"]; retval.profileAboutText = (string)reader["profileAboutText"];
retval.ProfileFirstText = (string)reader["profileFirstText"]; retval.profileFirstText = (string)reader["profileFirstText"];
retval.ProfileImage = new LLUUID((string)reader["profileImage"]); retval.profileImage = new LLUUID((string)reader["profileImage"]);
retval.ProfileFirstImage = new LLUUID((string)reader["profileFirstImage"]); retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
} }
else else

View File

@ -204,9 +204,9 @@ namespace OpenSim.Framework.Data.MySQL
{ {
lock (database) lock (database)
{ {
database.insertUserRow(user.UUID, user.Firstname, user.Lastname, user.PasswordHash, user.PasswordSalt, user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, database.insertUserRow(user.UUID, user.username, user.surname, user.passwordHash, user.passwordSalt, user.homeRegion, user.homeLocation.X, user.homeLocation.Y, user.homeLocation.Z,
user.HomeLookAt.X, user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryUri, user.UserAssetUri, user.ProfileCanDoMask, user.ProfileWantDoMask, user.homeLookAt.X, user.homeLookAt.Y, user.homeLookAt.Z, user.created, user.lastLogin, user.userInventoryURI, user.userAssetURI, user.profileCanDoMask, user.profileWantDoMask,
user.ProfileAboutText, user.ProfileFirstText, user.ProfileImage, user.ProfileFirstImage); user.profileAboutText, user.profileFirstText, user.profileImage, user.profileFirstImage);
} }
} }
catch (Exception e) catch (Exception e)

View File

@ -85,7 +85,7 @@ namespace OpenSim.Framework.Data.SQLite
UserProfileData user = buildUserProfile(row); UserProfileData user = buildUserProfile(row);
row = ds.Tables["useragents"].Rows.Find(uuid); row = ds.Tables["useragents"].Rows.Find(uuid);
if(row != null) { if(row != null) {
user.CurrentAgent = buildUserAgent(row); user.currentAgent = buildUserAgent(row);
} }
return user; return user;
} else { } else {
@ -119,7 +119,7 @@ namespace OpenSim.Framework.Data.SQLite
UserProfileData user = buildUserProfile(rows[0]); UserProfileData user = buildUserProfile(rows[0]);
DataRow row = ds.Tables["useragents"].Rows.Find(user.UUID); DataRow row = ds.Tables["useragents"].Rows.Find(user.UUID);
if(row != null) { if(row != null) {
user.CurrentAgent = buildUserAgent(row); user.currentAgent = buildUserAgent(row);
} }
return user; return user;
} else { } else {
@ -137,7 +137,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
try try
{ {
return GetUserByUUID(uuid).CurrentAgent; return GetUserByUUID(uuid).currentAgent;
} }
catch (Exception) catch (Exception)
{ {
@ -165,7 +165,7 @@ namespace OpenSim.Framework.Data.SQLite
{ {
try try
{ {
return GetUserByName(fname,lname).CurrentAgent; return GetUserByName(fname,lname).currentAgent;
} }
catch (Exception) catch (Exception)
{ {
@ -193,18 +193,18 @@ namespace OpenSim.Framework.Data.SQLite
fillUserRow(row, user); fillUserRow(row, user);
} }
if(user.CurrentAgent != null) { if(user.currentAgent != null) {
DataTable ua = ds.Tables["useragents"]; DataTable ua = ds.Tables["useragents"];
row = ua.Rows.Find(user.UUID); row = ua.Rows.Find(user.UUID);
if (row == null) if (row == null)
{ {
row = ua.NewRow(); row = ua.NewRow();
fillUserAgentRow(row, user.CurrentAgent); fillUserAgentRow(row, user.currentAgent);
ua.Rows.Add(row); ua.Rows.Add(row);
} }
else else
{ {
fillUserAgentRow(row, user.CurrentAgent); fillUserAgentRow(row, user.currentAgent);
} }
} }
MainLog.Instance.Verbose("Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); MainLog.Instance.Verbose("Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
@ -317,8 +317,8 @@ namespace OpenSim.Framework.Data.SQLite
createCol(users, "userInventoryURI", typeof(System.String)); createCol(users, "userInventoryURI", typeof(System.String));
createCol(users, "userAssetURI", typeof(System.String)); createCol(users, "userAssetURI", typeof(System.String));
createCol(users, "profileCanDoMask", typeof(System.Int32)); createCol(users, "profileCanDoMask", typeof(System.Int32));
createCol(users, "ProfileWantDoMask", typeof(System.Int32)); createCol(users, "profileWantDoMask", typeof(System.Int32));
createCol(users, "ProfileAboutText", typeof(System.String)); createCol(users, "profileAboutText", typeof(System.String));
createCol(users, "profileFirstText", typeof(System.String)); createCol(users, "profileFirstText", typeof(System.String));
createCol(users, "profileImage", typeof(System.String)); createCol(users, "profileImage", typeof(System.String));
createCol(users, "profileFirstImage", typeof(System.String)); createCol(users, "profileFirstImage", typeof(System.String));
@ -367,66 +367,66 @@ namespace OpenSim.Framework.Data.SQLite
// back out. Not enough time to figure it out yet. // back out. Not enough time to figure it out yet.
UserProfileData user = new UserProfileData(); UserProfileData user = new UserProfileData();
user.UUID = new LLUUID((String)row["UUID"]); user.UUID = new LLUUID((String)row["UUID"]);
user.Firstname = (String)row["username"]; user.username = (String)row["username"];
user.Lastname = (String)row["surname"]; user.surname = (String)row["surname"];
user.PasswordHash = (String)row["passwordHash"]; user.passwordHash = (String)row["passwordHash"];
user.PasswordSalt = (String)row["passwordSalt"]; user.passwordSalt = (String)row["passwordSalt"];
user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]); user.homeRegionX = Convert.ToUInt32(row["homeRegionX"]);
user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]); user.homeRegionY = Convert.ToUInt32(row["homeRegionY"]);
user.HomeLocation = new LLVector3( user.homeLocation = new LLVector3(
Convert.ToSingle(row["homeLocationX"]), Convert.ToSingle(row["homeLocationX"]),
Convert.ToSingle(row["homeLocationY"]), Convert.ToSingle(row["homeLocationY"]),
Convert.ToSingle(row["homeLocationZ"]) Convert.ToSingle(row["homeLocationZ"])
); );
user.HomeLookAt = new LLVector3( user.homeLookAt = new LLVector3(
Convert.ToSingle(row["homeLookAtX"]), Convert.ToSingle(row["homeLookAtX"]),
Convert.ToSingle(row["homeLookAtY"]), Convert.ToSingle(row["homeLookAtY"]),
Convert.ToSingle(row["homeLookAtZ"]) Convert.ToSingle(row["homeLookAtZ"])
); );
user.Created = Convert.ToInt32(row["created"]); user.created = Convert.ToInt32(row["created"]);
user.LastLogin = Convert.ToInt32(row["lastLogin"]); user.lastLogin = Convert.ToInt32(row["lastLogin"]);
user.RootInventoryFolderId = new LLUUID((String)row["rootInventoryFolderID"]); user.rootInventoryFolderID = new LLUUID((String)row["rootInventoryFolderID"]);
user.UserInventoryUri = (String)row["userInventoryURI"]; user.userInventoryURI = (String)row["userInventoryURI"];
user.UserAssetUri = (String)row["userAssetURI"]; user.userAssetURI = (String)row["userAssetURI"];
user.ProfileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]); user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
user.ProfileWantDoMask = Convert.ToUInt32(row["ProfileWantDoMask"]); user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
user.ProfileAboutText = (String)row["ProfileAboutText"]; user.profileAboutText = (String)row["profileAboutText"];
user.ProfileFirstText = (String)row["profileFirstText"]; user.profileFirstText = (String)row["profileFirstText"];
user.ProfileImage = new LLUUID((String)row["profileImage"]); user.profileImage = new LLUUID((String)row["profileImage"]);
user.ProfileFirstImage = new LLUUID((String)row["profileFirstImage"]); user.profileFirstImage = new LLUUID((String)row["profileFirstImage"]);
return user; return user;
} }
private void fillUserRow(DataRow row, UserProfileData user) private void fillUserRow(DataRow row, UserProfileData user)
{ {
row["UUID"] = user.UUID; row["UUID"] = user.UUID;
row["username"] = user.Firstname; row["username"] = user.username;
row["surname"] = user.Lastname; row["surname"] = user.surname;
row["passwordHash"] = user.PasswordHash; row["passwordHash"] = user.passwordHash;
row["passwordSalt"] = user.PasswordSalt; row["passwordSalt"] = user.passwordSalt;
row["homeRegionX"] = user.HomeRegionX; row["homeRegionX"] = user.homeRegionX;
row["homeRegionY"] = user.HomeRegionY; row["homeRegionY"] = user.homeRegionY;
row["homeLocationX"] = user.HomeLocation.X; row["homeLocationX"] = user.homeLocation.X;
row["homeLocationY"] = user.HomeLocation.Y; row["homeLocationY"] = user.homeLocation.Y;
row["homeLocationZ"] = user.HomeLocation.Z; row["homeLocationZ"] = user.homeLocation.Z;
row["homeLookAtX"] = user.HomeLookAt.X; row["homeLookAtX"] = user.homeLookAt.X;
row["homeLookAtY"] = user.HomeLookAt.Y; row["homeLookAtY"] = user.homeLookAt.Y;
row["homeLookAtZ"] = user.HomeLookAt.Z; row["homeLookAtZ"] = user.homeLookAt.Z;
row["created"] = user.Created; row["created"] = user.created;
row["lastLogin"] = user.LastLogin; row["lastLogin"] = user.lastLogin;
row["rootInventoryFolderID"] = user.RootInventoryFolderId; row["rootInventoryFolderID"] = user.rootInventoryFolderID;
row["userInventoryURI"] = user.UserInventoryUri; row["userInventoryURI"] = user.userInventoryURI;
row["userAssetURI"] = user.UserAssetUri; row["userAssetURI"] = user.userAssetURI;
row["profileCanDoMask"] = user.ProfileCanDoMask; row["profileCanDoMask"] = user.profileCanDoMask;
row["ProfileWantDoMask"] = user.ProfileWantDoMask; row["profileWantDoMask"] = user.profileWantDoMask;
row["ProfileAboutText"] = user.ProfileAboutText; row["profileAboutText"] = user.profileAboutText;
row["profileFirstText"] = user.ProfileFirstText; row["profileFirstText"] = user.profileFirstText;
row["profileImage"] = user.ProfileImage; row["profileImage"] = user.profileImage;
row["profileFirstImage"] = user.ProfileFirstImage; row["profileFirstImage"] = user.profileFirstImage;
// ADO.NET doesn't handle NULL very well // ADO.NET doesn't handle NULL very well
foreach (DataColumn col in ds.Tables["users"].Columns) { foreach (DataColumn col in ds.Tables["users"].Columns) {

View File

@ -43,94 +43,94 @@ namespace OpenSim.Framework.Types
/// <summary> /// <summary>
/// The first component of a users account name /// The first component of a users account name
/// </summary> /// </summary>
public string Firstname; public string username;
/// <summary> /// <summary>
/// The second component of a users account name /// The second component of a users account name
/// </summary> /// </summary>
public string Lastname; public string surname;
/// <summary> /// <summary>
/// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt) /// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
/// </summary> /// </summary>
/// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks> /// <remarks>This is double MD5'd because the client sends an unsalted MD5 to the loginserver</remarks>
public string PasswordHash; public string passwordHash;
/// <summary> /// <summary>
/// The salt used for the users hash, should be 32 bytes or longer /// The salt used for the users hash, should be 32 bytes or longer
/// </summary> /// </summary>
public string PasswordSalt; public string passwordSalt;
/// <summary> /// <summary>
/// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into /// The regionhandle of the users preffered home region. If multiple sims occupy the same spot, the grid may decide which region the user logs into
/// </summary> /// </summary>
public ulong HomeRegion public ulong homeRegion
{ {
get { return Helpers.UIntsToLong((HomeRegionX * 256), (HomeRegionY * 256)); } get { return Helpers.UIntsToLong((homeRegionX * 256), (homeRegionY * 256)); }
set { set {
HomeRegionX = (uint)(value >> 40); homeRegionX = (uint)(value >> 40);
HomeRegionY = (((uint)(value)) >> 8); homeRegionY = (((uint)(value)) >> 8);
} }
} }
public uint HomeRegionX; public uint homeRegionX;
public uint HomeRegionY; public uint homeRegionY;
/// <summary> /// <summary>
/// The coordinates inside the region of the home location /// The coordinates inside the region of the home location
/// </summary> /// </summary>
public LLVector3 HomeLocation; public LLVector3 homeLocation;
/// <summary> /// <summary>
/// Where the user will be looking when they rez. /// Where the user will be looking when they rez.
/// </summary> /// </summary>
public LLVector3 HomeLookAt; public LLVector3 homeLookAt;
/// <summary> /// <summary>
/// A UNIX Timestamp (seconds since epoch) for the users creation /// A UNIX Timestamp (seconds since epoch) for the users creation
/// </summary> /// </summary>
public int Created; public int created;
/// <summary> /// <summary>
/// A UNIX Timestamp for the users last login date / time /// A UNIX Timestamp for the users last login date / time
/// </summary> /// </summary>
public int LastLogin; public int lastLogin;
public LLUUID RootInventoryFolderId; public LLUUID rootInventoryFolderID;
/// <summary> /// <summary>
/// A URI to the users inventory server, used for foreigners and large grids /// A URI to the users inventory server, used for foreigners and large grids
/// </summary> /// </summary>
public string UserInventoryUri = String.Empty; public string userInventoryURI = String.Empty;
/// <summary> /// <summary>
/// A URI to the users asset server, used for foreigners and large grids. /// A URI to the users asset server, used for foreigners and large grids.
/// </summary> /// </summary>
public string UserAssetUri = String.Empty; public string userAssetURI = String.Empty;
/// <summary> /// <summary>
/// A uint mask containing the "I can do" fields of the users profile /// A uint mask containing the "I can do" fields of the users profile
/// </summary> /// </summary>
public uint ProfileCanDoMask; public uint profileCanDoMask;
/// <summary> /// <summary>
/// A uint mask containing the "I want to do" part of the users profile /// A uint mask containing the "I want to do" part of the users profile
/// </summary> /// </summary>
public uint ProfileWantDoMask; // Profile window "I want to" mask public uint profileWantDoMask; // Profile window "I want to" mask
/// <summary> /// <summary>
/// The about text listed in a users profile. /// The about text listed in a users profile.
/// </summary> /// </summary>
public string ProfileAboutText = String.Empty; public string profileAboutText = String.Empty;
/// <summary> /// <summary>
/// The first life about text listed in a users profile /// The first life about text listed in a users profile
/// </summary> /// </summary>
public string ProfileFirstText = String.Empty; public string profileFirstText = String.Empty;
/// <summary> /// <summary>
/// The profile image for an avatar stored on the asset server /// The profile image for an avatar stored on the asset server
/// </summary> /// </summary>
public LLUUID ProfileImage; public LLUUID profileImage;
/// <summary> /// <summary>
/// The profile image for the users first life tab /// The profile image for the users first life tab
/// </summary> /// </summary>
public LLUUID ProfileFirstImage; public LLUUID profileFirstImage;
/// <summary> /// <summary>
/// The users last registered agent (filled in on the user server) /// The users last registered agent (filled in on the user server)
/// </summary> /// </summary>
public UserAgentData CurrentAgent; public UserAgentData currentAgent;
} }
/// <summary> /// <summary>

View File

@ -29,13 +29,13 @@ namespace OpenSim.Grid.UserServer
{ {
// Load information from the gridserver // Load information from the gridserver
SimProfileData SimInfo = new SimProfileData(); SimProfileData SimInfo = new SimProfileData();
SimInfo = SimInfo.RequestSimProfileData(theUser.CurrentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); SimInfo = SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
// Customise the response // Customise the response
// Home Location // Home Location
response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " + response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * 256).ToString() + ",r" + (SimInfo.regionLocY * 256).ToString() + "], " +
"'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
"'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
// Destination // Destination
Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY); Console.WriteLine("CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + SimInfo.regionLocY);
@ -53,23 +53,23 @@ namespace OpenSim.Grid.UserServer
// Prepare notification // Prepare notification
Hashtable SimParams = new Hashtable(); Hashtable SimParams = new Hashtable();
SimParams["session_id"] = theUser.CurrentAgent.sessionID.ToString(); SimParams["session_id"] = theUser.currentAgent.sessionID.ToString();
SimParams["secure_session_id"] = theUser.CurrentAgent.secureSessionID.ToString(); SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString();
SimParams["firstname"] = theUser.Firstname; SimParams["firstname"] = theUser.username;
SimParams["lastname"] = theUser.Lastname; SimParams["lastname"] = theUser.surname;
SimParams["agent_id"] = theUser.UUID.ToString(); SimParams["agent_id"] = theUser.UUID.ToString();
SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode); SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response.CircuitCode);
SimParams["startpos_x"] = theUser.CurrentAgent.currentPos.X.ToString(); SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString();
SimParams["startpos_y"] = theUser.CurrentAgent.currentPos.Y.ToString(); SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString();
SimParams["startpos_z"] = theUser.CurrentAgent.currentPos.Z.ToString(); SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString();
SimParams["regionhandle"] = theUser.CurrentAgent.currentHandle.ToString(); SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString();
SimParams["caps_path"] = capsPath; SimParams["caps_path"] = capsPath;
ArrayList SendParams = new ArrayList(); ArrayList SendParams = new ArrayList();
SendParams.Add(SimParams); SendParams.Add(SimParams);
// Update agent with target sim // Update agent with target sim
theUser.CurrentAgent.currentRegion = SimInfo.UUID; theUser.currentAgent.currentRegion = SimInfo.UUID;
theUser.CurrentAgent.currentHandle = SimInfo.regionHandle; theUser.currentAgent.currentHandle = SimInfo.regionHandle;
System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI); System.Console.WriteLine("Informing region --> " + SimInfo.httpServerURI);
// Send // Send

View File

@ -83,31 +83,31 @@ namespace OpenSim.Grid.UserServer
Hashtable responseData = new Hashtable(); Hashtable responseData = new Hashtable();
// Account information // Account information
responseData["firstname"] = profile.Firstname; responseData["firstname"] = profile.username;
responseData["lastname"] = profile.Lastname; responseData["lastname"] = profile.surname;
responseData["uuid"] = profile.UUID.ToStringHyphenated(); responseData["uuid"] = profile.UUID.ToStringHyphenated();
// Server Information // Server Information
responseData["server_inventory"] = profile.UserInventoryUri; responseData["server_inventory"] = profile.userInventoryURI;
responseData["server_asset"] = profile.UserAssetUri; responseData["server_asset"] = profile.userAssetURI;
// Profile Information // Profile Information
responseData["profile_about"] = profile.ProfileAboutText; responseData["profile_about"] = profile.profileAboutText;
responseData["profile_firstlife_about"] = profile.ProfileFirstText; responseData["profile_firstlife_about"] = profile.profileFirstText;
responseData["profile_firstlife_image"] = profile.ProfileFirstImage.ToStringHyphenated(); responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated();
responseData["profile_can_do"] = profile.ProfileCanDoMask.ToString(); responseData["profile_can_do"] = profile.profileCanDoMask.ToString();
responseData["profile_want_do"] = profile.ProfileWantDoMask.ToString(); responseData["profile_want_do"] = profile.profileWantDoMask.ToString();
responseData["profile_image"] = profile.ProfileImage.ToStringHyphenated(); responseData["profile_image"] = profile.profileImage.ToStringHyphenated();
responseData["profile_created"] = profile.Created.ToString(); responseData["profile_created"] = profile.created.ToString();
responseData["profile_lastlogin"] = profile.LastLogin.ToString(); responseData["profile_lastlogin"] = profile.lastLogin.ToString();
// Home region information // Home region information
responseData["home_coordinates_x"] = profile.HomeLocation.X.ToString(); responseData["home_coordinates_x"] = profile.homeLocation.X.ToString();
responseData["home_coordinates_y"] = profile.HomeLocation.Y.ToString(); responseData["home_coordinates_y"] = profile.homeLocation.Y.ToString();
responseData["home_coordinates_z"] = profile.HomeLocation.Z.ToString(); responseData["home_coordinates_z"] = profile.homeLocation.Z.ToString();
responseData["home_region"] = profile.HomeRegion.ToString(); responseData["home_region"] = profile.homeRegion.ToString();
responseData["home_look_x"] = profile.HomeLookAt.X.ToString(); responseData["home_look_x"] = profile.homeLookAt.X.ToString();
responseData["home_look_y"] = profile.HomeLookAt.Y.ToString(); responseData["home_look_y"] = profile.homeLookAt.Y.ToString();
responseData["home_look_z"] = profile.HomeLookAt.Z.ToString(); responseData["home_look_z"] = profile.homeLookAt.Z.ToString();
response.Value = responseData; response.Value = responseData;
return response; return response;

View File

@ -70,26 +70,26 @@ namespace OpenSim.Region.Communications.Local
} }
else else
{ {
Console.WriteLine("Authenticating " + profile.Firstname + " " + profile.Lastname); Console.WriteLine("Authenticating " + profile.username + " " + profile.surname);
password = password.Remove(0, 3); //remove $1$ password = password.Remove(0, 3); //remove $1$
string s = Util.Md5Hash(password + ":" + profile.PasswordSalt); string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
return profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase); return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
} }
} }
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
{ {
ulong currentRegion = theUser.CurrentAgent.currentHandle; ulong currentRegion = theUser.currentAgent.currentHandle;
RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
if (reg != null) if (reg != null)
{ {
response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " + response.Home = "{'region_handle':[r" + (reg.RegionLocX * 256).ToString() + ",r" + (reg.RegionLocY * 256).ToString() + "], " +
"'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
"'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
string capsPath = Util.GetRandomCapsPath(); string capsPath = Util.GetRandomCapsPath();
response.SimAddress = reg.ExternalEndPoint.Address.ToString(); response.SimAddress = reg.ExternalEndPoint.Address.ToString();
response.SimPort = (Int32)reg.ExternalEndPoint.Port; response.SimPort = (Int32)reg.ExternalEndPoint.Port;
@ -99,8 +99,8 @@ namespace OpenSim.Region.Communications.Local
response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/"; response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CAPS/" + capsPath + "0000/";
// response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/"; // response.SeedCapability = "http://" + reg.ExternalHostName + ":" + this.serversInfo.HttpListenerPort.ToString() + "/CapsSeed/" + capsPath + "0000/";
theUser.CurrentAgent.currentRegion = reg.SimUUID; theUser.currentAgent.currentRegion = reg.SimUUID;
theUser.CurrentAgent.currentHandle = reg.RegionHandle; theUser.currentAgent.currentHandle = reg.RegionHandle;
Login _login = new Login(); Login _login = new Login();
//copy data to login object //copy data to login object

View File

@ -24,26 +24,26 @@ namespace OpenSim.Region.Communications.OGS1
} }
UserProfileData userData = new UserProfileData(); UserProfileData userData = new UserProfileData();
userData.Firstname = (string)data["firstname"]; userData.username = (string)data["firstname"];
userData.Lastname = (string)data["lastname"]; userData.surname = (string)data["lastname"];
userData.UUID = new LLUUID((string)data["uuid"]); userData.UUID = new LLUUID((string)data["uuid"]);
userData.UserInventoryUri = (string)data["server_inventory"]; userData.userInventoryURI = (string)data["server_inventory"];
userData.UserAssetUri = (string)data["server_asset"]; userData.userAssetURI = (string)data["server_asset"];
userData.ProfileFirstText = (string)data["profile_firstlife_about"]; userData.profileFirstText = (string)data["profile_firstlife_about"];
userData.ProfileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]);
userData.ProfileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]); userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]);
userData.ProfileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
userData.ProfileImage = new LLUUID((string)data["profile_image"]); userData.profileImage = new LLUUID((string)data["profile_image"]);
userData.LastLogin = Convert.ToInt32((string)data["profile_lastlogin"]); userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]);
userData.HomeRegion = Convert.ToUInt64((string)data["home_region"]); userData.homeRegion = Convert.ToUInt64((string)data["home_region"]);
userData.HomeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"])); userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"]));
userData.HomeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"])); userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"]));
return userData; return userData;
} }
public UserProfileData GetUserProfile(string firstName, string lastName) public UserProfileData GetUserProfile(string firstName, string lastName)
{ {
return GetUserProfile(firstName, lastName); return GetUserProfile(firstName + " " + lastName);
} }
public UserProfileData GetUserProfile(string name) public UserProfileData GetUserProfile(string name)
{ {