aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetServerBase.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServerBase.cs32
1 files changed, 16 insertions, 16 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index dc9c1ad..0771a20 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -6,8 +6,7 @@ using libsecondlife;
6using Nini.Config; 6using Nini.Config;
7using OpenSim.Framework.Console; 7using OpenSim.Framework.Console;
8using OpenSim.Framework.Interfaces; 8using OpenSim.Framework.Interfaces;
9using OpenSim.Framework.Types; 9using OpenSim.Framework;
10using OpenSim.Framework.Utilities;
11 10
12namespace OpenSim.Framework.Communications.Cache 11namespace OpenSim.Framework.Communications.Cache
13{ 12{
@@ -18,18 +17,18 @@ namespace OpenSim.Framework.Communications.Cache
18 protected Thread _localAssetServerThread; 17 protected Thread _localAssetServerThread;
19 protected IAssetProvider m_assetProviderPlugin; 18 protected IAssetProvider m_assetProviderPlugin;
20 protected object syncLock = new object(); 19 protected object syncLock = new object();
21 20
22 protected abstract void StoreAsset(AssetBase asset); 21 protected abstract void StoreAsset(AssetBase asset);
23 protected abstract void CommitAssets(); 22 protected abstract void CommitAssets();
24 23
25 protected abstract void RunRequests(); 24 protected abstract void RunRequests();
26 25
27 public void LoadDefaultAssets() 26 public void LoadDefaultAssets()
28 { 27 {
29 MainLog.Instance.Verbose("SQL ASSET SERVER", "Setting up asset database"); 28 MainLog.Instance.Verbose("SQL ASSET SERVER", "Setting up asset database");
30 29
31 ForEachDefaultAsset(StoreAsset ); 30 ForEachDefaultAsset(StoreAsset);
32 ForEachXmlAsset(StoreAsset ); 31 ForEachXmlAsset(StoreAsset);
33 32
34 CommitAssets(); 33 CommitAssets();
35 } 34 }
@@ -37,10 +36,11 @@ namespace OpenSim.Framework.Communications.Cache
37 36
38 public AssetServerBase() 37 public AssetServerBase()
39 { 38 {
39
40 OpenSim.Framework.Console.MainLog.Instance.Verbose("ASSETSERVER","Starting asset storage system"); 40 OpenSim.Framework.Console.MainLog.Instance.Verbose("ASSETSERVER","Starting asset storage system");
41 this._assetRequests = new BlockingQueue<ARequest>(); 41 this._assetRequests = new BlockingQueue<ARequest>();
42 42
43 this._localAssetServerThread = new Thread( RunRequests ); 43 this._localAssetServerThread = new Thread(RunRequests);
44 this._localAssetServerThread.IsBackground = true; 44 this._localAssetServerThread.IsBackground = true;
45 this._localAssetServerThread.Start(); 45 this._localAssetServerThread.Start();
46 } 46 }
@@ -96,13 +96,13 @@ namespace OpenSim.Framework.Communications.Cache
96 } 96 }
97 97
98 public virtual void Close() 98 public virtual void Close()
99 { 99 {
100 _localAssetServerThread.Abort( ); 100 _localAssetServerThread.Abort();
101 } 101 }
102 102
103 public void SetServerInfo(string ServerUrl, string ServerKey) 103 public void SetServerInfo(string ServerUrl, string ServerKey)
104 { 104 {
105 105
106 } 106 }
107 107
108 public virtual List<AssetBase> GetDefaultAssets() 108 public virtual List<AssetBase> GetDefaultAssets()
@@ -149,13 +149,13 @@ namespace OpenSim.Framework.Communications.Cache
149 149
150 if (!String.IsNullOrEmpty(filename)) 150 if (!String.IsNullOrEmpty(filename))
151 { 151 {
152 MainLog.Instance.Verbose("ASSETS", "Loading: [{0}][{1}]", name, filename ); 152 MainLog.Instance.Verbose("ASSETS", "Loading: [{0}][{1}]", name, filename);
153 153
154 LoadAsset(asset, isImage, filename); 154 LoadAsset(asset, isImage, filename);
155 } 155 }
156 else 156 else
157 { 157 {
158 MainLog.Instance.Verbose("ASSETS", "Instantiated: [{0}]", name ); 158 MainLog.Instance.Verbose("ASSETS", "Instantiated: [{0}]", name);
159 } 159 }
160 160
161 return asset; 161 return asset;
@@ -164,7 +164,7 @@ namespace OpenSim.Framework.Communications.Cache
164 public void ForEachXmlAsset(Action<AssetBase> action) 164 public void ForEachXmlAsset(Action<AssetBase> action)
165 { 165 {
166 List<AssetBase> assets = new List<AssetBase>(); 166 List<AssetBase> assets = new List<AssetBase>();
167 // System.Console.WriteLine("trying loading asset into database"); 167 // System.Console.WriteLine("trying loading asset into database");
168 string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml"); 168 string filePath = Path.Combine(Util.configDir(), "OpenSimAssetSet.xml");
169 if (File.Exists(filePath)) 169 if (File.Exists(filePath))
170 { 170 {
@@ -172,7 +172,7 @@ namespace OpenSim.Framework.Communications.Cache
172 172
173 for (int i = 0; i < source.Configs.Count; i++) 173 for (int i = 0; i < source.Configs.Count; i++)
174 { 174 {
175 // System.Console.WriteLine("loading asset into database"); 175 // System.Console.WriteLine("loading asset into database");
176 string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated()); 176 string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated());
177 string name = source.Configs[i].GetString("name", ""); 177 string name = source.Configs[i].GetString("name", "");
178 sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0); 178 sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0);
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Communications.Cache
183 183
184 newAsset.Type = type; 184 newAsset.Type = type;
185 newAsset.InvType = invType; 185 newAsset.InvType = invType;
186 assets.Add(newAsset); 186 assets.Add(newAsset);
187 } 187 }
188 } 188 }
189 assets.ForEach(action); 189 assets.ForEach(action);