From afef1ac191d32e9c1514c294b17e404b1d4ae217 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 5 Nov 2009 13:10:58 -0800 Subject: Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen --- OpenSim/Data/SQLite/SQLiteAssetData.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 49275cb..11be28e 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -231,12 +231,13 @@ namespace OpenSim.Data.SQLite // TODO: this doesn't work yet because something more // interesting has to be done to actually get these values // back out. Not enough time to figure it out yet. - AssetBase asset = new AssetBase(); + AssetBase asset = new AssetBase( + new UUID((String)row["UUID"]), + (String)row["Name"], + Convert.ToSByte(row["Type"]) + ); - asset.FullID = new UUID((String) row["UUID"]); - asset.Name = (String) row["Name"]; asset.Description = (String) row["Description"]; - asset.Type = Convert.ToSByte(row["Type"]); asset.Local = Convert.ToBoolean(row["Local"]); asset.Temporary = Convert.ToBoolean(row["Temporary"]); asset.Data = (byte[]) row["Data"]; -- cgit v1.1 From 73b437b7b4e7b88c5b9be6f584019b3cd41df44a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 12 Nov 2009 18:30:32 +0000 Subject: minor: remove some mono compiler warnings --- OpenSim/Data/SQLite/SQLiteAssetData.cs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'OpenSim/Data/SQLite') diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 11be28e..23642b3 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -162,22 +162,22 @@ namespace OpenSim.Data.SQLite } } - /// - /// Some... logging functionnality - /// - /// - private static void LogAssetLoad(AssetBase asset) - { - string temporary = asset.Temporary ? "Temporary" : "Stored"; - string local = asset.Local ? "Local" : "Remote"; - - int assetLength = (asset.Data != null) ? asset.Data.Length : 0; - - m_log.Debug("[ASSET DB]: " + - string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)", - asset.FullID, asset.Name, asset.Description, asset.Type, - temporary, local, assetLength)); - } +// /// +// /// Some... logging functionnality +// /// +// /// +// private static void LogAssetLoad(AssetBase asset) +// { +// string temporary = asset.Temporary ? "Temporary" : "Stored"; +// string local = asset.Local ? "Local" : "Remote"; +// +// int assetLength = (asset.Data != null) ? asset.Data.Length : 0; +// +// m_log.Debug("[ASSET DB]: " + +// string.Format("Loaded {5} {4} Asset: [{0}][{3}] \"{1}\":{2} ({6} bytes)", +// asset.FullID, asset.Name, asset.Description, asset.Type, +// temporary, local, assetLength)); +// } /// /// Check if an asset exist in database -- cgit v1.1