Patch for mantis 0000015: Textures don't display in the object

properties window

From Justin Casey (IBM)
afrisby
Sean Dague 2007-11-30 20:16:40 +00:00
parent 95c68a316a
commit b167507e32
5 changed files with 45 additions and 13 deletions

View File

@ -36,6 +36,13 @@ namespace OpenSim.Framework.Communications.Cache
public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>(); public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
// Accessors
public int SubFoldersCount
{
get { return SubFolders.Count; }
}
// Constructors
public InventoryFolderImpl(InventoryFolderBase folderbase) public InventoryFolderImpl(InventoryFolderBase folderbase)
{ {
agentID = folderbase.agentID; agentID = folderbase.agentID;

View File

@ -111,6 +111,15 @@ namespace OpenSim.Framework.Communications.Cache
} }
} }
/// <summary>
/// Tell the client about the various child items and folders contained in the requested folder.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="folderID"></param>
/// <param name="ownerID"></param>
/// <param name="fetchFolders"></param>
/// <param name="fetchItems"></param>
/// <param name="sortOrder"></param>
public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID, public void HandleFecthInventoryDescendents(IClientAPI remoteClient, LLUUID folderID, LLUUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder) bool fetchFolders, bool fetchItems, int sortOrder)
{ {
@ -118,14 +127,14 @@ namespace OpenSim.Framework.Communications.Cache
if (folderID == libraryRoot.folderID) if (folderID == libraryRoot.folderID)
{ {
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID, remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, libraryRoot.folderID,
libraryRoot.RequestListOfItems()); libraryRoot.RequestListOfItems(), libraryRoot.SubFoldersCount);
return; return;
} }
if ((fold = libraryRoot.HasSubFolder(folderID)) != null) if ((fold = libraryRoot.HasSubFolder(folderID)) != null)
{ {
remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems()); remoteClient.SendInventoryFolderDetails(libraryRoot.agentID, folderID, fold.RequestListOfItems(), fold.SubFoldersCount);
return; return;
} }
@ -140,16 +149,16 @@ namespace OpenSim.Framework.Communications.Cache
if (fetchItems) if (fetchItems)
{ {
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID,
userProfile.RootFolder.RequestListOfItems()); userProfile.RootFolder.RequestListOfItems(), userProfile.RootFolder.SubFoldersCount);
} }
} }
else else
{ {
InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(folderID); InventoryFolderImpl folder = userProfile.RootFolder.HasSubFolder(folderID);
if ((folder != null) && fetchItems)
if (fetchItems && folder != null)
{ {
remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, remoteClient.SendInventoryFolderDetails(remoteClient.AgentId, folderID, folder.RequestListOfItems(), folder.SubFoldersCount);
folder.RequestListOfItems());
} }
} }
} }

View File

@ -449,7 +449,7 @@ namespace OpenSim.Framework
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
LLQuaternion rotation,LLVector3 velocity, LLVector3 rotationalvelocity); LLQuaternion rotation,LLVector3 velocity, LLVector3 rotationalvelocity);
void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items); void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, int subFoldersCount);
void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item); void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
void SendInventoryItemUpdate(InventoryItemBase Item); void SendInventoryItemUpdate(InventoryItemBase Item);
void SendRemoveInventoryItem(LLUUID itemID); void SendRemoveInventoryItem(LLUUID itemID);

View File

@ -1031,7 +1031,16 @@ namespace OpenSim.Region.ClientStack
OutPacket(kill, ThrottleOutPacketType.Task); OutPacket(kill, ThrottleOutPacketType.Task);
} }
public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) /// <summary>
/// Send information about the items contained in a folder to the client.
/// </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, int subFoldersCount)
{ {
Encoding enc = Encoding.ASCII; Encoding enc = Encoding.ASCII;
uint FULL_MASK_PERMISSIONS = 2147483647; uint FULL_MASK_PERMISSIONS = 2147483647;
@ -1041,13 +1050,20 @@ namespace OpenSim.Region.ClientStack
if (items.Count < 40) if (items.Count < 40)
{ {
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count];
descend.AgentData.Descendents = 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;
} }
else else
{ {
descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40]; descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[40];
descend.AgentData.Descendents = 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;
} }
int i = 0; int i = 0;
foreach (InventoryItemBase item in items) foreach (InventoryItemBase item in items)
{ {

View File

@ -301,7 +301,7 @@ namespace SimpleApp
{ {
} }
public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) public virtual void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, int subFoldersCount)
{ {
} }