Skip to content

Commit

Permalink
Assign InventoryFolder fields before adding to Store in RequestFolder…
Browse files Browse the repository at this point in the history
…Contents(), fix regression in method as well.
  • Loading branch information
cinderblocks committed Jan 19, 2025
1 parent 829e56a commit ea5f5d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
12 changes: 7 additions & 5 deletions LibreMetaverse/AppearanceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2128,8 +2128,8 @@ private async Task<bool> UpdateAvatarAppearanceAsync(CancellationToken cancellat
var cap = caps.CapabilityURI("UpdateAvatarAppearance");
if (cap == null) { return false; }

var currentoutfitfolder = GetCOF();
if (currentoutfitfolder == null)
var currentOutfitFolder = GetCOF();
if (currentOutfitFolder == null)
{
return false;
}
Expand All @@ -2138,7 +2138,7 @@ private async Task<bool> UpdateAvatarAppearanceAsync(CancellationToken cancellat
// TODO: create Current Outfit Folder
}

var request = new OSDMap(1) { ["cof_version"] = currentoutfitfolder.Version };
var request = new OSDMap(1) { ["cof_version"] = currentOutfitFolder.Version };

var msg = "Server side baking failed";

Expand Down Expand Up @@ -2251,8 +2251,10 @@ await Client.HttpCapsClient.PostRequestAsync(cap, OSDFormat.Xml, request, cancel

for (var i = 0; i < textures.Length; i++)
{
selfAvatarTextures.FaceTextures[i] = new Primitive.TextureEntryFace(null);
selfAvatarTextures.FaceTextures[i].TextureID = textures[i];
selfAvatarTextures.FaceTextures[i] = new Primitive.TextureEntryFace(null)
{
TextureID = textures[i]
};
}

selfPrim.Textures = selfAvatarTextures;
Expand Down
21 changes: 6 additions & 15 deletions LibreMetaverse/InventoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,6 @@ await Client.HttpCapsClient.PostRequestAsync(capabilityUri, OSDFormat.Xml, paylo
// Do we have any descendants
if (fetchedFolder.DescendentCount > 0)
{
// Delete the old items, because otherwise it merges in cache.
if (_Store.Contains(fetchedFolder.UUID))
{
foreach (var oldItem in _Store.GetContents(fetchedFolder.UUID).ToList())
{
_Store.RemoveNodeFor(oldItem);
}
}

// Fetch descendent folders
if (res["categories"] is OSDArray folders)
{
Expand All @@ -842,7 +833,11 @@ await Client.HttpCapsClient.PostRequestAsync(capabilityUri, OSDFormat.Xml, paylo
{
folder = new InventoryFolder(folderID)
{
ParentUUID = descFolder["parent_id"]
ParentUUID = descFolder["parent_id"],
OwnerID = descFolder["agent_id"],
Name = descFolder["name"],
Version = descFolder["version"],
PreferredType = (FolderType)(int)descFolder["type_default"]
};
_Store[folderID] = folder;
}
Expand All @@ -851,11 +846,7 @@ await Client.HttpCapsClient.PostRequestAsync(capabilityUri, OSDFormat.Xml, paylo
folder = (InventoryFolder)_Store[folderID];
}

folder.OwnerID = descFolder["agent_id"];
folder.ParentUUID = descFolder["parent_id"];
folder.Name = descFolder["name"];
folder.Version = descFolder["version"];
folder.PreferredType = (FolderType)(int)descFolder["type_default"];

}

// Fetch descendent items
Expand Down

0 comments on commit ea5f5d5

Please sign in to comment.