aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.AssetServer/Main.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGridServices.AssetServer/Main.cs63
1 files changed, 32 insertions, 31 deletions
diff --git a/OpenGridServices.AssetServer/Main.cs b/OpenGridServices.AssetServer/Main.cs
index b57a5a5..21a4fce 100644
--- a/OpenGridServices.AssetServer/Main.cs
+++ b/OpenGridServices.AssetServer/Main.cs
@@ -32,18 +32,18 @@ using System.IO;
32using System.Text; 32using System.Text;
33using System.Timers; 33using System.Timers;
34using System.Net; 34using System.Net;
35using System.Reflection; 35using System.Reflection;
36using System.Threading; 36using System.Threading;
37using libsecondlife; 37using libsecondlife;
38using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Framework.Sims; 39using OpenSim.Framework.Sims;
40using OpenSim.Framework.Console; 40using OpenSim.Framework.Console;
41using OpenSim.Framework.Types; 41using OpenSim.Framework.Types;
42using OpenSim.Framework.Interfaces; 42using OpenSim.Framework.Interfaces;
43using OpenSim.GridInterfaces.Local; // REFACTORING IS NEEDED!!!!!!!!!!! 43using OpenSim.GridInterfaces.Local; // REFACTORING IS NEEDED!!!!!!!!!!!
44using OpenSim.Servers; 44using OpenSim.Servers;
45using Db4objects.Db4o; 45using Db4objects.Db4o;
46using Db4objects.Db4o.Query; 46using Db4objects.Db4o.Query;
47 47
48namespace OpenGridServices.AssetServer 48namespace OpenGridServices.AssetServer
49{ 49{
@@ -54,7 +54,7 @@ namespace OpenGridServices.AssetServer
54 private IObjectContainer db; 54 private IObjectContainer db;
55 55
56 public static OpenAsset_Main assetserver; 56 public static OpenAsset_Main assetserver;
57 57
58 private ConsoleBase m_console; 58 private ConsoleBase m_console;
59 59
60 [STAThread] 60 [STAThread]
@@ -85,9 +85,10 @@ namespace OpenGridServices.AssetServer
85 } 85 }
86 86
87 public void Startup() 87 public void Startup()
88 { m_console.WriteLine("Main.cs:Startup() - Setting up asset DB"); 88 {
89 setupDB(); 89 m_console.WriteLine("Main.cs:Startup() - Setting up asset DB");
90 90 setupDB();
91
91 m_console.WriteLine("Main.cs:Startup() - Starting HTTP process"); 92 m_console.WriteLine("Main.cs:Startup() - Starting HTTP process");
92 BaseHttpServer httpServer = new BaseHttpServer(8003); 93 BaseHttpServer httpServer = new BaseHttpServer(8003);
93 94
@@ -98,18 +99,18 @@ namespace OpenGridServices.AssetServer
98 httpServer.Start(); 99 httpServer.Start();
99 100
100 } 101 }
101 102
102 public string assetGetMethod(string request, string path, string param) { 103 public string assetGetMethod(string request, string path, string param) {
103 byte[] assetdata=getAssetData(new LLUUID(param),false); 104 byte[] assetdata=getAssetData(new LLUUID(param),false);
104 if(assetdata!=null) { 105 if(assetdata!=null) {
105 return System.Text.Encoding.ASCII.GetString(assetdata); 106 return System.Text.Encoding.ASCII.GetString(assetdata);
106 } else { 107 } else {
107 return ""; 108 return "";
108 } 109 }
109 110
110 } 111 }
111 112
112 public byte[] getAssetData(LLUUID assetID, bool isTexture) { 113 public byte[] getAssetData(LLUUID assetID, bool isTexture) {
113 byte[] idata = null; 114 byte[] idata = null;
114 bool found = false; 115 bool found = false;
115 AssetStorage foundAsset = null; 116 AssetStorage foundAsset = null;
@@ -129,10 +130,10 @@ namespace OpenGridServices.AssetServer
129 { 130 {
130 return null; 131 return null;
131 } 132 }
132 } 133 }
133 134
134 public void setupDB() { 135 public void setupDB() {
135 bool yapfile=System.IO.File.Exists("assets.yap"); 136 bool yapfile=System.IO.File.Exists("assets.yap");
136 try 137 try
137 { 138 {
138 db = Db4oFactory.OpenFile("assets.yap"); 139 db = Db4oFactory.OpenFile("assets.yap");
@@ -148,9 +149,9 @@ namespace OpenGridServices.AssetServer
148 { 149 {
149 this.LoadDB(); 150 this.LoadDB();
150 } 151 }
151 } 152 }
152 153
153 public void LoadDB() { 154 public void LoadDB() {
154 try 155 try
155 { 156 {
156 157
@@ -236,9 +237,9 @@ namespace OpenGridServices.AssetServer
236 catch (Exception e) 237 catch (Exception e)
237 { 238 {
238 Console.WriteLine(e.Message); 239 Console.WriteLine(e.Message);
239 } 240 }
240 } 241 }
241 242
242 private void LoadAsset(AssetBase info, bool image, string filename) 243 private void LoadAsset(AssetBase info, bool image, string filename)
243 { 244 {
244 245
@@ -255,8 +256,8 @@ namespace OpenGridServices.AssetServer
255 fStream.Close(); 256 fStream.Close();
256 info.Data = idata; 257 info.Data = idata;
257 //info.loaded=true; 258 //info.loaded=true;
258 } 259 }
259 260
260 /*private GridConfig LoadConfigDll(string dllName) 261 /*private GridConfig LoadConfigDll(string dllName)
261 { 262 {
262 Assembly pluginAssembly = Assembly.LoadFrom(dllName); 263 Assembly pluginAssembly = Assembly.LoadFrom(dllName);