diff options
author | Justin Clark-Casey (justincc) | 2012-04-06 20:29:54 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-04-06 20:29:54 +0100 |
commit | 908cebbea8d7e685223b22ef8216971daccbdd53 (patch) | |
tree | 9827cf434e8013a4618bb278857d68373054f882 /OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |
parent | remove possible PhysActor unexpectedly null race conditions when changing pri... (diff) | |
parent | Deleted the unused and commented code from 2 commits ago. (diff) | |
download | opensim-SC_OLD-908cebbea8d7e685223b22ef8216971daccbdd53.zip opensim-SC_OLD-908cebbea8d7e685223b22ef8216971daccbdd53.tar.gz opensim-SC_OLD-908cebbea8d7e685223b22ef8216971daccbdd53.tar.bz2 opensim-SC_OLD-908cebbea8d7e685223b22ef8216971daccbdd53.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | 47 |
1 files changed, 39 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) |