diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetServerBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetServerBase.cs | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 0771a20..7109910 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs | |||
@@ -5,8 +5,6 @@ using System.Threading; | |||
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using Nini.Config; | 6 | using Nini.Config; |
7 | using OpenSim.Framework.Console; | 7 | using OpenSim.Framework.Console; |
8 | using OpenSim.Framework.Interfaces; | ||
9 | using OpenSim.Framework; | ||
10 | 8 | ||
11 | namespace OpenSim.Framework.Communications.Cache | 9 | namespace OpenSim.Framework.Communications.Cache |
12 | { | 10 | { |
@@ -36,13 +34,12 @@ namespace OpenSim.Framework.Communications.Cache | |||
36 | 34 | ||
37 | public AssetServerBase() | 35 | public AssetServerBase() |
38 | { | 36 | { |
37 | MainLog.Instance.Verbose("ASSETSERVER", "Starting asset storage system"); | ||
38 | _assetRequests = new BlockingQueue<ARequest>(); | ||
39 | 39 | ||
40 | OpenSim.Framework.Console.MainLog.Instance.Verbose("ASSETSERVER","Starting asset storage system"); | 40 | _localAssetServerThread = new Thread(RunRequests); |
41 | this._assetRequests = new BlockingQueue<ARequest>(); | 41 | _localAssetServerThread.IsBackground = true; |
42 | 42 | _localAssetServerThread.Start(); | |
43 | this._localAssetServerThread = new Thread(RunRequests); | ||
44 | this._localAssetServerThread.IsBackground = true; | ||
45 | this._localAssetServerThread.Start(); | ||
46 | } | 43 | } |
47 | 44 | ||
48 | public void LoadAsset(AssetBase info, bool image, string filename) | 45 | public void LoadAsset(AssetBase info, bool image, string filename) |
@@ -57,7 +54,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
57 | FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); | 54 | FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); |
58 | byte[] idata = new byte[numBytes]; | 55 | byte[] idata = new byte[numBytes]; |
59 | BinaryReader br = new BinaryReader(fStream); | 56 | BinaryReader br = new BinaryReader(fStream); |
60 | idata = br.ReadBytes((int)numBytes); | 57 | idata = br.ReadBytes((int) numBytes); |
61 | br.Close(); | 58 | br.Close(); |
62 | fStream.Close(); | 59 | fStream.Close(); |
63 | info.Data = idata; | 60 | info.Data = idata; |
@@ -66,7 +63,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
66 | 63 | ||
67 | public void SetReceiver(IAssetReceiver receiver) | 64 | public void SetReceiver(IAssetReceiver receiver) |
68 | { | 65 | { |
69 | this._receiver = receiver; | 66 | _receiver = receiver; |
70 | } | 67 | } |
71 | 68 | ||
72 | public void FetchAsset(LLUUID assetID, bool isTexture) | 69 | public void FetchAsset(LLUUID assetID, bool isTexture) |
@@ -74,7 +71,7 @@ namespace OpenSim.Framework.Communications.Cache | |||
74 | ARequest req = new ARequest(); | 71 | ARequest req = new ARequest(); |
75 | req.AssetID = assetID; | 72 | req.AssetID = assetID; |
76 | req.IsTexture = isTexture; | 73 | req.IsTexture = isTexture; |
77 | this._assetRequests.Enqueue(req); | 74 | _assetRequests.Enqueue(req); |
78 | } | 75 | } |
79 | 76 | ||
80 | public void UpdateAsset(AssetBase asset) | 77 | public void UpdateAsset(AssetBase asset) |
@@ -102,7 +99,6 @@ namespace OpenSim.Framework.Communications.Cache | |||
102 | 99 | ||
103 | public void SetServerInfo(string ServerUrl, string ServerKey) | 100 | public void SetServerInfo(string ServerUrl, string ServerKey) |
104 | { | 101 | { |
105 | |||
106 | } | 102 | } |
107 | 103 | ||
108 | public virtual List<AssetBase> GetDefaultAssets() | 104 | public virtual List<AssetBase> GetDefaultAssets() |
@@ -175,8 +171,8 @@ namespace OpenSim.Framework.Communications.Cache | |||
175 | // System.Console.WriteLine("loading asset into database"); | 171 | // System.Console.WriteLine("loading asset into database"); |
176 | string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated()); | 172 | string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated()); |
177 | string name = source.Configs[i].GetString("name", ""); | 173 | string name = source.Configs[i].GetString("name", ""); |
178 | sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0); | 174 | sbyte type = (sbyte) source.Configs[i].GetInt("assetType", 0); |
179 | sbyte invType = (sbyte)source.Configs[i].GetInt("inventoryType", 0); | 175 | sbyte invType = (sbyte) source.Configs[i].GetInt("inventoryType", 0); |
180 | string fileName = source.Configs[i].GetString("fileName", ""); | 176 | string fileName = source.Configs[i].GetString("fileName", ""); |
181 | 177 | ||
182 | AssetBase newAsset = CreateAsset(assetIdStr, name, fileName, false); | 178 | AssetBase newAsset = CreateAsset(assetIdStr, name, fileName, false); |
@@ -189,4 +185,4 @@ namespace OpenSim.Framework.Communications.Cache | |||
189 | assets.ForEach(action); | 185 | assets.ForEach(action); |
190 | } | 186 | } |
191 | } | 187 | } |
192 | } | 188 | } \ No newline at end of file |