aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/InventoryServer/Main.cs
diff options
context:
space:
mode:
authorTleiades Hax2007-10-30 22:42:34 +0000
committerTleiades Hax2007-10-30 22:42:34 +0000
commit6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d (patch)
tree035f881d61f4a876ebdc72672e3c50a620ae4cfd /OpenSim/Grid/InventoryServer/Main.cs
parent* doh II (diff)
downloadopensim-SC_OLD-6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d.zip
opensim-SC_OLD-6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d.tar.gz
opensim-SC_OLD-6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d.tar.bz2
opensim-SC_OLD-6a8d8f54e88a21e6cfd78dc7981cdeec2f18094d.tar.xz
Step one on the long march towards grid based inventory. Introduction of an InevntoryServer
Diffstat (limited to 'OpenSim/Grid/InventoryServer/Main.cs')
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs55
1 files changed, 39 insertions, 16 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 97addb0..1bc396b 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -31,48 +31,71 @@ using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using System.IO; 32using System.IO;
33using System.Text; 33using System.Text;
34
34using libsecondlife; 35using libsecondlife;
35using OpenSim.Framework.User; 36
36using OpenSim.Framework.Sims; 37using OpenSim.Framework;
37using OpenSim.Framework.Inventory;
38using OpenSim.Framework.Interfaces;
39using OpenSim.Framework.Console; 38using OpenSim.Framework.Console;
40using OpenSim.Servers; 39using OpenSim.Framework.Servers;
41using OpenSim.Framework.Utilities; 40
41using InventoryManager = OpenSim.Grid.InventoryServer.InventoryManager;
42 42
43namespace OpenGridServices.InventoryServer 43namespace OpenSim.Grid.InventoryServer
44{ 44{
45 public class OpenInventory_Main : BaseServer, conscmd_callback 45 public class OpenInventory_Main : conscmd_callback
46 { 46 {
47 ConsoleBase m_console; 47 LogBase m_console;
48 InventoryManager m_inventoryManager; 48 InventoryManager m_inventoryManager;
49 InventoryConfig m_config;
49 50
51 public const string LogName = "INVENTORY";
52
53 [STAThread]
50 public static void Main(string[] args) 54 public static void Main(string[] args)
51 { 55 {
56 OpenInventory_Main theServer = new OpenInventory_Main();
57 theServer.Startup();
58
59 theServer.Work();
52 } 60 }
53 61
54 public OpenInventory_Main() 62 public OpenInventory_Main()
55 { 63 {
56 m_console = new ConsoleBase("opengrid-inventory-console.log", "OpenInventory", this, false); 64 m_console = new LogBase("opengrid-inventory-console.log", LogName, this, true);
57 MainConsole.Instance = m_console; 65 MainLog.Instance = m_console;
58 } 66 }
59 67
60 public void Startup() 68 public void Startup()
61 { 69 {
62 MainConsole.Instance.Notice("Initialising inventory manager..."); 70 MainLog.Instance.Notice("Initialising inventory manager...");
71 m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml")));
72
63 m_inventoryManager = new InventoryManager(); 73 m_inventoryManager = new InventoryManager();
74 m_inventoryManager.AddDatabasePlugin(m_config.DatabaseProvider);
75 MainLog.Instance.Notice(LogName, "Starting HTTP server ...");
76 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
64 77
65 MainConsole.Instance.Notice("Starting HTTP server"); 78 httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager));
66 BaseHttpServer httpServer = new BaseHttpServer(8004);
67 79
68 httpServer.AddXmlRPCHandler("rootfolders", m_inventoryManager.XmlRpcInventoryRequest); 80 httpServer.Start();
69 //httpServer.AddRestHandler("GET","/rootfolders/",Rest 81 MainLog.Instance.Notice(LogName, "Started HTTP server");
82 }
83
84 private void Work()
85 {
86 m_console.Notice("Enter help for a list of commands\n");
87
88 while (true)
89 {
90 m_console.MainLogPrompt();
91 }
70 } 92 }
71 93
72 public void RunCmd(string cmd, string[] cmdparams) 94 public void RunCmd(string cmd, string[] cmdparams)
73 { 95 {
74 switch (cmd) 96 switch (cmd)
75 { 97 {
98 case "quit":
76 case "shutdown": 99 case "shutdown":
77 m_console.Close(); 100 m_console.Close();
78 Environment.Exit(0); 101 Environment.Exit(0);