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.0.6.4-rc1
parent
56158443b3
commit
6994d9239d
|
@ -553,12 +553,12 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
|
|||
folder.Name = String.Empty;
|
||||
|
||||
UUID dummyUUID;
|
||||
ReadUUID(reader, "ID", out dummyUUID);
|
||||
folder.ID = dummyUUID;
|
||||
ReadUUID(reader, "Owner", out dummyUUID);
|
||||
folder.Owner = dummyUUID;
|
||||
ReadUUID(reader, "ParentID", out dummyUUID);
|
||||
folder.ParentID = dummyUUID;
|
||||
ReadUUID(reader, "ID", out dummyUUID);
|
||||
folder.ID = dummyUUID;
|
||||
|
||||
short dummyType;
|
||||
Int16.TryParse(reader.ReadElementContentAsString("Type", String.Empty), out dummyType);
|
||||
|
@ -587,6 +587,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
|
|||
{
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
using (XmlReader reader = XmlReader.Create(stream))
|
||||
|
@ -597,22 +598,24 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
|
|||
UUID.TryParse(reader.ReadElementContentAsString("AvatarID", String.Empty), out agentID);
|
||||
reader.ReadStartElement("Body");
|
||||
|
||||
item.Name = reader.ReadElementContentAsString("Name", String.Empty);
|
||||
|
||||
UUID dummyUUID;
|
||||
ReadUUID(reader, "ID", out dummyUUID);
|
||||
item.ID = dummyUUID;
|
||||
|
||||
ReadUUID(reader, "Owner", out dummyUUID);
|
||||
item.Owner = dummyUUID;
|
||||
|
||||
int dummyInt;
|
||||
Int32.TryParse(reader.ReadElementContentAsString("InvType", String.Empty), out dummyInt);
|
||||
item.InvType = dummyInt;
|
||||
|
||||
ReadUUID(reader, "Folder", out dummyUUID);
|
||||
item.Folder = dummyUUID;
|
||||
ReadUUID(reader, "Owner", out dummyUUID);
|
||||
item.Owner = dummyUUID;
|
||||
ReadUUID(reader, "Creator", out dummyUUID);
|
||||
item.Creator = dummyUUID;
|
||||
|
||||
item.Name = reader.ReadElementContentAsString("Name", String.Empty);
|
||||
item.Description = reader.ReadElementContentAsString("Description", String.Empty);
|
||||
|
||||
uint dummyUInt;
|
||||
|
|
|
@ -276,7 +276,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
|
|||
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
|
||||
{
|
||||
inventory.UserID = ownerID;
|
||||
inventory.Folders = new Dictionary<UUID, InventoryFolderWithChildren>();
|
||||
inventory.Items = new Dictionary<UUID, InventoryItemBase>();
|
||||
|
||||
foreach (InventoryFolderWithChildren folder in folders)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue