aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetServer.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Communications/Cache/AssetServer.cs
parent* Deleted .user file (diff)
downloadopensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetServer.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServer.cs24
1 files changed, 8 insertions, 16 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs
index c927571..fa421c7 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs
@@ -25,18 +25,11 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections.Generic;
30using System.IO; 28using System.IO;
31using System.Threading;
32using Db4objects.Db4o; 29using Db4objects.Db4o;
33using Db4objects.Db4o.Query; 30using Db4objects.Db4o.Query;
34using libsecondlife; 31using libsecondlife;
35using Nini.Config;
36using OpenSim.Framework.Communications.Cache;
37using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
38using OpenSim.Framework.Interfaces;
39using OpenSim.Framework;
40 33
41namespace OpenSim.Framework.Communications.Cache 34namespace OpenSim.Framework.Communications.Cache
42{ 35{
@@ -50,7 +43,7 @@ namespace OpenSim.Framework.Communications.Cache
50 yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap")); 43 yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap"));
51 44
52 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap")); 45 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap"));
53 MainLog.Instance.Verbose("ASSETS","Db4 Asset database creation"); 46 MainLog.Instance.Verbose("ASSETS", "Db4 Asset database creation");
54 47
55 if (!yapfile) 48 if (!yapfile)
56 { 49 {
@@ -68,29 +61,29 @@ namespace OpenSim.Framework.Communications.Cache
68 db.Commit(); 61 db.Commit();
69 } 62 }
70 63
71 override public void Close() 64 public override void Close()
72 { 65 {
73 base.Close(); 66 base.Close();
74 67
75 if (db != null) 68 if (db != null)
76 { 69 {
77 MainLog.Instance.Verbose("ASSETSERVER","Closing local asset server database"); 70 MainLog.Instance.Verbose("ASSETSERVER", "Closing local asset server database");
78 db.Close(); 71 db.Close();
79 } 72 }
80 } 73 }
81 74
82 override protected void RunRequests() 75 protected override void RunRequests()
83 { 76 {
84 while (true) 77 while (true)
85 { 78 {
86 byte[] idata = null; 79 byte[] idata = null;
87 bool found = false; 80 bool found = false;
88 AssetStorage foundAsset = null; 81 AssetStorage foundAsset = null;
89 ARequest req = this._assetRequests.Dequeue(); 82 ARequest req = _assetRequests.Dequeue();
90 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID)); 83 IObjectSet result = db.Query(new AssetUUIDQuery(req.AssetID));
91 if (result.Count > 0) 84 if (result.Count > 0)
92 { 85 {
93 foundAsset = (AssetStorage)result.Next(); 86 foundAsset = (AssetStorage) result.Next();
94 found = true; 87 found = true;
95 } 88 }
96 89
@@ -110,12 +103,10 @@ namespace OpenSim.Framework.Communications.Cache
110 //asset.FullID = ; 103 //asset.FullID = ;
111 _receiver.AssetNotFound(req.AssetID); 104 _receiver.AssetNotFound(req.AssetID);
112 } 105 }
113
114 } 106 }
115
116 } 107 }
117 108
118 override protected void StoreAsset(AssetBase asset) 109 protected override void StoreAsset(AssetBase asset)
119 { 110 {
120 AssetStorage store = new AssetStorage(); 111 AssetStorage store = new AssetStorage();
121 store.Data = asset.Data; 112 store.Data = asset.Data;
@@ -148,6 +139,7 @@ namespace OpenSim.Framework.Communications.Cache
148 { 139 {
149 _findID = find; 140 _findID = find;
150 } 141 }
142
151 public bool Match(AssetStorage asset) 143 public bool Match(AssetStorage asset)
152 { 144 {
153 return (asset.UUID == _findID); 145 return (asset.UUID == _findID);