diff options
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | 128 |
1 files changed, 78 insertions, 50 deletions
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index edf224f..52294da 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |||
@@ -112,8 +112,15 @@ namespace OpenSim.Services.Connectors | |||
112 | 112 | ||
113 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); | 113 | List<InventoryFolderBase> folders = new List<InventoryFolderBase>(); |
114 | 114 | ||
115 | foreach (Object o in ret.Values) | 115 | try |
116 | folders.Add(BuildFolder((Dictionary<string,object>)o)); | 116 | { |
117 | foreach (Object o in ret.Values) | ||
118 | folders.Add(BuildFolder((Dictionary<string, object>)o)); | ||
119 | } | ||
120 | catch (Exception e) | ||
121 | { | ||
122 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping folder list: {0}", e.Message); | ||
123 | } | ||
117 | 124 | ||
118 | return folders; | 125 | return folders; |
119 | } | 126 | } |
@@ -130,7 +137,7 @@ namespace OpenSim.Services.Connectors | |||
130 | if (ret.Count == 0) | 137 | if (ret.Count == 0) |
131 | return null; | 138 | return null; |
132 | 139 | ||
133 | return BuildFolder(ret); | 140 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
134 | } | 141 | } |
135 | 142 | ||
136 | public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) | 143 | public InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) |
@@ -146,7 +153,7 @@ namespace OpenSim.Services.Connectors | |||
146 | if (ret.Count == 0) | 153 | if (ret.Count == 0) |
147 | return null; | 154 | return null; |
148 | 155 | ||
149 | return BuildFolder(ret); | 156 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
150 | } | 157 | } |
151 | 158 | ||
152 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) | 159 | public InventoryCollection GetFolderContent(UUID principalID, UUID folderID) |
@@ -173,10 +180,17 @@ namespace OpenSim.Services.Connectors | |||
173 | Dictionary<string,object> items = | 180 | Dictionary<string,object> items = |
174 | (Dictionary<string,object>)ret["ITEMS"]; | 181 | (Dictionary<string,object>)ret["ITEMS"]; |
175 | 182 | ||
176 | foreach (Object o in folders.Values) | 183 | try |
177 | inventory.Folders.Add(BuildFolder((Dictionary<string,object>)o)); | 184 | { |
178 | foreach (Object o in items.Values) | 185 | foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i |
179 | inventory.Items.Add(BuildItem((Dictionary<string,object>)o)); | 186 | inventory.Folders.Add(BuildFolder((Dictionary<string, object>)o)); |
187 | foreach (Object o in items.Values) // getting the values directly, we don't care about the keys item_i | ||
188 | inventory.Items.Add(BuildItem((Dictionary<string, object>)o)); | ||
189 | } | ||
190 | catch (Exception e) | ||
191 | { | ||
192 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception unwrapping content list: {0}", e.Message); | ||
193 | } | ||
180 | 194 | ||
181 | return inventory; | 195 | return inventory; |
182 | } | 196 | } |
@@ -194,13 +208,12 @@ namespace OpenSim.Services.Connectors | |||
194 | if (ret.Count == 0) | 208 | if (ret.Count == 0) |
195 | return null; | 209 | return null; |
196 | 210 | ||
197 | 211 | Dictionary<string, object> items = (Dictionary<string, object>)ret["ITEMS"]; | |
198 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 212 | List<InventoryItemBase> fitems = new List<InventoryItemBase>(); |
199 | 213 | foreach (Object o in items.Values) // getting the values directly, we don't care about the keys item_i | |
200 | foreach (Object o in ret.Values) | 214 | fitems.Add(BuildItem((Dictionary<string, object>)o)); |
201 | items.Add(BuildItem((Dictionary<string,object>)o)); | ||
202 | 215 | ||
203 | return items; | 216 | return fitems; |
204 | } | 217 | } |
205 | 218 | ||
206 | public bool AddFolder(InventoryFolderBase folder) | 219 | public bool AddFolder(InventoryFolderBase folder) |
@@ -405,7 +418,7 @@ namespace OpenSim.Services.Connectors | |||
405 | if (ret.Count == 0) | 418 | if (ret.Count == 0) |
406 | return null; | 419 | return null; |
407 | 420 | ||
408 | return BuildItem(ret); | 421 | return BuildItem((Dictionary<string, object>)ret["item"]); |
409 | } | 422 | } |
410 | 423 | ||
411 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 424 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) |
@@ -420,7 +433,7 @@ namespace OpenSim.Services.Connectors | |||
420 | if (ret.Count == 0) | 433 | if (ret.Count == 0) |
421 | return null; | 434 | return null; |
422 | 435 | ||
423 | return BuildFolder(ret); | 436 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
424 | } | 437 | } |
425 | 438 | ||
426 | public List<InventoryItemBase> GetActiveGestures(UUID principalID) | 439 | public List<InventoryItemBase> GetActiveGestures(UUID principalID) |
@@ -435,8 +448,8 @@ namespace OpenSim.Services.Connectors | |||
435 | 448 | ||
436 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 449 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
437 | 450 | ||
438 | foreach (Object o in ret.Values) | 451 | foreach (Object o in ret.Values) // getting the values directly, we don't care about the keys item_i |
439 | items.Add(BuildItem((Dictionary<string,object>)o)); | 452 | items.Add(BuildItem((Dictionary<string, object>)o)); |
440 | 453 | ||
441 | return items; | 454 | return items; |
442 | } | 455 | } |
@@ -469,13 +482,14 @@ namespace OpenSim.Services.Connectors | |||
469 | 482 | ||
470 | try | 483 | try |
471 | { | 484 | { |
472 | foreach (KeyValuePair<string, object> kvp in ret) | 485 | Dictionary<string, object> folders = (Dictionary<string, object>)ret["FOLDERS"]; |
486 | |||
487 | foreach (Object o in folders.Values) // getting the values directly, we don't care about the keys folder_i | ||
473 | { | 488 | { |
474 | InventoryFolderBase folder = BuildFolder((Dictionary<string, object>)(kvp.Value)); | 489 | InventoryFolderBase folder = BuildFolder((Dictionary<string, object>)o); |
475 | short type = 0; | 490 | sfolders.Add((AssetType)folder.Type, folder); |
476 | if (Int16.TryParse(kvp.Key, out type)) | ||
477 | sfolders.Add((AssetType)type, folder); | ||
478 | } | 491 | } |
492 | |||
479 | } | 493 | } |
480 | catch (Exception e) | 494 | catch (Exception e) |
481 | { | 495 | { |
@@ -522,13 +536,20 @@ namespace OpenSim.Services.Connectors | |||
522 | { | 536 | { |
523 | InventoryFolderBase folder = new InventoryFolderBase(); | 537 | InventoryFolderBase folder = new InventoryFolderBase(); |
524 | 538 | ||
525 | folder.ParentID = new UUID(data["ParentID"].ToString()); | 539 | try |
526 | folder.Type = short.Parse(data["Type"].ToString()); | 540 | { |
527 | folder.Version = ushort.Parse(data["Version"].ToString()); | 541 | folder.ParentID = new UUID(data["ParentID"].ToString()); |
528 | folder.Name = data["Name"].ToString(); | 542 | folder.Type = short.Parse(data["Type"].ToString()); |
529 | folder.Owner = new UUID(data["Owner"].ToString()); | 543 | folder.Version = ushort.Parse(data["Version"].ToString()); |
530 | folder.ID = new UUID(data["ID"].ToString()); | 544 | folder.Name = data["Name"].ToString(); |
531 | 545 | folder.Owner = new UUID(data["Owner"].ToString()); | |
546 | folder.ID = new UUID(data["ID"].ToString()); | ||
547 | } | ||
548 | catch (Exception e) | ||
549 | { | ||
550 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception building folder: {0}", e.Message); | ||
551 | } | ||
552 | |||
532 | return folder; | 553 | return folder; |
533 | } | 554 | } |
534 | 555 | ||
@@ -536,26 +557,33 @@ namespace OpenSim.Services.Connectors | |||
536 | { | 557 | { |
537 | InventoryItemBase item = new InventoryItemBase(); | 558 | InventoryItemBase item = new InventoryItemBase(); |
538 | 559 | ||
539 | item.AssetID = new UUID(data["AssetID"].ToString()); | 560 | try |
540 | item.AssetType = int.Parse(data["AssetType"].ToString()); | 561 | { |
541 | item.Name = data["Name"].ToString(); | 562 | item.AssetID = new UUID(data["AssetID"].ToString()); |
542 | item.Owner = new UUID(data["Owner"].ToString()); | 563 | item.AssetType = int.Parse(data["AssetType"].ToString()); |
543 | item.ID = new UUID(data["ID"].ToString()); | 564 | item.Name = data["Name"].ToString(); |
544 | item.InvType = int.Parse(data["InvType"].ToString()); | 565 | item.Owner = new UUID(data["Owner"].ToString()); |
545 | item.Folder = new UUID(data["Folder"].ToString()); | 566 | item.ID = new UUID(data["ID"].ToString()); |
546 | item.CreatorId = data["CreatorId"].ToString(); | 567 | item.InvType = int.Parse(data["InvType"].ToString()); |
547 | item.Description = data["Description"].ToString(); | 568 | item.Folder = new UUID(data["Folder"].ToString()); |
548 | item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); | 569 | item.CreatorId = data["CreatorId"].ToString(); |
549 | item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); | 570 | item.Description = data["Description"].ToString(); |
550 | item.BasePermissions = uint.Parse(data["BasePermissions"].ToString()); | 571 | item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); |
551 | item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString()); | 572 | item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); |
552 | item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString()); | 573 | item.BasePermissions = uint.Parse(data["BasePermissions"].ToString()); |
553 | item.GroupID = new UUID(data["GroupID"].ToString()); | 574 | item.EveryOnePermissions = uint.Parse(data["EveryOnePermissions"].ToString()); |
554 | item.GroupOwned = bool.Parse(data["GroupOwned"].ToString()); | 575 | item.GroupPermissions = uint.Parse(data["GroupPermissions"].ToString()); |
555 | item.SalePrice = int.Parse(data["SalePrice"].ToString()); | 576 | item.GroupID = new UUID(data["GroupID"].ToString()); |
556 | item.SaleType = byte.Parse(data["SaleType"].ToString()); | 577 | item.GroupOwned = bool.Parse(data["GroupOwned"].ToString()); |
557 | item.Flags = uint.Parse(data["Flags"].ToString()); | 578 | item.SalePrice = int.Parse(data["SalePrice"].ToString()); |
558 | item.CreationDate = int.Parse(data["CreationDate"].ToString()); | 579 | item.SaleType = byte.Parse(data["SaleType"].ToString()); |
580 | item.Flags = uint.Parse(data["Flags"].ToString()); | ||
581 | item.CreationDate = int.Parse(data["CreationDate"].ToString()); | ||
582 | } | ||
583 | catch (Exception e) | ||
584 | { | ||
585 | m_log.DebugFormat("[XINVENTORY CONNECTOR STUB]: Exception building item: {0}", e.Message); | ||
586 | } | ||
559 | 587 | ||
560 | return item; | 588 | return item; |
561 | } | 589 | } |