aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMike Mazur2009-03-05 08:30:15 +0000
committerMike Mazur2009-03-05 08:30:15 +0000
commit6994d9239d5181608eddad6d237f0719c17f7414 (patch)
tree5b5f4167ca7ecd94fc6c3bea630f0047e9252979
parentImplemented all Inventory frontend handlers. (diff)
downloadopensim-SC_OLD-6994d9239d5181608eddad6d237f0719c17f7414.zip
opensim-SC_OLD-6994d9239d5181608eddad6d237f0719c17f7414.tar.gz
opensim-SC_OLD-6994d9239d5181608eddad6d237f0719c17f7414.tar.bz2
opensim-SC_OLD-6994d9239d5181608eddad6d237f0719c17f7414.tar.xz
Fix creating inventory items and folders.
The order of deserialization needed to be changed. Also corrected a bug that caused no inventory items to be returned on login.
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs13
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs2
2 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
index fabc5f6..838bc3a 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryFrontendPlugin.cs
@@ -553,12 +553,12 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
553 folder.Name = String.Empty; 553 folder.Name = String.Empty;
554 554
555 UUID dummyUUID; 555 UUID dummyUUID;
556 ReadUUID(reader, "ID", out dummyUUID);
557 folder.ID = dummyUUID;
556 ReadUUID(reader, "Owner", out dummyUUID); 558 ReadUUID(reader, "Owner", out dummyUUID);
557 folder.Owner = dummyUUID; 559 folder.Owner = dummyUUID;
558 ReadUUID(reader, "ParentID", out dummyUUID); 560 ReadUUID(reader, "ParentID", out dummyUUID);
559 folder.ParentID = dummyUUID; 561 folder.ParentID = dummyUUID;
560 ReadUUID(reader, "ID", out dummyUUID);
561 folder.ID = dummyUUID;
562 562
563 short dummyType; 563 short dummyType;
564 Int16.TryParse(reader.ReadElementContentAsString("Type", String.Empty), out dummyType); 564 Int16.TryParse(reader.ReadElementContentAsString("Type", String.Empty), out dummyType);
@@ -587,6 +587,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
587 { 587 {
588 InventoryItemBase item = new InventoryItemBase(); 588 InventoryItemBase item = new InventoryItemBase();
589 589
590
590 try 591 try
591 { 592 {
592 using (XmlReader reader = XmlReader.Create(stream)) 593 using (XmlReader reader = XmlReader.Create(stream))
@@ -597,22 +598,24 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
597 UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID); 598 UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
598 reader.ReadStartElement("Body"); 599 reader.ReadStartElement("Body");
599 600
601 item.Name = reader.ReadElementContentAsString("Name", String.Empty);
602
600 UUID dummyUUID; 603 UUID dummyUUID;
601 ReadUUID(reader, "ID", out dummyUUID); 604 ReadUUID(reader, "ID", out dummyUUID);
602 item.ID = dummyUUID; 605 item.ID = dummyUUID;
603 606
607 ReadUUID(reader, "Owner", out dummyUUID);
608 item.Owner = dummyUUID;
609
604 int dummyInt; 610 int dummyInt;
605 Int32.TryParse(reader.ReadElementContentAsString("InvType", String.Empty), out dummyInt); 611 Int32.TryParse(reader.ReadElementContentAsString("InvType", String.Empty), out dummyInt);
606 item.InvType = dummyInt; 612 item.InvType = dummyInt;
607 613
608 ReadUUID(reader, "Folder", out dummyUUID); 614 ReadUUID(reader, "Folder", out dummyUUID);
609 item.Folder = dummyUUID; 615 item.Folder = dummyUUID;
610 ReadUUID(reader, "Owner", out dummyUUID);
611 item.Owner = dummyUUID;
612 ReadUUID(reader, "Creator", out dummyUUID); 616 ReadUUID(reader, "Creator", out dummyUUID);
613 item.Creator = dummyUUID; 617 item.Creator = dummyUUID;
614 618
615 item.Name = reader.ReadElementContentAsString("Name", String.Empty);
616 item.Description = reader.ReadElementContentAsString("Description", String.Empty); 619 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
617 620
618 uint dummyUInt; 621 uint dummyUInt;
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs
index 930e4f6..2239b87 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/OpenSim/OpenSimInventoryStoragePlugin.cs
@@ -276,7 +276,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
276 if (Utils.TryGetOpenSimUUID(owner, out ownerID)) 276 if (Utils.TryGetOpenSimUUID(owner, out ownerID))
277 { 277 {
278 inventory.UserID = ownerID; 278 inventory.UserID = ownerID;
279 inventory.Folders = new Dictionary<UUID, InventoryFolderWithChildren>(); 279 inventory.Items = new Dictionary<UUID, InventoryItemBase>();
280 280
281 foreach (InventoryFolderWithChildren folder in folders) 281 foreach (InventoryFolderWithChildren folder in folders)
282 { 282 {