diff options
author | Diva Canto | 2010-04-27 11:01:56 -0700 |
---|---|---|
committer | Diva Canto | 2010-04-27 11:01:56 -0700 |
commit | 3f9d38538e4d7f238eb901aced60de7e6673a92e (patch) | |
tree | 2ff4ce69134ba8983d515ad8e4f42d4c6b6337b2 /OpenSim/Server | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC_OLD-3f9d38538e4d7f238eb901aced60de7e6673a92e.zip opensim-SC_OLD-3f9d38538e4d7f238eb901aced60de7e6673a92e.tar.gz opensim-SC_OLD-3f9d38538e4d7f238eb901aced60de7e6673a92e.tar.bz2 opensim-SC_OLD-3f9d38538e4d7f238eb901aced60de7e6673a92e.tar.xz |
XInventory connector/handler showing signs of life. Tested, but needs more testing.
Diffstat (limited to 'OpenSim/Server')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 69 |
1 files changed, 54 insertions, 15 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 7164520..c95b4d4 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -228,9 +228,17 @@ namespace OpenSim.Server.Handlers.Asset | |||
228 | 228 | ||
229 | List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); | 229 | List<InventoryFolderBase> folders = m_InventoryService.GetInventorySkeleton(new UUID(request["PRINCIPAL"].ToString())); |
230 | 230 | ||
231 | Dictionary<string, object> sfolders = new Dictionary<string, object>(); | ||
231 | if (folders != null) | 232 | if (folders != null) |
233 | { | ||
234 | int i = 0; | ||
232 | foreach (InventoryFolderBase f in folders) | 235 | foreach (InventoryFolderBase f in folders) |
233 | result[f.ID.ToString()] = EncodeFolder(f); | 236 | { |
237 | sfolders["folder_" + i.ToString()] = EncodeFolder(f); | ||
238 | i++; | ||
239 | } | ||
240 | } | ||
241 | result["FOLDERS"] = sfolders; | ||
234 | 242 | ||
235 | string xmlString = ServerUtils.BuildXmlResponse(result); | 243 | string xmlString = ServerUtils.BuildXmlResponse(result); |
236 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 244 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -246,7 +254,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
246 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 254 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
247 | InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal); | 255 | InventoryFolderBase rfolder = m_InventoryService.GetRootFolder(principal); |
248 | if (rfolder != null) | 256 | if (rfolder != null) |
249 | result[rfolder.ID.ToString()] = EncodeFolder(rfolder); | 257 | result["folder"] = EncodeFolder(rfolder); |
250 | 258 | ||
251 | string xmlString = ServerUtils.BuildXmlResponse(result); | 259 | string xmlString = ServerUtils.BuildXmlResponse(result); |
252 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 260 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -263,7 +271,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
263 | Int32.TryParse(request["TYPE"].ToString(), out type); | 271 | Int32.TryParse(request["TYPE"].ToString(), out type); |
264 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); | 272 | InventoryFolderBase folder = m_InventoryService.GetFolderForType(principal, (AssetType)type); |
265 | if (folder != null) | 273 | if (folder != null) |
266 | result[folder.ID.ToString()] = EncodeFolder(folder); | 274 | result["folder"] = EncodeFolder(folder); |
267 | 275 | ||
268 | string xmlString = ServerUtils.BuildXmlResponse(result); | 276 | string xmlString = ServerUtils.BuildXmlResponse(result); |
269 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 277 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -283,13 +291,21 @@ namespace OpenSim.Server.Handlers.Asset | |||
283 | if (icoll != null) | 291 | if (icoll != null) |
284 | { | 292 | { |
285 | Dictionary<string, object> folders = new Dictionary<string, object>(); | 293 | Dictionary<string, object> folders = new Dictionary<string, object>(); |
294 | int i = 0; | ||
286 | foreach (InventoryFolderBase f in icoll.Folders) | 295 | foreach (InventoryFolderBase f in icoll.Folders) |
287 | folders[f.ID.ToString()] = EncodeFolder(f); | 296 | { |
297 | folders["folder_" + i.ToString()] = EncodeFolder(f); | ||
298 | i++; | ||
299 | } | ||
288 | result["FOLDERS"] = folders; | 300 | result["FOLDERS"] = folders; |
289 | 301 | ||
302 | i = 0; | ||
290 | Dictionary<string, object> items = new Dictionary<string, object>(); | 303 | Dictionary<string, object> items = new Dictionary<string, object>(); |
291 | foreach (InventoryItemBase i in icoll.Items) | 304 | foreach (InventoryItemBase it in icoll.Items) |
292 | items[i.ID.ToString()] = EncodeItem(i); | 305 | { |
306 | items["item_" + i.ToString()] = EncodeItem(it); | ||
307 | i++; | ||
308 | } | ||
293 | result["ITEMS"] = items; | 309 | result["ITEMS"] = items; |
294 | } | 310 | } |
295 | 311 | ||
@@ -308,9 +324,18 @@ namespace OpenSim.Server.Handlers.Asset | |||
308 | UUID.TryParse(request["FOLDER"].ToString(), out folderID); | 324 | UUID.TryParse(request["FOLDER"].ToString(), out folderID); |
309 | 325 | ||
310 | List<InventoryItemBase> items = m_InventoryService.GetFolderItems(principal, folderID); | 326 | List<InventoryItemBase> items = m_InventoryService.GetFolderItems(principal, folderID); |
327 | Dictionary<string, object> sitems = new Dictionary<string, object>(); | ||
328 | |||
311 | if (items != null) | 329 | if (items != null) |
330 | { | ||
331 | int i = 0; | ||
312 | foreach (InventoryItemBase item in items) | 332 | foreach (InventoryItemBase item in items) |
313 | result[item.ID.ToString()] = EncodeItem(item); | 333 | { |
334 | sitems["item_" + i.ToString()] = EncodeItem(item); | ||
335 | i++; | ||
336 | } | ||
337 | } | ||
338 | result["ITEMS"] = sitems; | ||
314 | 339 | ||
315 | string xmlString = ServerUtils.BuildXmlResponse(result); | 340 | string xmlString = ServerUtils.BuildXmlResponse(result); |
316 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 341 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -483,7 +508,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
483 | InventoryItemBase item = new InventoryItemBase(id); | 508 | InventoryItemBase item = new InventoryItemBase(id); |
484 | item = m_InventoryService.GetItem(item); | 509 | item = m_InventoryService.GetItem(item); |
485 | if (item != null) | 510 | if (item != null) |
486 | result[item.ID.ToString()] = EncodeItem(item); | 511 | result["item"] = EncodeItem(item); |
487 | 512 | ||
488 | string xmlString = ServerUtils.BuildXmlResponse(result); | 513 | string xmlString = ServerUtils.BuildXmlResponse(result); |
489 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 514 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -500,7 +525,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
500 | InventoryFolderBase folder = new InventoryFolderBase(id); | 525 | InventoryFolderBase folder = new InventoryFolderBase(id); |
501 | folder = m_InventoryService.GetFolder(folder); | 526 | folder = m_InventoryService.GetFolder(folder); |
502 | if (folder != null) | 527 | if (folder != null) |
503 | result[folder.ID.ToString()] = EncodeFolder(folder); | 528 | result["folder"] = EncodeFolder(folder); |
504 | 529 | ||
505 | string xmlString = ServerUtils.BuildXmlResponse(result); | 530 | string xmlString = ServerUtils.BuildXmlResponse(result); |
506 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 531 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -515,9 +540,17 @@ namespace OpenSim.Server.Handlers.Asset | |||
515 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 540 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
516 | 541 | ||
517 | List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal); | 542 | List<InventoryItemBase> gestures = m_InventoryService.GetActiveGestures(principal); |
543 | Dictionary<string, object> items = new Dictionary<string, object>(); | ||
518 | if (gestures != null) | 544 | if (gestures != null) |
545 | { | ||
546 | int i = 0; | ||
519 | foreach (InventoryItemBase item in gestures) | 547 | foreach (InventoryItemBase item in gestures) |
520 | result[item.ID.ToString()] = EncodeItem(item); | 548 | { |
549 | items["item_" + i.ToString()] = EncodeItem(item); | ||
550 | i++; | ||
551 | } | ||
552 | } | ||
553 | result["ITEMS"] = items; | ||
521 | 554 | ||
522 | string xmlString = ServerUtils.BuildXmlResponse(result); | 555 | string xmlString = ServerUtils.BuildXmlResponse(result); |
523 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 556 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -549,10 +582,16 @@ namespace OpenSim.Server.Handlers.Asset | |||
549 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | 582 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); |
550 | 583 | ||
551 | Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); | 584 | Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); |
585 | m_log.DebugFormat("[XXX]: SystemFolders got {0} folders", sfolders.Count); | ||
552 | 586 | ||
553 | if (sfolders != null) | 587 | Dictionary<string, object> folders = new Dictionary<string, object>(); |
554 | foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) | 588 | int i = 0; |
555 | result[kvp.Key.ToString()] = EncodeFolder(kvp.Value); | 589 | foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) |
590 | { | ||
591 | folders["folder_" + i.ToString()] = EncodeFolder(kvp.Value); | ||
592 | i++; | ||
593 | } | ||
594 | result["FOLDERS"] = folders; | ||
556 | 595 | ||
557 | string xmlString = ServerUtils.BuildXmlResponse(result); | 596 | string xmlString = ServerUtils.BuildXmlResponse(result); |
558 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 597 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
@@ -589,7 +628,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
589 | ret["Flags"] = item.Flags.ToString(); | 628 | ret["Flags"] = item.Flags.ToString(); |
590 | ret["Folder"] = item.Folder.ToString(); | 629 | ret["Folder"] = item.Folder.ToString(); |
591 | ret["GroupID"] = item.GroupID.ToString(); | 630 | ret["GroupID"] = item.GroupID.ToString(); |
592 | ret["GroupedOwned"] = item.GroupOwned.ToString(); | 631 | ret["GroupOwned"] = item.GroupOwned.ToString(); |
593 | ret["GroupPermissions"] = item.GroupPermissions.ToString(); | 632 | ret["GroupPermissions"] = item.GroupPermissions.ToString(); |
594 | ret["ID"] = item.ID.ToString(); | 633 | ret["ID"] = item.ID.ToString(); |
595 | ret["InvType"] = item.InvType.ToString(); | 634 | ret["InvType"] = item.InvType.ToString(); |
@@ -664,7 +703,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
664 | return folders; | 703 | return folders; |
665 | } | 704 | } |
666 | } | 705 | } |
667 | m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID); | 706 | m_log.WarnFormat("[XINVENTORY SERVICE]: System folders for {0} not found", userID); |
668 | return new Dictionary<AssetType, InventoryFolderBase>(); | 707 | return new Dictionary<AssetType, InventoryFolderBase>(); |
669 | } | 708 | } |
670 | #endregion | 709 | #endregion |