diff options
Initial working Grid Inventory server. Only been tested on a very small grid, so likely to have problems on a larger grid with more people?
To use , both the user server and Inventory server need to be running this latest revision. (older regions should be able to still be used, just the user won't have inventory on them). Also and HERE IS THE BIG BREAK ISSUE, currently, so that the initial inventory details for a user are added to the inventory db , you need to recreate the accounts using the user server "create user" feature. It should be quite easy to manual populate the inventory database instead but I someone else will need to look into that) Also I've only tested using SQLite as the database provider, there is a Mysql inventory provider but I don't know if it works (SQLite is set as default, so you will need to change it in the inventory server config.xml)
Diffstat (limited to 'OpenSim/Grid/InventoryServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 1bc396b..8d232c2 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Grid.InventoryServer | |||
47 | LogBase m_console; | 47 | LogBase m_console; |
48 | InventoryManager m_inventoryManager; | 48 | InventoryManager m_inventoryManager; |
49 | InventoryConfig m_config; | 49 | InventoryConfig m_config; |
50 | GridInventoryService m_inventoryService; | ||
50 | 51 | ||
51 | public const string LogName = "INVENTORY"; | 52 | public const string LogName = "INVENTORY"; |
52 | 53 | ||
@@ -69,13 +70,35 @@ namespace OpenSim.Grid.InventoryServer | |||
69 | { | 70 | { |
70 | MainLog.Instance.Notice("Initialising inventory manager..."); | 71 | MainLog.Instance.Notice("Initialising inventory manager..."); |
71 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | 72 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); |
72 | 73 | ||
73 | m_inventoryManager = new InventoryManager(); | 74 | m_inventoryService = new GridInventoryService(); |
74 | m_inventoryManager.AddDatabasePlugin(m_config.DatabaseProvider); | 75 | // m_inventoryManager = new InventoryManager(); |
76 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); | ||
77 | |||
75 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); | 78 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); |
76 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 79 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
80 | httpServer.AddStreamHandler( | ||
81 | new RestDeserialisehandler<LLUUID, InventoryCollection>("POST", "/GetInventory/", | ||
82 | m_inventoryService.GetUserInventory)); | ||
83 | httpServer.AddStreamHandler( | ||
84 | new RestDeserialisehandler<LLUUID, bool>("POST", "/CreateInventory/", | ||
85 | m_inventoryService.CreateUsersInventory)); | ||
86 | httpServer.AddStreamHandler( | ||
87 | new RestDeserialisehandler<InventoryFolderBase, bool>("POST", "/NewFolder/", | ||
88 | m_inventoryService.AddInventoryFolder)); | ||
89 | |||
90 | httpServer.AddStreamHandler( | ||
91 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/NewItem/", | ||
92 | m_inventoryService.AddInventoryItem)); | ||
93 | httpServer.AddStreamHandler( | ||
94 | new RestDeserialisehandler<InventoryItemBase, bool>("POST", "/DeleteItem/", | ||
95 | m_inventoryService.DeleteInvItem)); | ||
77 | 96 | ||
78 | httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | 97 | httpServer.AddStreamHandler( |
98 | new RestDeserialisehandler<LLUUID, List<InventoryFolderBase>>("POST", "/RootFolders/", | ||
99 | m_inventoryService.RequestFirstLevelFolders)); | ||
100 | |||
101 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | ||
79 | 102 | ||
80 | httpServer.Start(); | 103 | httpServer.Start(); |
81 | MainLog.Instance.Notice(LogName, "Started HTTP server"); | 104 | MainLog.Instance.Notice(LogName, "Started HTTP server"); |
@@ -96,6 +119,9 @@ namespace OpenSim.Grid.InventoryServer | |||
96 | switch (cmd) | 119 | switch (cmd) |
97 | { | 120 | { |
98 | case "quit": | 121 | case "quit": |
122 | case "add-user": | ||
123 | m_inventoryService.CreateUsersInventory(LLUUID.Random()); | ||
124 | break; | ||
99 | case "shutdown": | 125 | case "shutdown": |
100 | m_console.Close(); | 126 | m_console.Close(); |
101 | Environment.Exit(0); | 127 | Environment.Exit(0); |