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.
This commit is contained in:
Justin Clarke Casey
2007-12-20 19:13:34 +00:00
parent dd1e2c8eb9
commit f1ebe79824
5 changed files with 48 additions and 48 deletions

View File

@@ -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)
{

View File

@@ -119,7 +119,7 @@ namespace OpenSim.Framework.Data.SQLite
public RegionProfileData GetProfileByLLUUID(LLUUID uuid)
{
Dictionary<string, string> param = new Dictionary<string, string>();
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;

View File

@@ -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)
{