some changes which get us closer to Sqlite storage for users

afrisby
Sean Dague 2007-08-28 15:11:56 +00:00
parent e4fea6d11b
commit 6bd4c6fee6
3 changed files with 16 additions and 6 deletions

View File

@ -300,7 +300,8 @@ namespace OpenSim.Framework.Data.SQLite
createCol(users, "passwordHash", typeof(System.String));
createCol(users, "passwordSalt", typeof(System.String));
createCol(users, "homeRegion", typeof(System.Int64));
createCol(users, "homeRegionX", typeof(System.Int32));
createCol(users, "homeRegionY", typeof(System.Int32));
createCol(users, "homeLocationX", typeof(System.Double));
createCol(users, "homeLocationY", typeof(System.Double));
createCol(users, "homeLocationZ", typeof(System.Double));
@ -368,7 +369,8 @@ namespace OpenSim.Framework.Data.SQLite
user.passwordHash = (String)row["passwordHash"];
user.passwordSalt = (String)row["passwordSalt"];
// user.homeRegion = Convert.ToUInt64(row["homeRegion"]);
user.homeRegionX = Convert.ToUInt32(row["homeRegionX"]);
user.homeRegionY = Convert.ToUInt32(row["homeRegionY"]);
user.homeLocation = new LLVector3(
Convert.ToSingle(row["homeLocationX"]),
Convert.ToSingle(row["homeLocationY"]),
@ -402,7 +404,8 @@ namespace OpenSim.Framework.Data.SQLite
row["passwordSalt"] = user.passwordSalt;
row["homeRegion"] = user.homeRegion;
row["homeRegionX"] = user.homeRegionX;
row["homeRegionY"] = user.homeRegionY;
row["homeLocationX"] = user.homeLocation.X;
row["homeLocationY"] = user.homeLocation.Y;
row["homeLocationZ"] = user.homeLocation.Z;

View File

@ -62,8 +62,14 @@ namespace OpenSim.Framework.Data
/// <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
/// </summary>
public ulong homeRegion;
public ulong homeRegion
{
get { return Helpers.UIntsToLong((homeRegionX * 256), (homeRegionY * 256)); }
set {
System.Console.WriteLine("Don't know how to set homeRegion");
Helpers.UIntsToLong((homeRegionX * 256), (homeRegionY * 256));
}
}
public uint homeRegionX;
public uint homeRegionY;
/// <summary>

View File

@ -353,7 +353,8 @@ namespace OpenSim.Framework.UserManagement
user.passwordSalt = "";
user.created = Util.UnixTimeSinceEpoch();
user.homeLookAt = new LLVector3(100, 100, 100);
user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
user.homeRegionX = regX;
user.homeRegionY = regY;
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{