From f1ebe79824aa82fa30af35d07bf6720e719cd741 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 20 Dec 2007 19:13:34 +0000 Subject: Fix up other sqlite db interactions to use non-hyphenated uuid Inventory contents retrieval and persistent region storage standalone now appear to work as well as they did before :) This patch will not fix grid problems. May be bugs present due to conversions I didn't spot. I personally probably don't have any more time for this today. I'm also not entirely convinced this is the right way forward so this might be a handy pause for thought. I'll also be delighted if I wake up tommorrow and everything is fine again. --- OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | 10 +++++----- OpenSim/Framework/Data.SQLite/SQLiteGridData.cs | 4 ++-- OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 12 ++++++------ OpenSim/Framework/Util.cs | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs index bf43e6e..6199911 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Data.SQLite public AssetBase FetchAsset(LLUUID uuid) { AssetBase asset = new AssetBase(); - DataRow row = ds.Tables["assets"].Rows.Find(uuid); + DataRow row = ds.Tables["assets"].Rows.Find(Util.ToRawUuidString(uuid)); if (row != null) { return buildAsset(row); @@ -103,7 +103,7 @@ namespace OpenSim.Framework.Data.SQLite DataTable assets = ds.Tables["assets"]; lock (ds) { - DataRow row = assets.Rows.Find(asset.FullID); + DataRow row = assets.Rows.Find(Util.ToRawUuidString(asset.FullID)); if (row == null) { row = assets.NewRow(); @@ -130,7 +130,7 @@ namespace OpenSim.Framework.Data.SQLite public bool ExistsAsset(LLUUID uuid) { - DataRow row = ds.Tables["assets"].Rows.Find(uuid); + DataRow row = ds.Tables["assets"].Rows.Find(Util.ToRawUuidString(uuid)); return (row != null); } @@ -138,7 +138,7 @@ namespace OpenSim.Framework.Data.SQLite { lock (ds) { - DataRow row = ds.Tables["assets"].Rows.Find(uuid); + DataRow row = ds.Tables["assets"].Rows.Find(Util.ToRawUuidString(uuid)); if (row != null) { row.Delete(); @@ -210,7 +210,7 @@ namespace OpenSim.Framework.Data.SQLite private void fillAssetRow(DataRow row, AssetBase asset) { - row["UUID"] = asset.FullID; + row["UUID"] = Util.ToRawUuidString(asset.FullID); row["Name"] = asset.Name; if (asset.Description != null) { diff --git a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs index dddc085..bb16a3e 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteGridData.cs @@ -119,7 +119,7 @@ namespace OpenSim.Framework.Data.SQLite public RegionProfileData GetProfileByLLUUID(LLUUID uuid) { Dictionary param = new Dictionary(); - param["uuid"] = uuid.ToString(); + param["uuid"] = Util.ToRawUuidString(uuid); IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param); IDataReader reader = result.ExecuteReader(); @@ -190,7 +190,7 @@ namespace OpenSim.Framework.Data.SQLite SHA512Managed HashProvider = new SHA512Managed(); ASCIIEncoding TextProvider = new ASCIIEncoding(); - byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); + byte[] stream = TextProvider.GetBytes(Util.ToRawUuidString(uuid) + ":" + handle.ToString() + ":" + challenge); byte[] hash = HashProvider.ComputeHash(stream); return false; diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs index 99121be..461cd08 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs @@ -77,11 +77,11 @@ namespace OpenSim.Framework.Data.SQLite { lock (ds) { - DataRow row = ds.Tables["users"].Rows.Find(uuid); + DataRow row = ds.Tables["users"].Rows.Find(Util.ToRawUuidString(uuid)); if (row != null) { UserProfileData user = buildUserProfile(row); - row = ds.Tables["useragents"].Rows.Find(uuid); + row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(uuid)); if (row != null) { user.currentAgent = buildUserAgent(row); @@ -105,7 +105,7 @@ namespace OpenSim.Framework.Data.SQLite if (rows.Length > 0) { UserProfileData user = buildUserProfile(rows[0]); - DataRow row = ds.Tables["useragents"].Rows.Find(user.UUID); + DataRow row = ds.Tables["useragents"].Rows.Find(Util.ToRawUuidString(user.UUID)); if (row != null) { user.currentAgent = buildUserAgent(row); @@ -220,7 +220,7 @@ namespace OpenSim.Framework.Data.SQLite DataTable users = ds.Tables["users"]; lock (ds) { - DataRow row = users.Rows.Find(user.UUID); + DataRow row = users.Rows.Find(Util.ToRawUuidString(user.UUID)); if (row == null) { row = users.NewRow(); @@ -238,7 +238,7 @@ namespace OpenSim.Framework.Data.SQLite if (user.currentAgent != null) { DataTable ua = ds.Tables["useragents"]; - row = ua.Rows.Find(user.UUID); + row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); if (row == null) { row = ua.NewRow(); @@ -255,7 +255,7 @@ namespace OpenSim.Framework.Data.SQLite // I just added this to help the standalone login situation. //It still needs to be looked at by a Database guy DataTable ua = ds.Tables["useragents"]; - row = ua.Rows.Find(user.UUID); + row = ua.Rows.Find(Util.ToRawUuidString(user.UUID)); if (row == null) { diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0b05eac..1c8f273 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -385,7 +385,7 @@ namespace OpenSim.Framework } /// - /// Convert an LLUUID to a raw uuid string. This is a string without hyphens. + /// Convert an LLUUID to a raw uuid string. Right now this is a string without hyphens. /// /// /// -- cgit v1.1