From 7665aad002ef066fc31fa9497225d2668641c769 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Mon, 22 Feb 2010 13:27:17 -0800 Subject: * Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it --- OpenSim/Data/MSSQL/MSSQLAssetData.cs | 3 ++- OpenSim/Data/MySQL/MySQLAssetData.cs | 2 +- OpenSim/Data/SQLite/SQLiteAssetData.cs | 3 ++- OpenSim/Data/Tests/BasicAssetTest.cs | 6 +++--- OpenSim/Data/Tests/PropertyCompareConstraint.cs | 12 ++++++------ OpenSim/Data/Tests/PropertyScrambler.cs | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 1ce4abf..ee149ce 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -135,7 +135,8 @@ namespace OpenSim.Data.MSSQL AssetBase asset = new AssetBase( new UUID((Guid)reader["id"]), (string)reader["name"], - Convert.ToSByte(reader["assetType"]) + Convert.ToSByte(reader["assetType"]), + UUID.Zero ); // Region Main asset.Description = (string)reader["description"]; diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 666c22f..a1b5d94 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -122,7 +122,7 @@ namespace OpenSim.Data.MySQL { if (dbReader.Read()) { - asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"]); + asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["assetType"], UUID.Zero); asset.Data = (byte[])dbReader["data"]; asset.Description = (string)dbReader["description"]; diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index c52f60b..46f173e 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -234,7 +234,8 @@ namespace OpenSim.Data.SQLite AssetBase asset = new AssetBase( new UUID((String)row["UUID"]), (String)row["Name"], - Convert.ToSByte(row["Type"]) + Convert.ToSByte(row["Type"]), + UUID.Zero ); asset.Description = (String) row["Description"]; diff --git a/OpenSim/Data/Tests/BasicAssetTest.cs b/OpenSim/Data/Tests/BasicAssetTest.cs index 25aed61..58a17c2 100644 --- a/OpenSim/Data/Tests/BasicAssetTest.cs +++ b/OpenSim/Data/Tests/BasicAssetTest.cs @@ -66,9 +66,9 @@ namespace OpenSim.Data.Tests [Test] public void T010_StoreSimpleAsset() { - AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture); - AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture); - AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture); + AssetBase a1 = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, UUID.Zero); + AssetBase a2 = new AssetBase(uuid2, "asset two", (sbyte)AssetType.Texture, UUID.Zero); + AssetBase a3 = new AssetBase(uuid3, "asset three", (sbyte)AssetType.Texture, UUID.Zero); a1.Data = asset1; a2.Data = asset1; a3.Data = asset1; diff --git a/OpenSim/Data/Tests/PropertyCompareConstraint.cs b/OpenSim/Data/Tests/PropertyCompareConstraint.cs index 5b1f935..8c28fad 100644 --- a/OpenSim/Data/Tests/PropertyCompareConstraint.cs +++ b/OpenSim/Data/Tests/PropertyCompareConstraint.cs @@ -297,8 +297,8 @@ namespace OpenSim.Data.Tests public void AssetShouldMatch() { UUID uuid1 = UUID.Random(); - AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture); - AssetBase expected = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture); + AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, UUID.Zero); + AssetBase expected = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, UUID.Zero); var constraint = Constraints.PropertyCompareConstraint(expected); @@ -309,8 +309,8 @@ namespace OpenSim.Data.Tests public void AssetShouldNotMatch() { UUID uuid1 = UUID.Random(); - AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture); - AssetBase expected = new AssetBase(UUID.Random(), "asset one", (sbyte)AssetType.Texture); + AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, UUID.Zero); + AssetBase expected = new AssetBase(UUID.Random(), "asset one", (sbyte)AssetType.Texture, UUID.Zero); var constraint = Constraints.PropertyCompareConstraint(expected); @@ -321,8 +321,8 @@ namespace OpenSim.Data.Tests public void AssetShouldNotMatch2() { UUID uuid1 = UUID.Random(); - AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture); - AssetBase expected = new AssetBase(uuid1, "asset two", (sbyte)AssetType.Texture); + AssetBase actual = new AssetBase(uuid1, "asset one", (sbyte)AssetType.Texture, UUID.Zero); + AssetBase expected = new AssetBase(uuid1, "asset two", (sbyte)AssetType.Texture, UUID.Zero); var constraint = Constraints.PropertyCompareConstraint(expected); diff --git a/OpenSim/Data/Tests/PropertyScrambler.cs b/OpenSim/Data/Tests/PropertyScrambler.cs index c968364..3ee22c8 100644 --- a/OpenSim/Data/Tests/PropertyScrambler.cs +++ b/OpenSim/Data/Tests/PropertyScrambler.cs @@ -165,7 +165,7 @@ namespace OpenSim.Data.Tests [Test] public void TestScramble() { - AssetBase actual = new AssetBase(UUID.Random(), "asset one", (sbyte)AssetType.Texture); + AssetBase actual = new AssetBase(UUID.Random(), "asset one", (sbyte)AssetType.Texture, UUID.Zero); new PropertyScrambler().Scramble(actual); } @@ -173,7 +173,7 @@ namespace OpenSim.Data.Tests public void DontScramble() { UUID uuid = UUID.Random(); - AssetBase asset = new AssetBase(uuid, "asset", (sbyte)AssetType.Texture); + AssetBase asset = new AssetBase(uuid, "asset", (sbyte)AssetType.Texture, UUID.Zero); new PropertyScrambler() .DontScramble(x => x.Metadata) .DontScramble(x => x.FullID) -- cgit v1.1