diff options
author | Diva Canto | 2010-04-30 11:39:02 -0700 |
---|---|---|
committer | Diva Canto | 2010-04-30 11:39:02 -0700 |
commit | 5fda81e6bbb80cbe904e69638f5f405aca78f111 (patch) | |
tree | 670c850e7481a05398f93ae37460771fbd74863f /OpenSim/Server/Handlers/Inventory | |
parent | take out some debug logging in the sqlite db adaptor (diff) | |
download | opensim-SC-5fda81e6bbb80cbe904e69638f5f405aca78f111.zip opensim-SC-5fda81e6bbb80cbe904e69638f5f405aca78f111.tar.gz opensim-SC-5fda81e6bbb80cbe904e69638f5f405aca78f111.tar.bz2 opensim-SC-5fda81e6bbb80cbe904e69638f5f405aca78f111.tar.xz |
* XInventory fairly tested, including for HG. Almost ready to switch.
* Removed a few buglets and added better exception handling.
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 16b05df..b0fee6d 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -144,8 +144,6 @@ namespace OpenSim.Server.Handlers.Asset | |||
144 | return HandleGetActiveGestures(request); | 144 | return HandleGetActiveGestures(request); |
145 | case "GETASSETPERMISSIONS": | 145 | case "GETASSETPERMISSIONS": |
146 | return HandleGetAssetPermissions(request); | 146 | return HandleGetAssetPermissions(request); |
147 | case "GETSYSTEMFOLDERS": | ||
148 | return HandleGetSystemFolders(request); | ||
149 | } | 147 | } |
150 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); | 148 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); |
151 | } | 149 | } |
@@ -575,29 +573,6 @@ namespace OpenSim.Server.Handlers.Asset | |||
575 | return encoding.GetBytes(xmlString); | 573 | return encoding.GetBytes(xmlString); |
576 | } | 574 | } |
577 | 575 | ||
578 | byte[] HandleGetSystemFolders(Dictionary<string, object> request) | ||
579 | { | ||
580 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
581 | UUID principal = UUID.Zero; | ||
582 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | ||
583 | |||
584 | Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); | ||
585 | //m_log.DebugFormat("[XXX]: SystemFolders got {0} folders", sfolders.Count); | ||
586 | |||
587 | Dictionary<string, object> folders = new Dictionary<string, object>(); | ||
588 | int i = 0; | ||
589 | foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) | ||
590 | { | ||
591 | folders["folder_" + i.ToString()] = EncodeFolder(kvp.Value); | ||
592 | i++; | ||
593 | } | ||
594 | result["FOLDERS"] = folders; | ||
595 | |||
596 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
597 | //m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
598 | UTF8Encoding encoding = new UTF8Encoding(); | ||
599 | return encoding.GetBytes(xmlString); | ||
600 | } | ||
601 | 576 | ||
602 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) | 577 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) |
603 | { | 578 | { |
@@ -683,30 +658,5 @@ namespace OpenSim.Server.Handlers.Asset | |||
683 | return item; | 658 | return item; |
684 | } | 659 | } |
685 | 660 | ||
686 | #region Extra | ||
687 | private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
688 | { | ||
689 | InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); | ||
690 | if (root != null) | ||
691 | { | ||
692 | InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID); | ||
693 | if (content != null) | ||
694 | { | ||
695 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
696 | foreach (InventoryFolderBase folder in content.Folders) | ||
697 | { | ||
698 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
699 | folders[(AssetType)folder.Type] = folder; | ||
700 | } | ||
701 | // Put the root folder there, as type Folder | ||
702 | folders[AssetType.Folder] = root; | ||
703 | return folders; | ||
704 | } | ||
705 | } | ||
706 | m_log.WarnFormat("[XINVENTORY SERVICE]: System folders for {0} not found", userID); | ||
707 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
708 | } | ||
709 | #endregion | ||
710 | |||
711 | } | 661 | } |
712 | } | 662 | } |