diff options
author | Diva Canto | 2010-04-26 20:28:37 -0700 |
---|---|---|
committer | Diva Canto | 2010-04-26 20:28:37 -0700 |
commit | 76e87181b2cfd7a9dd7a73367fd4fe5c26ccd6ce (patch) | |
tree | 53ada1be143e9bbc9d67b9ef039cf4797749f70f /OpenSim/Server/Handlers/Inventory | |
parent | Fix build break. (diff) | |
download | opensim-SC_OLD-76e87181b2cfd7a9dd7a73367fd4fe5c26ccd6ce.zip opensim-SC_OLD-76e87181b2cfd7a9dd7a73367fd4fe5c26ccd6ce.tar.gz opensim-SC_OLD-76e87181b2cfd7a9dd7a73367fd4fe5c26ccd6ce.tar.bz2 opensim-SC_OLD-76e87181b2cfd7a9dd7a73367fd4fe5c26ccd6ce.tar.xz |
RemoteXInventoryServiceConnector, the plugin region module. Not active in default configs yet.
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory')
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 34f7dcc..7164520 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -144,6 +144,8 @@ 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); | ||
147 | } | 149 | } |
148 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); | 150 | m_log.DebugFormat("[XINVENTORY HANDLER]: unknown method request: {0}", method); |
149 | } | 151 | } |
@@ -197,7 +199,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
197 | 199 | ||
198 | return ms.ToArray(); | 200 | return ms.ToArray(); |
199 | } | 201 | } |
200 | 202 | ||
201 | byte[] HandleCreateUserInventory(Dictionary<string,object> request) | 203 | byte[] HandleCreateUserInventory(Dictionary<string,object> request) |
202 | { | 204 | { |
203 | Dictionary<string,object> result = new Dictionary<string,object>(); | 205 | Dictionary<string,object> result = new Dictionary<string,object>(); |
@@ -540,6 +542,24 @@ namespace OpenSim.Server.Handlers.Asset | |||
540 | return encoding.GetBytes(xmlString); | 542 | return encoding.GetBytes(xmlString); |
541 | } | 543 | } |
542 | 544 | ||
545 | byte[] HandleGetSystemFolders(Dictionary<string, object> request) | ||
546 | { | ||
547 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
548 | UUID principal = UUID.Zero; | ||
549 | UUID.TryParse(request["PRINCIPAL"].ToString(), out principal); | ||
550 | |||
551 | Dictionary<AssetType, InventoryFolderBase> sfolders = GetSystemFolders(principal); | ||
552 | |||
553 | if (sfolders != null) | ||
554 | foreach (KeyValuePair<AssetType, InventoryFolderBase> kvp in sfolders) | ||
555 | result[kvp.Key.ToString()] = EncodeFolder(kvp.Value); | ||
556 | |||
557 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
558 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | ||
559 | UTF8Encoding encoding = new UTF8Encoding(); | ||
560 | return encoding.GetBytes(xmlString); | ||
561 | } | ||
562 | |||
543 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) | 563 | private Dictionary<string, object> EncodeFolder(InventoryFolderBase f) |
544 | { | 564 | { |
545 | Dictionary<string, object> ret = new Dictionary<string, object>(); | 565 | Dictionary<string, object> ret = new Dictionary<string, object>(); |
@@ -623,5 +643,31 @@ namespace OpenSim.Server.Handlers.Asset | |||
623 | 643 | ||
624 | return item; | 644 | return item; |
625 | } | 645 | } |
646 | |||
647 | #region Extra | ||
648 | private Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
649 | { | ||
650 | InventoryFolderBase root = m_InventoryService.GetRootFolder(userID); | ||
651 | if (root != null) | ||
652 | { | ||
653 | InventoryCollection content = m_InventoryService.GetFolderContent(userID, root.ID); | ||
654 | if (content != null) | ||
655 | { | ||
656 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
657 | foreach (InventoryFolderBase folder in content.Folders) | ||
658 | { | ||
659 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
660 | folders[(AssetType)folder.Type] = folder; | ||
661 | } | ||
662 | // Put the root folder there, as type Folder | ||
663 | folders[AssetType.Folder] = root; | ||
664 | return folders; | ||
665 | } | ||
666 | } | ||
667 | m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID); | ||
668 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
669 | } | ||
670 | #endregion | ||
671 | |||
626 | } | 672 | } |
627 | } | 673 | } |