From 26b8018bccbcb0f6a296adbb11bdc66733aa9e12 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 17 Oct 2007 10:58:19 +0000 Subject: * Some asset loading refactoring --- .../Communications/Cache/SQLAssetServer.cs | 5 +++++ OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 082a240..35ec1cf 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs @@ -61,6 +61,11 @@ namespace OpenSim.Framework.Communications.Caches } + public SQLAssetServer( IAssetProvider assetProvider ) + { + m_assetProviderPlugin = assetProvider; + } + public void AddPlugin(string FileName) { MainLog.Instance.Verbose("SQLAssetServer", "AssetStorage: Attempting to load " + FileName); diff --git a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs index 922d714..0f3625b 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteAssetData.cs @@ -101,15 +101,8 @@ namespace OpenSim.Framework.Data.SQLite public void UpdateAsset(AssetBase asset) { - MainLog.Instance.Verbose("AssetStorage", - "Asset: " + asset.FullID + - ", Name: " + asset.Name + - ", Description: " + asset.Description + - ", Type: " + asset.Type + - ", InvType: " + asset.InvType + - ", Temporary: " + asset.Temporary + - ", Local: " + asset.Local + - ", Data Length: " + asset.Data.Length ); + LogAssetLoad(asset); + DataTable assets = ds.Tables["assets"]; lock(ds) { DataRow row = assets.Rows.Find(asset.FullID); @@ -126,6 +119,16 @@ namespace OpenSim.Framework.Data.SQLite } } + private void LogAssetLoad(AssetBase asset) + { + string temporary = asset.Temporary ? "Temporary" : "Stored"; + string local = asset.Local ? "Local" : "Remote"; + + MainLog.Instance.Verbose("ASSETSTORAGE", + string.Format("Loaded {6} {5} Asset: [{0}][{3}/{4}] \"{1}\":{2} ({7} bytes)", + asset.FullID, asset.Name, asset.Description, asset.Type, asset.InvType, temporary, local, asset.Data.Length) ); + } + public bool ExistsAsset(LLUUID uuid) { DataRow row = ds.Tables["assets"].Rows.Find(uuid); -- cgit v1.1