diff options
Diffstat (limited to 'OpenSim/Grid/InventoryServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index df854f9..ce371bf 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -25,29 +25,23 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | |||
28 | using System; | 29 | using System; |
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
32 | using System.IO; | 31 | using System.IO; |
33 | using System.Text; | ||
34 | |||
35 | using libsecondlife; | 32 | using libsecondlife; |
36 | |||
37 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
39 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
40 | 36 | ||
41 | using InventoryManager = OpenSim.Grid.InventoryServer.InventoryManager; | ||
42 | |||
43 | namespace OpenSim.Grid.InventoryServer | 37 | namespace OpenSim.Grid.InventoryServer |
44 | { | 38 | { |
45 | public class OpenInventory_Main : conscmd_callback | 39 | public class OpenInventory_Main : conscmd_callback |
46 | { | 40 | { |
47 | LogBase m_console; | 41 | private LogBase m_console; |
48 | InventoryManager m_inventoryManager; | 42 | private InventoryManager m_inventoryManager; |
49 | InventoryConfig m_config; | 43 | private InventoryConfig m_config; |
50 | GridInventoryService m_inventoryService; | 44 | private GridInventoryService m_inventoryService; |
51 | 45 | ||
52 | public const string LogName = "INVENTORY"; | 46 | public const string LogName = "INVENTORY"; |
53 | 47 | ||
@@ -72,20 +66,20 @@ namespace OpenSim.Grid.InventoryServer | |||
72 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | 66 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); |
73 | 67 | ||
74 | m_inventoryService = new GridInventoryService(); | 68 | m_inventoryService = new GridInventoryService(); |
75 | // m_inventoryManager = new InventoryManager(); | 69 | // m_inventoryManager = new InventoryManager(); |
76 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); | 70 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); |
77 | 71 | ||
78 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); | 72 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); |
79 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 73 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
80 | httpServer.AddStreamHandler( | 74 | httpServer.AddStreamHandler( |
81 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", | 75 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", |
82 | m_inventoryService.GetUserInventory)); | 76 | m_inventoryService.GetUserInventory)); |
83 | httpServer.AddStreamHandler( | 77 | httpServer.AddStreamHandler( |
84 | new RestDeserialisehandler<Guid, bool>("POST", "/CreateInventory/", | 78 | new RestDeserialisehandler<Guid, bool>("POST", "/CreateInventory/", |
85 | m_inventoryService.CreateUsersInventory)); | 79 | m_inventoryService.CreateUsersInventory)); |
86 | httpServer.AddStreamHandler( | 80 | httpServer.AddStreamHandler( |
87 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", | 81 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", |
88 | m_inventoryService.AddInventoryFolder)); | 82 | m_inventoryService.AddInventoryFolder)); |
89 | 83 | ||
90 | httpServer.AddStreamHandler( | 84 | httpServer.AddStreamHandler( |
91 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/MoveFolder/", | 85 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/MoveFolder/", |
@@ -93,16 +87,16 @@ namespace OpenSim.Grid.InventoryServer | |||
93 | 87 | ||
94 | httpServer.AddStreamHandler( | 88 | httpServer.AddStreamHandler( |
95 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/NewItem/", | 89 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/NewItem/", |
96 | m_inventoryService.AddInventoryItem)); | 90 | m_inventoryService.AddInventoryItem)); |
97 | httpServer.AddStreamHandler( | 91 | httpServer.AddStreamHandler( |
98 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/DeleteItem/", | 92 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/DeleteItem/", |
99 | m_inventoryService.DeleteInvItem)); | 93 | m_inventoryService.DeleteInvItem)); |
100 | 94 | ||
101 | httpServer.AddStreamHandler( | 95 | httpServer.AddStreamHandler( |
102 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", | 96 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", |
103 | m_inventoryService.RequestFirstLevelFolders)); | 97 | m_inventoryService.RequestFirstLevelFolders)); |
104 | 98 | ||
105 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | 99 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); |
106 | 100 | ||
107 | httpServer.Start(); | 101 | httpServer.Start(); |
108 | MainLog.Instance.Notice(LogName, "Started HTTP server"); | 102 | MainLog.Instance.Notice(LogName, "Started HTTP server"); |
@@ -137,4 +131,4 @@ namespace OpenSim.Grid.InventoryServer | |||
137 | { | 131 | { |
138 | } | 132 | } |
139 | } | 133 | } |
140 | } | 134 | } \ No newline at end of file |