aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/InventoryServer/Main.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:41:01 +0000
committerAdam Frisby2008-05-01 16:41:01 +0000
commitfc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8 (patch)
tree90a4799fa43e3761ffbe669d1d87837933d8db53 /OpenSim/Grid/InventoryServer/Main.cs
parent* Deletes my EventReader ScriptRewriter. It isn't required to rewrite the sc... (diff)
downloadopensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.zip
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.gz
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.bz2
opensim-SC_OLD-fc6c4dc399587f6f920d3f0759b1bd7a8b9b4ac8.tar.xz
* Cleaning code still.
Diffstat (limited to 'OpenSim/Grid/InventoryServer/Main.cs')
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs65
1 files changed, 34 insertions, 31 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 870997b..453d64d 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -40,13 +40,38 @@ namespace OpenSim.Grid.InventoryServer
40{ 40{
41 public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback 41 public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback
42 { 42 {
43 public const string LogName = "INVENTORY";
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 45
45 private InventoryManager m_inventoryManager;
46 private InventoryConfig m_config; 46 private InventoryConfig m_config;
47 private InventoryManager m_inventoryManager;
47 private GridInventoryService m_inventoryService; 48 private GridInventoryService m_inventoryService;
48 49
49 public const string LogName = "INVENTORY"; 50 public OpenInventory_Main()
51 {
52 m_console = new ConsoleBase(LogName, this);
53 MainConsole.Instance = m_console;
54 }
55
56 #region conscmd_callback Members
57
58 public override void RunCmd(string cmd, string[] cmdparams)
59 {
60 base.RunCmd(cmd, cmdparams);
61
62 switch (cmd)
63 {
64 case "add-user":
65 m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID);
66 break;
67 case "shutdown":
68 m_console.Close();
69 Environment.Exit(0);
70 break;
71 }
72 }
73
74 #endregion
50 75
51 [STAThread] 76 [STAThread]
52 public static void Main(string[] args) 77 public static void Main(string[] args)
@@ -59,12 +84,6 @@ namespace OpenSim.Grid.InventoryServer
59 theServer.Work(); 84 theServer.Work();
60 } 85 }
61 86
62 public OpenInventory_Main()
63 {
64 m_console = new ConsoleBase(LogName, this);
65 MainConsole.Instance = m_console;
66 }
67
68 public void Startup() 87 public void Startup()
69 { 88 {
70 m_log.Info("Initialising inventory manager..."); 89 m_log.Info("Initialising inventory manager...");
@@ -75,7 +94,7 @@ namespace OpenSim.Grid.InventoryServer
75 m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); 94 m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect);
76 95
77 m_log.Info("[" + LogName + "]: Starting HTTP server ..."); 96 m_log.Info("[" + LogName + "]: Starting HTTP server ...");
78 97
79 m_httpServer = new BaseHttpServer(m_config.HttpPort); 98 m_httpServer = new BaseHttpServer(m_config.HttpPort);
80 AddHttpHandlers(); 99 AddHttpHandlers();
81 m_httpServer.Start(); 100 m_httpServer.Start();
@@ -88,11 +107,11 @@ namespace OpenSim.Grid.InventoryServer
88 m_httpServer.AddStreamHandler( 107 m_httpServer.AddStreamHandler(
89 new RestDeserialisehandler<Guid, InventoryCollection>( 108 new RestDeserialisehandler<Guid, InventoryCollection>(
90 "POST", "/GetInventory/", m_inventoryService.GetUserInventory)); 109 "POST", "/GetInventory/", m_inventoryService.GetUserInventory));
91 110
92 m_httpServer.AddStreamHandler( 111 m_httpServer.AddStreamHandler(
93 new RestDeserialisehandler<Guid, bool>( 112 new RestDeserialisehandler<Guid, bool>(
94 "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); 113 "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory));
95 114
96 m_httpServer.AddStreamHandler( 115 m_httpServer.AddStreamHandler(
97 new RestDeserialisehandler<InventoryFolderBase, bool>( 116 new RestDeserialisehandler<InventoryFolderBase, bool>(
98 "POST", "/NewFolder/", m_inventoryService.AddInventoryFolder)); 117 "POST", "/NewFolder/", m_inventoryService.AddInventoryFolder));
@@ -100,15 +119,15 @@ namespace OpenSim.Grid.InventoryServer
100 m_httpServer.AddStreamHandler( 119 m_httpServer.AddStreamHandler(
101 new RestDeserialisehandler<InventoryFolderBase, bool>( 120 new RestDeserialisehandler<InventoryFolderBase, bool>(
102 "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder)); 121 "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder));
103 122
104 m_httpServer.AddStreamHandler( 123 m_httpServer.AddStreamHandler(
105 new RestDeserialisehandler<InventoryFolderBase, bool>( 124 new RestDeserialisehandler<InventoryFolderBase, bool>(
106 "POST", "/PurgeFolder/", m_inventoryService.PurgeInventoryFolder)); 125 "POST", "/PurgeFolder/", m_inventoryService.PurgeInventoryFolder));
107 126
108 m_httpServer.AddStreamHandler( 127 m_httpServer.AddStreamHandler(
109 new RestDeserialisehandler<InventoryItemBase, bool>( 128 new RestDeserialisehandler<InventoryItemBase, bool>(
110 "POST", "/NewItem/", m_inventoryService.AddInventoryItem)); 129 "POST", "/NewItem/", m_inventoryService.AddInventoryItem));
111 130
112 m_httpServer.AddStreamHandler( 131 m_httpServer.AddStreamHandler(
113 new RestDeserialisehandler<InventoryItemBase, bool>( 132 new RestDeserialisehandler<InventoryItemBase, bool>(
114 "POST", "/DeleteItem/", m_inventoryService.DeleteInvItem)); 133 "POST", "/DeleteItem/", m_inventoryService.DeleteInvItem));
@@ -134,21 +153,5 @@ namespace OpenSim.Grid.InventoryServer
134 m_console.Prompt(); 153 m_console.Prompt();
135 } 154 }
136 } 155 }
137
138 public override void RunCmd(string cmd, string[] cmdparams)
139 {
140 base.RunCmd(cmd, cmdparams);
141
142 switch (cmd)
143 {
144 case "add-user":
145 m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID);
146 break;
147 case "shutdown":
148 m_console.Close();
149 Environment.Exit(0);
150 break;
151 }
152 }
153 } 156 }
154} 157} \ No newline at end of file