Refix bug where inventory textures don't appear in prim edit texture selection box
unless previously expanded in inventory.afrisby
parent
13f85c9d82
commit
42bc256e4f
|
@ -176,11 +176,14 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
public void HandleFetchInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
|
||||
bool fetchFolders, bool fetchItems, int sortOrder)
|
||||
{
|
||||
// XXX We're not handling sortOrder yet!
|
||||
|
||||
InventoryFolderImpl fold = null;
|
||||
if (folderID == libraryRoot.folderID)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID,
|
||||
libraryRoot.RequestListOfItems(), libraryRoot.RequestListOfFolders(), libraryRoot.SubFoldersCount);
|
||||
remoteClient.SendInventoryFolderDetails(
|
||||
libraryRoot.agentID, libraryRoot.folderID, libraryRoot.RequestListOfItems(),
|
||||
libraryRoot.RequestListOfFolders(), fetchFolders, fetchItems);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -188,7 +191,9 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
|
||||
{
|
||||
System.Console.WriteLine("fetching librarysubfolder");
|
||||
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount);
|
||||
remoteClient.SendInventoryFolderDetails(
|
||||
libraryRoot.agentID, folderID, fold.RequestListOfItems(),
|
||||
fold.RequestListOfFolders(), fetchFolders, fetchItems);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -203,15 +208,19 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
System.Console.Write("fetching root folder");
|
||||
if (fetchItems)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID,
|
||||
userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.RequestListOfFolders(), userProfile.RootFolder.SubFoldersCount);
|
||||
remoteClient.SendInventoryFolderDetails(
|
||||
remoteClient.AgentId, folderID, userProfile.RootFolder.RequestListOfItems(),
|
||||
userProfile.RootFolder.RequestListOfFolders(),
|
||||
fetchFolders, fetchItems);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((fold = userProfile.RootFolder.HasSubFolder(folderID)) != null)
|
||||
{
|
||||
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, fold.RequestListOfItems(), fold.RequestListOfFolders(), fold.SubFoldersCount);
|
||||
remoteClient.SendInventoryFolderDetails(
|
||||
remoteClient.AgentId, folderID, fold.RequestListOfItems(),
|
||||
fold.RequestListOfFolders(), fetchFolders, fetchItems);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -540,7 +540,9 @@ namespace OpenSim.Framework
|
|||
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
|
||||
LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity);
|
||||
|
||||
void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int subFoldersCount);
|
||||
void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items,
|
||||
List<InventoryFolderBase> folders, bool fetchFolders,
|
||||
bool fetchItems);
|
||||
void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -898,37 +898,46 @@ namespace OpenSim.Region.ClientStack
|
|||
|
||||
/// <summary>
|
||||
/// Send information about the items contained in a folder to the client.
|
||||
///
|
||||
/// XXX This method needs some refactoring loving
|
||||
/// </summary>
|
||||
/// <param name="ownerID">The owner of the folder</param>
|
||||
/// <param name="folderID">The id of the folder</param>
|
||||
/// <param name="items">The items contained in the folder identified by folderID</param>
|
||||
/// <param name="subFoldersCount">The number of subfolders contained in the given folder. This is necessary since
|
||||
/// the client is expecting inventory packets which incorporate this number into the descendents field, even though
|
||||
/// we send back no details of the folders themselves (only the items).</param>
|
||||
public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int subFoldersCount)
|
||||
/// <param name="fetchFolders">Do we need to send folder information?</param>
|
||||
/// <param name="fetchItems">Do we need to send item information?</param>
|
||||
public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items,
|
||||
List<InventoryFolderBase> folders,
|
||||
bool fetchFolders, bool fetchItems)
|
||||
{
|
||||
Encoding enc = Encoding.ASCII;
|
||||
uint FULL_MASK_PERMISSIONS = 2147483647;
|
||||
|
||||
if (fetchItems)
|
||||
{
|
||||
InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||
|
||||
int count = 0;
|
||||
if (items.Count < 40)
|
||||
{
|
||||
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
|
||||
// In the very first packet, also include the sub folders count so that the total descendents the
|
||||
// client receives matches its expectations. Subsequent inventory packets need contain only the count
|
||||
// of the number of items actually in them.
|
||||
descend.AgentData.Descendents = items.Count + subFoldersCount;
|
||||
descend.AgentData.Descendents = items.Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
|
||||
// In the very first packet, also include the sub folders count so that the total descendents the
|
||||
// client receives matches its expectations. Subsequent inventory packets need contain only the count
|
||||
// of the number of items actually in them.
|
||||
descend.AgentData.Descendents = 40 + subFoldersCount;
|
||||
descend.AgentData.Descendents = 40;
|
||||
}
|
||||
|
||||
// Even if we aren't fetching the folders, we still need to include the folder count
|
||||
// in the total number of descendents. Failure to do so will cause subtle bugs such
|
||||
// as the failure of textures which haven't been expanded in inventory to show up
|
||||
// in the texture prim edit selection panel.
|
||||
if (!fetchFolders)
|
||||
{
|
||||
descend.AgentData.Descendents += folders.Count;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
int i = 0;
|
||||
foreach (InventoryItemBase item in items)
|
||||
{
|
||||
|
@ -988,12 +997,33 @@ namespace OpenSim.Region.ClientStack
|
|||
{
|
||||
OutPacket(descend, ThrottleOutPacketType.Asset);
|
||||
}
|
||||
}
|
||||
|
||||
//send subfolders
|
||||
descend = CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||
if (fetchFolders)
|
||||
{
|
||||
InventoryDescendentsPacket descend = CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||
|
||||
if (folders.Count < 40)
|
||||
{
|
||||
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count];
|
||||
i = 0;
|
||||
count = 0;
|
||||
descend.AgentData.Descendents = folders.Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[40];
|
||||
descend.AgentData.Descendents = 40;
|
||||
}
|
||||
|
||||
// Not sure if this scenario ever actually occurs, but nonetheless we include the items
|
||||
// count even if we're not sending item data for the same reasons as above.
|
||||
if (!fetchItems)
|
||||
{
|
||||
descend.AgentData.Descendents += items.Count;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
int count = 0;
|
||||
foreach (InventoryFolderBase folder in folders)
|
||||
{
|
||||
descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
|
||||
|
@ -1001,6 +1031,7 @@ namespace OpenSim.Region.ClientStack
|
|||
descend.FolderData[i].Name = Helpers.StringToField(folder.name);
|
||||
descend.FolderData[i].ParentID = folder.parentID;
|
||||
descend.FolderData[i].Type = (sbyte)folder.type;
|
||||
|
||||
i++;
|
||||
count++;
|
||||
if (i == 40)
|
||||
|
@ -1012,7 +1043,7 @@ namespace OpenSim.Region.ClientStack
|
|||
descend = CreateInventoryDescendentsPacket(ownerID, folderID);
|
||||
if ((folders.Count - count) < 40)
|
||||
{
|
||||
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[items.Count - count];
|
||||
descend.FolderData = new InventoryDescendentsPacket.FolderDataBlock[folders.Count - count];
|
||||
descend.AgentData.Descendents = folders.Count - count;
|
||||
}
|
||||
else
|
||||
|
@ -1030,6 +1061,7 @@ namespace OpenSim.Region.ClientStack
|
|||
OutPacket(descend, ThrottleOutPacketType.Asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)
|
||||
{
|
||||
|
|
|
@ -323,7 +323,11 @@ namespace SimpleApp
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, List<InventoryFolderBase> folders, int subFoldersCount)
|
||||
public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID,
|
||||
List<InventoryItemBase> items,
|
||||
List<InventoryFolderBase> folders,
|
||||
bool fetchFolders,
|
||||
bool fetchItems)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue