From d4a4aafaf15360c0f5db22145a60bae87e6bb9c6 Mon Sep 17 00:00:00 2001
From: lbsa71
Date: Fri, 5 Oct 2007 13:54:16 +0000
Subject: * So, ok, maybe renaming serialized fields on a friday wasn't the
smartest of things. Reverting 2056.
---
.../Communications/CommunicationsManager.cs | 4 +-
OpenSim/Framework/Communications/LoginService.cs | 572 ++++++++++-----------
.../Framework/Communications/UserManagerBase.cs | 32 +-
OpenSim/Framework/Data.DB4o/DB4oUserData.cs | 6 +-
OpenSim/Framework/Data.MySQL/MySQLManager.cs | 34 +-
OpenSim/Framework/Data.MySQL/MySQLUserData.cs | 6 +-
OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 102 ++--
OpenSim/Framework/General/Types/UserProfileData.cs | 48 +-
8 files changed, 402 insertions(+), 402 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 010d5ce..5af07f7 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -162,8 +162,8 @@ namespace OpenSim.Framework.Communications
if (profileData != null)
{
LLUUID profileId = profileData.UUID;
- string firstname = profileData.Firstname;
- string lastname = profileData.Lastname;
+ string firstname = profileData.username;
+ string lastname = profileData.surname;
remote_client.SendNameReply(profileId, firstname, lastname);
}
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 31c9363..06abb69 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -1,287 +1,287 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Security.Cryptography;
-using libsecondlife;
-using Nwc.XmlRpc;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Interfaces;
-using OpenSim.Framework.Inventory;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Security.Cryptography;
+using libsecondlife;
+using Nwc.XmlRpc;
+using OpenSim.Framework.Console;
+using OpenSim.Framework.Interfaces;
+using OpenSim.Framework.Inventory;
using OpenSim.Framework.Types;
-using OpenSim.Framework.Utilities;
-
-using OpenSim.Framework.Configuration;
-using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
-
-namespace OpenSim.Framework.UserManagement
-{
- public class LoginService
- {
- protected string m_welcomeMessage = "Welcome to OpenSim";
- protected UserManagerBase m_userManager = null;
-
- public LoginService(UserManagerBase userManager, string welcomeMess)
- {
- m_userManager = userManager;
- if (welcomeMess != "")
- {
- m_welcomeMessage = welcomeMess;
- }
- }
-
- ///
- /// Main user login function
- ///
- /// The XMLRPC request
- /// The response to send
- public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
- {
-
- System.Console.WriteLine("Attempting login now...");
- XmlRpcResponse response = new XmlRpcResponse();
- Hashtable requestData = (Hashtable)request.Params[0];
-
- bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
- bool GoodLogin = false;
-
- UserProfileData userProfile;
- LoginResponse logResponse = new LoginResponse();
-
- if (GoodXML)
- {
- string firstname = (string)requestData["first"];
- string lastname = (string)requestData["last"];
- string passwd = (string)requestData["passwd"];
-
- userProfile = GetTheUser(firstname, lastname);
- if (userProfile == null)
- return logResponse.CreateLoginFailedResponse();
-
- GoodLogin = AuthenticateUser(userProfile, passwd);
- }
- else
- {
- return logResponse.CreateGridErrorResponse();
- }
-
- if (!GoodLogin)
- {
- return logResponse.CreateLoginFailedResponse();
- }
- else
- {
- // If we already have a session...
- if (userProfile.CurrentAgent != null && userProfile.CurrentAgent.agentOnline)
- {
- // Reject the login
- return logResponse.CreateAlreadyLoggedInResponse();
- }
- // Otherwise...
- // Create a new agent session
- CreateAgent(userProfile, request);
-
- try
- {
- LLUUID agentID = userProfile.UUID;
-
- // Inventory Library Section
- InventoryData inventData = this.CreateInventoryData(agentID);
- ArrayList AgentInventoryArray = inventData.InventoryArray;
-
- Hashtable InventoryRootHash = new Hashtable();
- InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
- ArrayList InventoryRoot = new ArrayList();
- InventoryRoot.Add(InventoryRootHash);
- userProfile.RootInventoryFolderId = inventData.RootFolderID;
-
- // Circuit Code
- uint circode = (uint)(Util.RandomClass.Next());
-
- logResponse.Lastname = userProfile.Lastname;
- logResponse.Firstname = userProfile.Firstname;
- logResponse.AgentID = agentID.ToStringHyphenated();
- logResponse.SessionID = userProfile.CurrentAgent.sessionID.ToStringHyphenated();
- logResponse.SecureSessionID = userProfile.CurrentAgent.secureSessionID.ToStringHyphenated();
- logResponse.InventoryRoot = InventoryRoot;
- logResponse.InventorySkeleton = AgentInventoryArray;
- logResponse.InventoryLibrary = this.GetInventoryLibrary();
- logResponse.InventoryLibraryOwner = this.GetLibraryOwner();
- logResponse.CircuitCode = (Int32)circode;
- //logResponse.RegionX = 0; //overwritten
- //logResponse.RegionY = 0; //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.SimAddress = "127.0.0.1"; //overwritten
- //logResponse.SimPort = 0; //overwritten
- logResponse.Message = this.GetMessage();
-
- try
- {
- this.CustomiseResponse(logResponse, userProfile);
- }
- catch (Exception e)
- {
- System.Console.WriteLine(e.ToString());
- return logResponse.CreateDeadRegionResponse();
- //return logResponse.ToXmlRpcResponse();
- }
- CommitAgent(ref userProfile);
- return logResponse.ToXmlRpcResponse();
-
- }
-
- catch (Exception E)
- {
- System.Console.WriteLine(E.ToString());
- }
- //}
- }
- return response;
-
- }
-
- ///
- /// Customises the login response and fills in missing values.
- ///
- /// The existing response
- /// The user profile
- public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser)
- {
- }
-
- ///
- /// Saves a target agent to the database
- ///
- /// The users profile
- /// Successful?
- public bool CommitAgent(ref UserProfileData profile)
- {
- // Saves the agent to database
- return true;
- }
-
-
- ///
- /// Checks a user against it's password hash
- ///
- /// The users profile
- /// The supplied password
- /// Authenticated?
- public virtual bool AuthenticateUser(UserProfileData profile, string password)
- {
-
- MainLog.Instance.Verbose(
- "Authenticating " + profile.Firstname + " " + profile.Lastname);
-
- password = password.Remove(0, 3); //remove $1$
-
- string s = Util.Md5Hash(password + ":" + profile.PasswordSalt);
-
- return profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
- }
-
- ///
- ///
- ///
- ///
- ///
- public void CreateAgent(UserProfileData profile, XmlRpcRequest request)
- {
- this.m_userManager.CreateAgent(profile, request);
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public virtual UserProfileData GetTheUser(string firstname, string lastname)
- {
- return this.m_userManager.GetUserProfile(firstname, lastname);
- }
-
- ///
- ///
- ///
- ///
- public virtual string GetMessage()
- {
- return m_welcomeMessage;
- }
-
- ///
- ///
- ///
- ///
- protected virtual ArrayList GetInventoryLibrary()
- {
- //return new ArrayList();
- Hashtable TempHash = new Hashtable();
- TempHash["name"] = "OpenSim Library";
- TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated();
- TempHash["version"] = 1;
- TempHash["type_default"] = -1;
- TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
- ArrayList temp = new ArrayList();
- temp.Add(TempHash);
-
- TempHash = new Hashtable();
- TempHash["name"] = "Texture Library";
- TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
- TempHash["version"] = 1;
- TempHash["type_default"] = -1;
- TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
- temp.Add(TempHash);
- return temp;
- }
-
- ///
- ///
- ///
- ///
- protected virtual ArrayList GetLibraryOwner()
- {
- //for now create random inventory library owner
- Hashtable TempHash = new Hashtable();
- TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000";
- ArrayList inventoryLibOwner = new ArrayList();
- inventoryLibOwner.Add(TempHash);
- return inventoryLibOwner;
- }
-
- protected virtual InventoryData CreateInventoryData(LLUUID userID)
- {
- AgentInventory userInventory = new AgentInventory();
- userInventory.CreateRootFolder(userID, false);
-
- ArrayList AgentInventoryArray = new ArrayList();
- Hashtable TempHash;
- foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
- {
- TempHash = new Hashtable();
- TempHash["name"] = InvFolder.FolderName;
- TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
- TempHash["version"] = (Int32)InvFolder.Version;
- TempHash["type_default"] = (Int32)InvFolder.DefaultType;
- TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
- AgentInventoryArray.Add(TempHash);
- }
-
- return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
- }
-
- public class InventoryData
- {
- public ArrayList InventoryArray = null;
- public LLUUID RootFolderID = LLUUID.Zero;
-
- public InventoryData(ArrayList invList, LLUUID rootID)
- {
- InventoryArray = invList;
- RootFolderID = rootID;
- }
- }
- }
-}
+using OpenSim.Framework.Utilities;
+
+using OpenSim.Framework.Configuration;
+using InventoryFolder = OpenSim.Framework.Inventory.InventoryFolder;
+
+namespace OpenSim.Framework.UserManagement
+{
+ public class LoginService
+ {
+ protected string m_welcomeMessage = "Welcome to OpenSim";
+ protected UserManagerBase m_userManager = null;
+
+ public LoginService(UserManagerBase userManager, string welcomeMess)
+ {
+ m_userManager = userManager;
+ if (welcomeMess != "")
+ {
+ m_welcomeMessage = welcomeMess;
+ }
+ }
+
+ ///
+ /// Main user login function
+ ///
+ /// The XMLRPC request
+ /// The response to send
+ public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
+ {
+
+ System.Console.WriteLine("Attempting login now...");
+ XmlRpcResponse response = new XmlRpcResponse();
+ Hashtable requestData = (Hashtable)request.Params[0];
+
+ bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
+ bool GoodLogin = false;
+
+ UserProfileData userProfile;
+ LoginResponse logResponse = new LoginResponse();
+
+ if (GoodXML)
+ {
+ string firstname = (string)requestData["first"];
+ string lastname = (string)requestData["last"];
+ string passwd = (string)requestData["passwd"];
+
+ userProfile = GetTheUser(firstname, lastname);
+ if (userProfile == null)
+ return logResponse.CreateLoginFailedResponse();
+
+ GoodLogin = AuthenticateUser(userProfile, passwd);
+ }
+ else
+ {
+ return logResponse.CreateGridErrorResponse();
+ }
+
+ if (!GoodLogin)
+ {
+ return logResponse.CreateLoginFailedResponse();
+ }
+ else
+ {
+ // If we already have a session...
+ if (userProfile.currentAgent != null && userProfile.currentAgent.agentOnline)
+ {
+ // Reject the login
+ return logResponse.CreateAlreadyLoggedInResponse();
+ }
+ // Otherwise...
+ // Create a new agent session
+ CreateAgent(userProfile, request);
+
+ try
+ {
+ LLUUID agentID = userProfile.UUID;
+
+ // Inventory Library Section
+ InventoryData inventData = this.CreateInventoryData(agentID);
+ ArrayList AgentInventoryArray = inventData.InventoryArray;
+
+ Hashtable InventoryRootHash = new Hashtable();
+ InventoryRootHash["folder_id"] = inventData.RootFolderID.ToStringHyphenated();
+ ArrayList InventoryRoot = new ArrayList();
+ InventoryRoot.Add(InventoryRootHash);
+ userProfile.rootInventoryFolderID = inventData.RootFolderID;
+
+ // Circuit Code
+ uint circode = (uint)(Util.RandomClass.Next());
+
+ logResponse.Lastname = userProfile.surname;
+ logResponse.Firstname = userProfile.username;
+ logResponse.AgentID = agentID.ToStringHyphenated();
+ logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated();
+ logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated();
+ logResponse.InventoryRoot = InventoryRoot;
+ logResponse.InventorySkeleton = AgentInventoryArray;
+ logResponse.InventoryLibrary = this.GetInventoryLibrary();
+ logResponse.InventoryLibraryOwner = this.GetLibraryOwner();
+ logResponse.CircuitCode = (Int32)circode;
+ //logResponse.RegionX = 0; //overwritten
+ //logResponse.RegionY = 0; //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.SimAddress = "127.0.0.1"; //overwritten
+ //logResponse.SimPort = 0; //overwritten
+ logResponse.Message = this.GetMessage();
+
+ try
+ {
+ this.CustomiseResponse(logResponse, userProfile);
+ }
+ catch (Exception e)
+ {
+ System.Console.WriteLine(e.ToString());
+ return logResponse.CreateDeadRegionResponse();
+ //return logResponse.ToXmlRpcResponse();
+ }
+ CommitAgent(ref userProfile);
+ return logResponse.ToXmlRpcResponse();
+
+ }
+
+ catch (Exception E)
+ {
+ System.Console.WriteLine(E.ToString());
+ }
+ //}
+ }
+ return response;
+
+ }
+
+ ///
+ /// Customises the login response and fills in missing values.
+ ///
+ /// The existing response
+ /// The user profile
+ public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser)
+ {
+ }
+
+ ///
+ /// Saves a target agent to the database
+ ///
+ /// The users profile
+ /// Successful?
+ public bool CommitAgent(ref UserProfileData profile)
+ {
+ // Saves the agent to database
+ return true;
+ }
+
+
+ ///
+ /// Checks a user against it's password hash
+ ///
+ /// The users profile
+ /// The supplied password
+ /// Authenticated?
+ public virtual bool AuthenticateUser(UserProfileData profile, string password)
+ {
+
+ MainLog.Instance.Verbose(
+ "Authenticating " + profile.username + " " + profile.surname);
+
+ password = password.Remove(0, 3); //remove $1$
+
+ string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
+
+ return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void CreateAgent(UserProfileData profile, XmlRpcRequest request)
+ {
+ this.m_userManager.CreateAgent(profile, request);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public virtual UserProfileData GetTheUser(string firstname, string lastname)
+ {
+ return this.m_userManager.GetUserProfile(firstname, lastname);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public virtual string GetMessage()
+ {
+ return m_welcomeMessage;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ protected virtual ArrayList GetInventoryLibrary()
+ {
+ //return new ArrayList();
+ Hashtable TempHash = new Hashtable();
+ TempHash["name"] = "OpenSim Library";
+ TempHash["parent_id"] = LLUUID.Zero.ToStringHyphenated();
+ TempHash["version"] = 1;
+ TempHash["type_default"] = -1;
+ TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
+ ArrayList temp = new ArrayList();
+ temp.Add(TempHash);
+
+ TempHash = new Hashtable();
+ TempHash["name"] = "Texture Library";
+ TempHash["parent_id"] = "00000112-000f-0000-0000-000100bba000";
+ TempHash["version"] = 1;
+ TempHash["type_default"] = -1;
+ TempHash["folder_id"] = "00000112-000f-0000-0000-000100bba001";
+ temp.Add(TempHash);
+ return temp;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ protected virtual ArrayList GetLibraryOwner()
+ {
+ //for now create random inventory library owner
+ Hashtable TempHash = new Hashtable();
+ TempHash["agent_id"] = "11111111-1111-0000-0000-000100bba000";
+ ArrayList inventoryLibOwner = new ArrayList();
+ inventoryLibOwner.Add(TempHash);
+ return inventoryLibOwner;
+ }
+
+ protected virtual InventoryData CreateInventoryData(LLUUID userID)
+ {
+ AgentInventory userInventory = new AgentInventory();
+ userInventory.CreateRootFolder(userID, false);
+
+ ArrayList AgentInventoryArray = new ArrayList();
+ Hashtable TempHash;
+ foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values)
+ {
+ TempHash = new Hashtable();
+ TempHash["name"] = InvFolder.FolderName;
+ TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
+ TempHash["version"] = (Int32)InvFolder.Version;
+ TempHash["type_default"] = (Int32)InvFolder.DefaultType;
+ TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
+ AgentInventoryArray.Add(TempHash);
+ }
+
+ return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID);
+ }
+
+ public class InventoryData
+ {
+ public ArrayList InventoryArray = null;
+ public LLUUID RootFolderID = LLUUID.Zero;
+
+ public InventoryData(ArrayList invList, LLUUID rootID)
+ {
+ InventoryArray = invList;
+ RootFolderID = rootID;
+ }
+ }
+ }
+}
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index d04101c..56ed959 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Framework.UserManagement
try
{
UserProfileData profile = plugin.Value.GetUserByUUID(uuid);
- profile.CurrentAgent = getUserAgent(profile.UUID);
+ profile.currentAgent = getUserAgent(profile.UUID);
return profile;
}
catch (Exception e)
@@ -121,7 +121,7 @@ namespace OpenSim.Framework.UserManagement
try
{
UserProfileData profile = plugin.Value.GetUserByName(name);
- profile.CurrentAgent = getUserAgent(profile.UUID);
+ profile.currentAgent = getUserAgent(profile.UUID);
return profile;
}
catch (Exception e)
@@ -148,7 +148,7 @@ namespace OpenSim.Framework.UserManagement
{
UserProfileData profile = plugin.Value.GetUserByName(fname,lname);
- profile.CurrentAgent = getUserAgent(profile.UUID);
+ profile.currentAgent = getUserAgent(profile.UUID);
return profile;
}
@@ -233,7 +233,7 @@ namespace OpenSim.Framework.UserManagement
public void clearUserAgent(LLUUID agentID)
{
UserProfileData profile = GetUserProfile(agentID);
- profile.CurrentAgent = null;
+ profile.currentAgent = null;
setUserProfile(profile);
}
@@ -292,8 +292,8 @@ namespace OpenSim.Framework.UserManagement
agent.UUID = profile.UUID;
// Current position (from Home)
- agent.currentHandle = profile.HomeRegion;
- agent.currentPos = profile.HomeLocation;
+ agent.currentHandle = profile.homeRegion;
+ agent.currentPos = profile.homeLocation;
// If user specified additional start, use that
if (requestData.ContainsKey("start"))
@@ -326,7 +326,7 @@ namespace OpenSim.Framework.UserManagement
agent.regionID = new LLUUID(); // Fill in later
agent.currentRegion = new LLUUID(); // Fill in later
- profile.CurrentAgent = agent;
+ profile.currentAgent = agent;
}
///
@@ -349,16 +349,16 @@ namespace OpenSim.Framework.UserManagement
public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
{
UserProfileData user = new UserProfileData();
- user.HomeLocation = new LLVector3(128, 128, 100);
+ user.homeLocation = new LLVector3(128, 128, 100);
user.UUID = LLUUID.Random();
- user.Firstname = firstName;
- user.Lastname = lastName;
- user.PasswordHash = pass;
- user.PasswordSalt = "";
- user.Created = Util.UnixTimeSinceEpoch();
- user.HomeLookAt = new LLVector3(100, 100, 100);
- user.HomeRegionX = regX;
- user.HomeRegionY = regY;
+ user.username = firstName;
+ user.surname = lastName;
+ user.passwordHash = pass;
+ user.passwordSalt = "";
+ user.created = Util.UnixTimeSinceEpoch();
+ user.homeLookAt = new LLVector3(100, 100, 100);
+ user.homeRegionX = regX;
+ user.homeRegionY = regY;
foreach (KeyValuePair plugin in _plugins)
{
diff --git a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
index e6a856d..38f1b55 100644
--- a/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
+++ b/OpenSim/Framework/Data.DB4o/DB4oUserData.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Data.DB4o
{
foreach (UserProfileData profile in manager.userProfiles.Values)
{
- if (profile.Firstname == fname && profile.Lastname == lname)
+ if (profile.username == fname && profile.surname == lname)
return profile;
}
return null;
@@ -98,7 +98,7 @@ namespace OpenSim.Framework.Data.DB4o
{
try
{
- return GetUserByUUID(uuid).CurrentAgent;
+ return GetUserByUUID(uuid).currentAgent;
}
catch (Exception)
{
@@ -126,7 +126,7 @@ namespace OpenSim.Framework.Data.DB4o
{
try
{
- return GetUserByName(fname,lname).CurrentAgent;
+ return GetUserByName(fname,lname).currentAgent;
}
catch (Exception)
{
diff --git a/OpenSim/Framework/Data.MySQL/MySQLManager.cs b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
index e733a83..a83ee45 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLManager.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLManager.cs
@@ -313,36 +313,36 @@ namespace OpenSim.Framework.Data.MySQL
if (reader.Read())
{
retval.UUID = new LLUUID((string)reader["UUID"]);
- retval.Firstname = (string)reader["username"];
- retval.Lastname = (string)reader["lastname"];
+ retval.username = (string)reader["username"];
+ retval.surname = (string)reader["lastname"];
- retval.PasswordHash = (string)reader["passwordHash"];
- retval.PasswordSalt = (string)reader["passwordSalt"];
+ retval.passwordHash = (string)reader["passwordHash"];
+ retval.passwordSalt = (string)reader["passwordSalt"];
- retval.HomeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
- retval.HomeLocation = new LLVector3(
+ retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
+ retval.homeLocation = new LLVector3(
Convert.ToSingle(reader["homeLocationX"].ToString()),
Convert.ToSingle(reader["homeLocationY"].ToString()),
Convert.ToSingle(reader["homeLocationZ"].ToString()));
- retval.HomeLookAt = new LLVector3(
+ retval.homeLookAt = new LLVector3(
Convert.ToSingle(reader["homeLookAtX"].ToString()),
Convert.ToSingle(reader["homeLookAtY"].ToString()),
Convert.ToSingle(reader["homeLookAtZ"].ToString()));
- retval.Created = Convert.ToInt32(reader["created"].ToString());
- retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
+ retval.created = Convert.ToInt32(reader["created"].ToString());
+ retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
- retval.UserInventoryUri = (string)reader["userInventoryURI"];
- retval.UserAssetUri = (string)reader["userAssetURI"];
+ retval.userInventoryURI = (string)reader["userInventoryURI"];
+ retval.userAssetURI = (string)reader["userAssetURI"];
- retval.ProfileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
- retval.ProfileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
+ retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
+ retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
- retval.ProfileAboutText = (string)reader["profileAboutText"];
- retval.ProfileFirstText = (string)reader["profileFirstText"];
+ retval.profileAboutText = (string)reader["profileAboutText"];
+ retval.profileFirstText = (string)reader["profileFirstText"];
- retval.ProfileImage = new LLUUID((string)reader["profileImage"]);
- retval.ProfileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
+ retval.profileImage = new LLUUID((string)reader["profileImage"]);
+ retval.profileFirstImage = new LLUUID((string)reader["profileFirstImage"]);
}
else
diff --git a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
index ae24367..301550f 100644
--- a/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
+++ b/OpenSim/Framework/Data.MySQL/MySQLUserData.cs
@@ -204,9 +204,9 @@ namespace OpenSim.Framework.Data.MySQL
{
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,
- 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);
+ 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.profileAboutText, user.profileFirstText, user.profileImage, user.profileFirstImage);
}
}
catch (Exception e)
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index 1899733..c7b7659 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Framework.Data.SQLite
UserProfileData user = buildUserProfile(row);
row = ds.Tables["useragents"].Rows.Find(uuid);
if(row != null) {
- user.CurrentAgent = buildUserAgent(row);
+ user.currentAgent = buildUserAgent(row);
}
return user;
} else {
@@ -119,7 +119,7 @@ namespace OpenSim.Framework.Data.SQLite
UserProfileData user = buildUserProfile(rows[0]);
DataRow row = ds.Tables["useragents"].Rows.Find(user.UUID);
if(row != null) {
- user.CurrentAgent = buildUserAgent(row);
+ user.currentAgent = buildUserAgent(row);
}
return user;
} else {
@@ -137,7 +137,7 @@ namespace OpenSim.Framework.Data.SQLite
{
try
{
- return GetUserByUUID(uuid).CurrentAgent;
+ return GetUserByUUID(uuid).currentAgent;
}
catch (Exception)
{
@@ -165,7 +165,7 @@ namespace OpenSim.Framework.Data.SQLite
{
try
{
- return GetUserByName(fname,lname).CurrentAgent;
+ return GetUserByName(fname,lname).currentAgent;
}
catch (Exception)
{
@@ -193,18 +193,18 @@ namespace OpenSim.Framework.Data.SQLite
fillUserRow(row, user);
}
- if(user.CurrentAgent != null) {
+ if(user.currentAgent != null) {
DataTable ua = ds.Tables["useragents"];
row = ua.Rows.Find(user.UUID);
if (row == null)
{
row = ua.NewRow();
- fillUserAgentRow(row, user.CurrentAgent);
+ fillUserAgentRow(row, user.currentAgent);
ua.Rows.Add(row);
}
else
{
- fillUserAgentRow(row, user.CurrentAgent);
+ fillUserAgentRow(row, user.currentAgent);
}
}
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, "userAssetURI", typeof(System.String));
createCol(users, "profileCanDoMask", typeof(System.Int32));
- createCol(users, "ProfileWantDoMask", typeof(System.Int32));
- createCol(users, "ProfileAboutText", typeof(System.String));
+ createCol(users, "profileWantDoMask", typeof(System.Int32));
+ createCol(users, "profileAboutText", typeof(System.String));
createCol(users, "profileFirstText", typeof(System.String));
createCol(users, "profileImage", 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.
UserProfileData user = new UserProfileData();
user.UUID = new LLUUID((String)row["UUID"]);
- user.Firstname = (String)row["username"];
- user.Lastname = (String)row["surname"];
- user.PasswordHash = (String)row["passwordHash"];
- user.PasswordSalt = (String)row["passwordSalt"];
+ user.username = (String)row["username"];
+ user.surname = (String)row["surname"];
+ user.passwordHash = (String)row["passwordHash"];
+ user.passwordSalt = (String)row["passwordSalt"];
- user.HomeRegionX = Convert.ToUInt32(row["homeRegionX"]);
- user.HomeRegionY = Convert.ToUInt32(row["homeRegionY"]);
- user.HomeLocation = new LLVector3(
+ user.homeRegionX = Convert.ToUInt32(row["homeRegionX"]);
+ user.homeRegionY = Convert.ToUInt32(row["homeRegionY"]);
+ user.homeLocation = new LLVector3(
Convert.ToSingle(row["homeLocationX"]),
Convert.ToSingle(row["homeLocationY"]),
Convert.ToSingle(row["homeLocationZ"])
);
- user.HomeLookAt = new LLVector3(
+ user.homeLookAt = new LLVector3(
Convert.ToSingle(row["homeLookAtX"]),
Convert.ToSingle(row["homeLookAtY"]),
Convert.ToSingle(row["homeLookAtZ"])
);
- user.Created = Convert.ToInt32(row["created"]);
- user.LastLogin = Convert.ToInt32(row["lastLogin"]);
- user.RootInventoryFolderId = new LLUUID((String)row["rootInventoryFolderID"]);
- user.UserInventoryUri = (String)row["userInventoryURI"];
- user.UserAssetUri = (String)row["userAssetURI"];
- user.ProfileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
- user.ProfileWantDoMask = Convert.ToUInt32(row["ProfileWantDoMask"]);
- user.ProfileAboutText = (String)row["ProfileAboutText"];
- user.ProfileFirstText = (String)row["profileFirstText"];
- user.ProfileImage = new LLUUID((String)row["profileImage"]);
- user.ProfileFirstImage = new LLUUID((String)row["profileFirstImage"]);
+ user.created = Convert.ToInt32(row["created"]);
+ user.lastLogin = Convert.ToInt32(row["lastLogin"]);
+ user.rootInventoryFolderID = new LLUUID((String)row["rootInventoryFolderID"]);
+ user.userInventoryURI = (String)row["userInventoryURI"];
+ user.userAssetURI = (String)row["userAssetURI"];
+ user.profileCanDoMask = Convert.ToUInt32(row["profileCanDoMask"]);
+ user.profileWantDoMask = Convert.ToUInt32(row["profileWantDoMask"]);
+ user.profileAboutText = (String)row["profileAboutText"];
+ user.profileFirstText = (String)row["profileFirstText"];
+ user.profileImage = new LLUUID((String)row["profileImage"]);
+ user.profileFirstImage = new LLUUID((String)row["profileFirstImage"]);
return user;
}
private void fillUserRow(DataRow row, UserProfileData user)
{
row["UUID"] = user.UUID;
- row["username"] = user.Firstname;
- row["surname"] = user.Lastname;
- row["passwordHash"] = user.PasswordHash;
- row["passwordSalt"] = user.PasswordSalt;
+ row["username"] = user.username;
+ row["surname"] = user.surname;
+ row["passwordHash"] = user.passwordHash;
+ row["passwordSalt"] = user.passwordSalt;
- row["homeRegionX"] = user.HomeRegionX;
- row["homeRegionY"] = user.HomeRegionY;
- row["homeLocationX"] = user.HomeLocation.X;
- row["homeLocationY"] = user.HomeLocation.Y;
- row["homeLocationZ"] = user.HomeLocation.Z;
- row["homeLookAtX"] = user.HomeLookAt.X;
- row["homeLookAtY"] = user.HomeLookAt.Y;
- row["homeLookAtZ"] = user.HomeLookAt.Z;
+ row["homeRegionX"] = user.homeRegionX;
+ row["homeRegionY"] = user.homeRegionY;
+ row["homeLocationX"] = user.homeLocation.X;
+ row["homeLocationY"] = user.homeLocation.Y;
+ row["homeLocationZ"] = user.homeLocation.Z;
+ row["homeLookAtX"] = user.homeLookAt.X;
+ row["homeLookAtY"] = user.homeLookAt.Y;
+ row["homeLookAtZ"] = user.homeLookAt.Z;
- row["created"] = user.Created;
- row["lastLogin"] = user.LastLogin;
- row["rootInventoryFolderID"] = user.RootInventoryFolderId;
- row["userInventoryURI"] = user.UserInventoryUri;
- row["userAssetURI"] = user.UserAssetUri;
- row["profileCanDoMask"] = user.ProfileCanDoMask;
- row["ProfileWantDoMask"] = user.ProfileWantDoMask;
- row["ProfileAboutText"] = user.ProfileAboutText;
- row["profileFirstText"] = user.ProfileFirstText;
- row["profileImage"] = user.ProfileImage;
- row["profileFirstImage"] = user.ProfileFirstImage;
+ row["created"] = user.created;
+ row["lastLogin"] = user.lastLogin;
+ row["rootInventoryFolderID"] = user.rootInventoryFolderID;
+ row["userInventoryURI"] = user.userInventoryURI;
+ row["userAssetURI"] = user.userAssetURI;
+ row["profileCanDoMask"] = user.profileCanDoMask;
+ row["profileWantDoMask"] = user.profileWantDoMask;
+ row["profileAboutText"] = user.profileAboutText;
+ row["profileFirstText"] = user.profileFirstText;
+ row["profileImage"] = user.profileImage;
+ row["profileFirstImage"] = user.profileFirstImage;
// ADO.NET doesn't handle NULL very well
foreach (DataColumn col in ds.Tables["users"].Columns) {
diff --git a/OpenSim/Framework/General/Types/UserProfileData.cs b/OpenSim/Framework/General/Types/UserProfileData.cs
index 7996975..20d8224 100644
--- a/OpenSim/Framework/General/Types/UserProfileData.cs
+++ b/OpenSim/Framework/General/Types/UserProfileData.cs
@@ -43,94 +43,94 @@ namespace OpenSim.Framework.Types
///
/// The first component of a users account name
///
- public string Firstname;
+ public string username;
///
/// The second component of a users account name
///
- public string Lastname;
+ public string surname;
///
/// A salted hash containing the users password, in the format md5(md5(password) + ":" + salt)
///
/// This is double MD5'd because the client sends an unsalted MD5 to the loginserver
- public string PasswordHash;
+ public string passwordHash;
///
/// The salt used for the users hash, should be 32 bytes or longer
///
- public string PasswordSalt;
+ public string passwordSalt;
///
/// 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
///
- public ulong HomeRegion
+ public ulong homeRegion
{
- get { return Helpers.UIntsToLong((HomeRegionX * 256), (HomeRegionY * 256)); }
+ get { return Helpers.UIntsToLong((homeRegionX * 256), (homeRegionY * 256)); }
set {
- HomeRegionX = (uint)(value >> 40);
- HomeRegionY = (((uint)(value)) >> 8);
+ homeRegionX = (uint)(value >> 40);
+ homeRegionY = (((uint)(value)) >> 8);
}
}
- public uint HomeRegionX;
- public uint HomeRegionY;
+ public uint homeRegionX;
+ public uint homeRegionY;
///
/// The coordinates inside the region of the home location
///
- public LLVector3 HomeLocation;
+ public LLVector3 homeLocation;
///
/// Where the user will be looking when they rez.
///
- public LLVector3 HomeLookAt;
+ public LLVector3 homeLookAt;
///
/// A UNIX Timestamp (seconds since epoch) for the users creation
///
- public int Created;
+ public int created;
///
/// A UNIX Timestamp for the users last login date / time
///
- public int LastLogin;
+ public int lastLogin;
- public LLUUID RootInventoryFolderId;
+ public LLUUID rootInventoryFolderID;
///
/// A URI to the users inventory server, used for foreigners and large grids
///
- public string UserInventoryUri = String.Empty;
+ public string userInventoryURI = String.Empty;
///
/// A URI to the users asset server, used for foreigners and large grids.
///
- public string UserAssetUri = String.Empty;
+ public string userAssetURI = String.Empty;
///
/// A uint mask containing the "I can do" fields of the users profile
///
- public uint ProfileCanDoMask;
+ public uint profileCanDoMask;
///
/// A uint mask containing the "I want to do" part of the users profile
///
- public uint ProfileWantDoMask; // Profile window "I want to" mask
+ public uint profileWantDoMask; // Profile window "I want to" mask
///
/// The about text listed in a users profile.
///
- public string ProfileAboutText = String.Empty;
+ public string profileAboutText = String.Empty;
///
/// The first life about text listed in a users profile
///
- public string ProfileFirstText = String.Empty;
+ public string profileFirstText = String.Empty;
///
/// The profile image for an avatar stored on the asset server
///
- public LLUUID ProfileImage;
+ public LLUUID profileImage;
///
/// The profile image for the users first life tab
///
- public LLUUID ProfileFirstImage;
+ public LLUUID profileFirstImage;
///
/// The users last registered agent (filled in on the user server)
///
- public UserAgentData CurrentAgent;
+ public UserAgentData currentAgent;
}
///
--
cgit v1.1