Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

iar_mods
BlueWall 2012-01-03 12:22:13 -05:00
commit e78a3913e0
7 changed files with 109 additions and 84 deletions

View File

@ -240,78 +240,84 @@ namespace OpenSim.Capabilities.Handlers
if (containingFolder != null)
{
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
// containingFolder.Name, containingFolder.ID, agentID);
version = containingFolder.Version;
if (fetchItems)
{
/*
List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
foreach (InventoryItemBase item in contents.Items)
{
if (item.AssetType == (int)AssetType.Link)
{
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
// Take care of genuinely broken links where the target doesn't exist
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// rather than having to keep track of every folder requested in the recursion.
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link && linkedItem.AssetType == (int)AssetType.Object)
linkedItemsToAdd.Add(linkedItem);
}
}
foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
{
m_log.DebugFormat(
"[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
linkedItem.Name, folderID, agentID);
contents.Items.Insert(0, linkedItem);
}
*/
/*
// If the folder requested contains links, then we need to send those folders first, otherwise the links
// will be broken in the viewer.
HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
foreach (InventoryItemBase item in contents.Items)
{
if (item.AssetType == (int)AssetType.Link)
{
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
// Take care of genuinely broken links where the target doesn't exist
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// rather than having to keep track of every folder requested in the recursion.
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
{
// We don't need to send the folder if source and destination of the link are in the same
// folder.
if (linkedItem.Folder != containingFolder.ID)
linkedItemFolderIdsToSend.Add(linkedItem.Folder);
}
}
}
foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
{
m_log.DebugFormat(
"[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
linkedItemFolderId, folderID, agentID);
int dummyVersion;
InventoryCollection linkedCollection
= Fetch(
agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
contents.Folders.AddRange(linkedCollection.Folders);
contents.Items.AddRange(linkedCollection.Items);
}
*/
}
//
// if (fetchItems)
// {
// List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
//
// foreach (InventoryItemBase item in contents.Items)
// {
// if (item.AssetType == (int)AssetType.Link)
// {
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
//
// // Take care of genuinely broken links where the target doesn't exist
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// // rather than having to keep track of every folder requested in the recursion.
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
// linkedItemsToAdd.Insert(0, linkedItem);
// }
// }
//
// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
// {
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
// linkedItem.Name, folderID, agentID);
//
// contents.Items.Add(linkedItem);
// }
//
// // If the folder requested contains links, then we need to send those folders first, otherwise the links
// // will be broken in the viewer.
// HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
// foreach (InventoryItemBase item in contents.Items)
// {
// if (item.AssetType == (int)AssetType.Link)
// {
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
//
// // Take care of genuinely broken links where the target doesn't exist
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// // rather than having to keep track of every folder requested in the recursion.
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
// {
// // We don't need to send the folder if source and destination of the link are in the same
// // folder.
// if (linkedItem.Folder != containingFolder.ID)
// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
// }
// }
// }
//
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
// {
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
// linkedItemFolderId, folderID, agentID);
//
// int dummyVersion;
// InventoryCollection linkedCollection
// = Fetch(
// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
//
// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
// linkedFolder.Owner = agentID;
// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
//
//// contents.Folders.AddRange(linkedCollection.Folders);
//
// contents.Folders.Add(linkedFolder);
// contents.Items.AddRange(linkedCollection.Items);
// }
// }
}
}
else

View File

@ -56,9 +56,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IAssetService AssetService;
public UUID AgentID;
public IInventoryAccessModule InventoryAccessModule;
public OpenJPEG.J2KLayerInfo[] Layers;
public bool IsDecoded;
public bool HasAsset;
private OpenJPEG.J2KLayerInfo[] m_layers;
public bool IsDecoded { get; private set; }
public bool HasAsset { get; private set; }
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
private uint m_currentPacket;
@ -170,14 +170,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DiscardLevel >= 0 || m_stopPacket == 0)
{
// This shouldn't happen, but if it does, we really can't proceed
if (Layers == null)
if (m_layers == null)
{
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
m_currentPacket = m_stopPacket;
return;
}
int maxDiscardLevel = Math.Max(0, Layers.Length - 1);
int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
if (DiscardLevel < 0 && m_stopPacket == 0)
@ -187,9 +187,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
//Calculate the m_stopPacket
if (Layers.Length > 0)
if (m_layers.Length > 0)
{
m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End);
m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
//I don't know why, but the viewer seems to expect the final packet if the file
//is just one packet bigger.
if (TexturePacketCount() == m_stopPacket + 1)
@ -341,7 +341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
{
Layers = layers;
m_layers = layers;
IsDecoded = true;
RunUpdate();
}

View File

@ -39,6 +39,9 @@ using log4net;
namespace OpenSim.Region.ClientStack.LindenUDP
{
/// <summary>
/// This class handles UDP texture requests.
/// </summary>
public class LLImageManager
{
private sealed class J2KImageComparer : IComparer<J2KImage>
@ -208,7 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Priority Queue Helpers
J2KImage GetHighestPriorityImage()
private J2KImage GetHighestPriorityImage()
{
J2KImage image = null;
@ -223,23 +226,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return image;
}
void AddImageToQueue(J2KImage image)
private void AddImageToQueue(J2KImage image)
{
image.PriorityQueueHandle = null;
lock (m_syncRoot)
{
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
catch (Exception) { }
}
}
void RemoveImageFromQueue(J2KImage image)
private void RemoveImageFromQueue(J2KImage image)
{
lock (m_syncRoot)
{
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
catch (Exception) { }
}
}
void UpdateImageInQueue(J2KImage image)
private void UpdateImageInQueue(J2KImage image)
{
lock (m_syncRoot)
{
@ -254,4 +261,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion Priority Queue Helpers
}
}
}

View File

@ -152,6 +152,9 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
/// <param name="j2kData">JPEG2000 data</param>
private void DoJ2KDecode(UUID assetID, byte[] j2kData)
{
// m_log.DebugFormat(
// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
//int DecodeTime = 0;
//DecodeTime = Environment.TickCount;
OpenJPEG.J2KLayerInfo[] layers;

View File

@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public AssetBase GetCached(string id)
{
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
if (m_Cache != null)
return m_Cache.Get(id);

View File

@ -2822,6 +2822,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_global_contactcount = 0;
d.WorldQuickStep(world, ODE_STEPSIZE);
d.JointGroupEmpty(contactgroup);
}
catch (Exception e)

View File

@ -100,6 +100,8 @@ namespace OpenSim.Services.Connectors
public AssetBase Get(string id)
{
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Synchronous get request for {0}", id);
string uri = m_ServerURI + "/assets/" + id;
AssetBase asset = null;
@ -119,6 +121,8 @@ namespace OpenSim.Services.Connectors
public AssetBase GetCached(string id)
{
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Cache request for {0}", id);
if (m_Cache != null)
return m_Cache.Get(id);
@ -177,6 +181,8 @@ namespace OpenSim.Services.Connectors
public bool Get(string id, Object sender, AssetRetrieved handler)
{
// m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id);
string uri = m_ServerURI + "/assets/" + id;
AssetBase asset = null;