From 6bd4c6fee6b59c5b986df83c8471880b4b2e4f52 Mon Sep 17 00:00:00 2001
From: Sean Dague
Date: Tue, 28 Aug 2007 15:11:56 +0000
Subject: some changes which get us closer to Sqlite storage for users
---
OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 9 ++++++---
OpenSim/Framework/Data/UserProfileData.cs | 10 ++++++++--
OpenSim/Framework/UserManager/UserManagerBase.cs | 3 ++-
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
index bba5791..48dac87 100644
--- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
+++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs
@@ -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;
diff --git a/OpenSim/Framework/Data/UserProfileData.cs b/OpenSim/Framework/Data/UserProfileData.cs
index 3c1f1c7..9c72a5d 100644
--- a/OpenSim/Framework/Data/UserProfileData.cs
+++ b/OpenSim/Framework/Data/UserProfileData.cs
@@ -62,8 +62,14 @@ namespace OpenSim.Framework.Data
///
/// 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)); }
+ set {
+ System.Console.WriteLine("Don't know how to set homeRegion");
+ Helpers.UIntsToLong((homeRegionX * 256), (homeRegionY * 256));
+ }
+ }
public uint homeRegionX;
public uint homeRegionY;
///
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs
index 39681d5..94157fb 100644
--- a/OpenSim/Framework/UserManager/UserManagerBase.cs
+++ b/OpenSim/Framework/UserManager/UserManagerBase.cs
@@ -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 plugin in _plugins)
{
--
cgit v1.1