aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetServer/Main.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Grid/AssetServer/Main.cs
parent* Deleted .user file (diff)
downloadopensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Grid/AssetServer/Main.cs')
-rw-r--r--OpenSim/Grid/AssetServer/Main.cs27
1 files changed, 11 insertions, 16 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs
index e7e5d27..61427fa 100644
--- a/OpenSim/Grid/AssetServer/Main.cs
+++ b/OpenSim/Grid/AssetServer/Main.cs
@@ -29,17 +29,10 @@
29using System; 29using System;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32
33using libsecondlife; 32using libsecondlife;
34using Nini.Config; 33using Nini.Config;
35
36using OpenSim.Framework;
37using OpenSim.Framework.Communications.Cache;
38using OpenSim.Framework; 34using OpenSim.Framework;
39using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
40using OpenSim.Framework.Interfaces;
41using OpenSim.Framework.Servers;
42using OpenSim.Framework;
43using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
44 37
45namespace OpenSim.Grid.AssetServer 38namespace OpenSim.Grid.AssetServer
@@ -79,11 +72,12 @@ namespace OpenSim.Grid.AssetServer
79 72
80 private OpenAsset_Main() 73 private OpenAsset_Main()
81 { 74 {
82 if(!Directory.Exists(Util.logDir())) 75 if (!Directory.Exists(Util.logDir()))
83 { 76 {
84 Directory.CreateDirectory(Util.logDir()); 77 Directory.CreateDirectory(Util.logDir());
85 } 78 }
86 m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-AssetServer-console.log")), "OpenAsset", this, true); 79 m_console =
80 new LogBase((Path.Combine(Util.logDir(), "opengrid-AssetServer-console.log")), "OpenAsset", this, true);
87 MainLog.Instance = m_console; 81 MainLog.Instance = m_console;
88 } 82 }
89 83
@@ -96,9 +90,9 @@ namespace OpenSim.Grid.AssetServer
96 90
97 m_console.Verbose("ASSET", "Loading default asset set.."); 91 m_console.Verbose("ASSET", "Loading default asset set..");
98 LoadDefaultAssets(); 92 LoadDefaultAssets();
99 93
100 m_console.Verbose("ASSET", "Starting HTTP process"); 94 m_console.Verbose("ASSET", "Starting HTTP process");
101 BaseHttpServer httpServer = new BaseHttpServer((int)m_config.HttpPort); 95 BaseHttpServer httpServer = new BaseHttpServer((int) m_config.HttpPort);
102 96
103 httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider)); 97 httpServer.AddStreamHandler(new GetAssetStreamHandler(this, m_assetProvider));
104 httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider)); 98 httpServer.AddStreamHandler(new PostAssetStreamHandler(this, m_assetProvider));
@@ -125,7 +119,8 @@ namespace OpenSim.Grid.AssetServer
125 119
126 if (typeInterface != null) 120 if (typeInterface != null)
127 { 121 {
128 IAssetProvider plug = (IAssetProvider)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 122 IAssetProvider plug =
123 (IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
129 assetPlugin = plug; 124 assetPlugin = plug;
130 assetPlugin.Initialise(); 125 assetPlugin.Initialise();
131 126
@@ -174,7 +169,7 @@ namespace OpenSim.Grid.AssetServer
174 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); 169 FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
175 byte[] idata = new byte[numBytes]; 170 byte[] idata = new byte[numBytes];
176 BinaryReader br = new BinaryReader(fStream); 171 BinaryReader br = new BinaryReader(fStream);
177 idata = br.ReadBytes((int)numBytes); 172 idata = br.ReadBytes((int) numBytes);
178 br.Close(); 173 br.Close();
179 fStream.Close(); 174 fStream.Close();
180 info.Data = idata; 175 info.Data = idata;
@@ -213,8 +208,8 @@ namespace OpenSim.Grid.AssetServer
213 { 208 {
214 string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated()); 209 string assetIdStr = source.Configs[i].GetString("assetID", LLUUID.Random().ToStringHyphenated());
215 string name = source.Configs[i].GetString("name", ""); 210 string name = source.Configs[i].GetString("name", "");
216 sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0); 211 sbyte type = (sbyte) source.Configs[i].GetInt("assetType", 0);
217 sbyte invType = (sbyte)source.Configs[i].GetInt("inventoryType", 0); 212 sbyte invType = (sbyte) source.Configs[i].GetInt("inventoryType", 0);
218 string fileName = source.Configs[i].GetString("fileName", ""); 213 string fileName = source.Configs[i].GetString("fileName", "");
219 214
220 AssetBase newAsset = CreateAsset(assetIdStr, name, fileName, false); 215 AssetBase newAsset = CreateAsset(assetIdStr, name, fileName, false);
@@ -247,4 +242,4 @@ namespace OpenSim.Grid.AssetServer
247 { 242 {
248 } 243 }
249 } 244 }
250} 245} \ No newline at end of file