diff options
author | Diva Canto | 2012-04-06 11:38:47 -0700 |
---|---|---|
committer | Diva Canto | 2012-04-06 11:38:47 -0700 |
commit | 6eaff18961668ba6141a7dd26a3df873489f64b5 (patch) | |
tree | c15b51f2cd2703bfc7eff686c7ea0ffe893b47a1 /OpenSim/Services | |
parent | Packing of folder in SendBulkUpdateInventory always set the folder type to -1... (diff) | |
download | opensim-SC-6eaff18961668ba6141a7dd26a3df873489f64b5.zip opensim-SC-6eaff18961668ba6141a7dd26a3df873489f64b5.tar.gz opensim-SC-6eaff18961668ba6141a7dd26a3df873489f64b5.tar.bz2 opensim-SC-6eaff18961668ba6141a7dd26a3df873489f64b5.tar.xz |
Finish the implementation of GetUserInventory, even though it's still not used.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | 47 | ||||
-rw-r--r-- | OpenSim/Services/HypergridService/HGInventoryService.cs | 6 |
2 files changed, 45 insertions, 8 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index 39e983b..9d96703 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |||
@@ -111,19 +111,21 @@ namespace OpenSim.Services.Connectors | |||
111 | if (ret.Count == 0) | 111 | if (ret.Count == 0) |
112 | return null; | 112 | return null; |
113 | 113 | ||
114 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 114 | Dictionary<string, object> folders = (Dictionary<string, object>)ret["FOLDERS"]; |
115 | |||
116 | List<InventoryFolderBase> fldrs = new List<InventoryFolderBase>(); | ||
115 | 117 | ||
116 | try | 118 | try |
117 | { | 119 | { |
118 | foreach (Object o in ret.Values) | 120 | foreach (Object o in folders.Values) |
119 | folders.Add(BuildFolder((Dictionary<string, object>)o)); | 121 | fldrs.Add(BuildFolder((Dictionary<string, object>)o)); |
120 | } | 122 | } |
121 | catch (Exception e) | 123 | catch (Exception e) |
122 | { | 124 | { |
123 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping folder list: {0}", e.Message); | 125 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping folder list: {0}", e.Message); |
124 | } | 126 | } |
125 | 127 | ||
126 | return folders; | 128 | return fldrs; |
127 | } | 129 | } |
128 | 130 | ||
129 | public InventoryFolderBase GetRootFolder(UUID principalID) | 131 | public InventoryFolderBase GetRootFolder(UUID principalID) |
@@ -492,12 +494,41 @@ namespace OpenSim.Services.Connectors | |||
492 | return int.Parse(ret["RESULT"].ToString()); | 494 | return int.Parse(ret["RESULT"].ToString()); |
493 | } | 495 | } |
494 | 496 | ||
495 | |||
496 | // These are either obsolete or unused | ||
497 | // | ||
498 | public InventoryCollection GetUserInventory(UUID principalID) | 497 | public InventoryCollection GetUserInventory(UUID principalID) |
499 | { | 498 | { |
500 | return null; | 499 | InventoryCollection inventory = new InventoryCollection(); |
500 | inventory.Folders = new List<InventoryFolderBase>(); | ||
501 | inventory.Items = new List<InventoryItemBase>(); | ||
502 | inventory.UserID = principalID; | ||
503 | |||
504 | try | ||
505 | { | ||
506 | Dictionary<string, object> ret = MakeRequest("GETUSERINVENTORY", | ||
507 | new Dictionary<string, object> { | ||
508 | { "PRINCIPAL", principalID.ToString() } | ||
509 | }); | ||
510 | |||
511 | if (ret == null) | ||
512 | return null; | ||
513 | if (ret.Count == 0) | ||
514 | return null; | ||
515 | |||
516 | Dictionary<string, object> folders = | ||
517 | (Dictionary<string, object>)ret["FOLDERS"]; | ||
518 | Dictionary<string, object> items = | ||
519 | (Dictionary<string, object>)ret["ITEMS"]; | ||
520 | |||
521 | foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i | ||
522 | inventory.Folders.Add(BuildFolder((Dictionary<string, object>)o)); | ||
523 | foreach (Object o in items.Values) // getting the values directly, we don't care about the keys item_i | ||
524 | inventory.Items.Add(BuildItem((Dictionary<string, object>)o)); | ||
525 | } | ||
526 | catch (Exception e) | ||
527 | { | ||
528 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception in GetUserInventory: {0}", e.Message); | ||
529 | } | ||
530 | |||
531 | return inventory; | ||
501 | } | 532 | } |
502 | 533 | ||
503 | public void GetUserInventory(UUID principalID, InventoryReceiptCallback callback) | 534 | public void GetUserInventory(UUID principalID, InventoryReceiptCallback callback) |
diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index b29d803..2e9bd40 100644 --- a/OpenSim/Services/HypergridService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs | |||
@@ -105,6 +105,12 @@ namespace OpenSim.Services.HypergridService | |||
105 | return new List<InventoryFolderBase>(); | 105 | return new List<InventoryFolderBase>(); |
106 | } | 106 | } |
107 | 107 | ||
108 | public override InventoryCollection GetUserInventory(UUID userID) | ||
109 | { | ||
110 | // NOGO for this inventory service | ||
111 | return null; | ||
112 | } | ||
113 | |||
108 | public override InventoryFolderBase GetRootFolder(UUID principalID) | 114 | public override InventoryFolderBase GetRootFolder(UUID principalID) |
109 | { | 115 | { |
110 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetRootFolder for {0}", principalID); | 116 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetRootFolder for {0}", principalID); |