aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2008-12-02 11:15:08 +0000
committerMW2008-12-02 11:15:08 +0000
commitb62b9af6b00100a5932191a0250b5ade3b52f436 (patch)
tree77f031dad5d58593f6709f50b52b2face483dd97
parentCatch all possible exceptions in the mysql module. It throws non-mysql (diff)
downloadopensim-SC_OLD-b62b9af6b00100a5932191a0250b5ade3b52f436.zip
opensim-SC_OLD-b62b9af6b00100a5932191a0250b5ade3b52f436.tar.gz
opensim-SC_OLD-b62b9af6b00100a5932191a0250b5ade3b52f436.tar.bz2
opensim-SC_OLD-b62b9af6b00100a5932191a0250b5ade3b52f436.tar.xz
Added two new "trusted" url handlers to the Inventory server, to allow the user server to get a list of items in a folder and add a new item.
-rw-r--r--OpenSim/Grid/InventoryServer/GridInventoryService.cs36
-rw-r--r--OpenSim/Grid/InventoryServer/Main.cs8
2 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
index 6f7672e..78d9f65 100644
--- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs
+++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs
@@ -192,15 +192,15 @@ namespace OpenSim.Grid.InventoryServer
192 invCollection.Folders = allFolders; 192 invCollection.Folders = allFolders;
193 invCollection.Items = allItems; 193 invCollection.Items = allItems;
194 194
195// foreach (InventoryFolderBase folder in invCollection.Folders) 195 // foreach (InventoryFolderBase folder in invCollection.Folders)
196// { 196 // {
197// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); 197 // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID);
198// } 198 // }
199// 199 //
200// foreach (InventoryItemBase item in invCollection.Items) 200 // foreach (InventoryItemBase item in invCollection.Items)
201// { 201 // {
202// m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); 202 // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder);
203// } 203 // }
204 204
205 m_log.InfoFormat( 205 m_log.InfoFormat(
206 "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", 206 "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items",
@@ -209,6 +209,22 @@ namespace OpenSim.Grid.InventoryServer
209 return invCollection; 209 return invCollection;
210 } 210 }
211 211
212 public List<InventoryItemBase> GetFolderItems(Guid folderID)
213 {
214 List<InventoryItemBase> allItems = new List<InventoryItemBase>();
215
216
217 List<InventoryItemBase> items = RequestFolderItems(new UUID(folderID));
218
219 if (items != null)
220 {
221 allItems.InsertRange(0, items);
222 }
223 m_log.InfoFormat(
224 "[GRID AGENT INVENTORY]: Sending back inventory response containing {0} items", allItems.Count.ToString());
225 return allItems;
226 }
227
212 /// <summary> 228 /// <summary>
213 /// Guid to UUID wrapper for same name IInventoryServices method 229 /// Guid to UUID wrapper for same name IInventoryServices method
214 /// </summary> 230 /// </summary>
@@ -233,7 +249,7 @@ namespace OpenSim.Grid.InventoryServer
233 249
234 return CreateNewUserInventory(userID); 250 return CreateNewUserInventory(userID);
235 } 251 }
236 252
237 public List<InventoryItemBase> GetActiveGestures(Guid rawUserID) 253 public List<InventoryItemBase> GetActiveGestures(Guid rawUserID)
238 { 254 {
239 UUID userID = new UUID(rawUserID); 255 UUID userID = new UUID(rawUserID);
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs
index 8be6a23..81a6a03 100644
--- a/OpenSim/Grid/InventoryServer/Main.cs
+++ b/OpenSim/Grid/InventoryServer/Main.cs
@@ -110,6 +110,14 @@ namespace OpenSim.Grid.InventoryServer
110 "POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession)); 110 "POST", "/NewItem/", m_inventoryService.AddItem, m_inventoryService.CheckAuthSession));
111 111
112 m_httpServer.AddStreamHandler( 112 m_httpServer.AddStreamHandler(
113 new RestDeserialiseTrustedHandler<Guid, List<InventoryItemBase>>(
114 "POST", "/GetItems/", m_inventoryService.GetFolderItems, m_inventoryService.CheckTrustSource));
115
116 m_httpServer.AddStreamHandler(
117 new RestDeserialiseTrustedHandler<InventoryItemBase, bool>(
118 "POST", "/AddNewItem/", m_inventoryService.AddItem, m_inventoryService.CheckTrustSource));
119
120 m_httpServer.AddStreamHandler(
113 new RestDeserialiseSecureHandler<InventoryItemBase, bool>( 121 new RestDeserialiseSecureHandler<InventoryItemBase, bool>(
114 "POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession)); 122 "POST", "/DeleteItem/", m_inventoryService.DeleteItem, m_inventoryService.CheckAuthSession));
115 123