Stop some hud components disappearing on region crossings

If viewers (or at least, Linden Viewer 1.23.5) receive child hud object updates before the root prim, then the children are not displayed.
Updates were being queued in LLClientView in the right order (root first) but were being sent in a random order since they were all at the same prioritization
This commit prioritizes the root prim of a hud to its highest level when queued.
I'm not sure if the periodic reprioritization triggered via ScenePresence might reset this, but boosting priority appears to work so far.
Also committed is a belt and braces mechanism in LLClientView to prevent child hud prim being sent out before their root, but since this doesn't appear to be needed it is currently commented out.
0.6.9-post-fixes
Justin Clark-Casey (justincc) 2010-06-07 18:49:22 +01:00
parent 693b5d0838
commit 912f0c7fde
4 changed files with 79 additions and 14 deletions

View File

@ -365,6 +365,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </value>
protected HashSet<uint> m_killRecord;
// protected HashSet<uint> m_attachmentsQueued;
// protected HashSet<uint> m_attachmentsSent;
private int m_moneyBalance;
private int m_animationSequenceNumber = 1;
private bool m_SendLogoutPacketWhenClosing = true;
@ -456,6 +459,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count);
m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
m_killRecord = new HashSet<uint>();
// m_attachmentsQueued = new HashSet<uint>();
// m_attachmentsSent = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
@ -3401,6 +3406,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
OutPacket(objupdate, ThrottleOutPacketType.Task);
// We need to record the avatar local id since the root prim of an attachment points to this.
// m_attachmentsSent.Add(data.AvatarLocalID);
}
/// <summary>
@ -3523,6 +3531,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
ObjectUpdatePacket.ObjectDataBlock objectData = CreatePrimUpdateBlock(data);
// if (data.attachment)
// m_attachmentsQueued.Add(data.localID);
lock (m_primFullUpdates.SyncRoot)
m_primFullUpdates.Enqueue(data.priority, objectData, data.localID);
@ -3549,15 +3560,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue();
if (!m_killRecord.Contains(block.ID))
{
{
// if (m_attachmentsQueued.Contains(block.ID))
// {
// string text = Util.FieldToString(block.Text);
// if (text.IndexOf("\n") >= 0)
// text = text.Remove(text.IndexOf("\n"));
//
// if (m_attachmentsSent.Contains(block.ParentID))
// {
// m_log.DebugFormat(
// "[CLIENT]: Sending full info about attached prim {0} text {1}",
// block.ID, text);
//
// m_fullUpdateDataBlocksBuilder.Add(block);
//
// m_attachmentsSent.Add(block.ID);
// }
// else
// {
// m_log.DebugFormat(
// "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet",
// block.ID, text, block.ParentID);
//
// lock (m_primFullUpdates.SyncRoot)
// m_primFullUpdates.Enqueue(double.MaxValue, block, block.ID);
// }
// }
// else
// {
m_fullUpdateDataBlocksBuilder.Add(block);
// string text = Util.FieldToString(outPacket.ObjectData[i].Text);
// if (text.IndexOf("\n") >= 0)
// text = text.Remove(text.IndexOf("\n"));
// m_log.DebugFormat(
// "[CLIENT]: Sending full info about prim {0} text {1} to client {2}",
// outPacket.ObjectData[i].ID, text, Name);
// }
}
// else
// {
@ -4506,6 +4539,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(SendPrimitiveData data)
{
// if (data.attachment)
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Creating prim update block for {0}, parent {1}, priority {2}",
// data.localID, data.parentID, data.priority);
byte[] objectData = new byte[60];
data.pos.ToBytes(objectData, 0);
data.vel.ToBytes(objectData, 12);

View File

@ -2929,10 +2929,33 @@ namespace OpenSim.Region.Framework.Scenes
//isattachment = ParentGroup.RootPart.IsAttachment;
byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
remoteClient.SendPrimitiveToClient(new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape,
lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID,
m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment,
AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, ParentGroup.GetUpdatePriority(remoteClient)));
double priority = ParentGroup.GetUpdatePriority(remoteClient);
if (IsRoot && IsAttachment)
{
if (double.MinValue == priority)
{
m_log.WarnFormat(
"[SOP]: Couldn't raise update priority of root part for attachment {0} {1} because priority is already highest value",
Name, LocalId);
}
else
{
priority = double.MinValue;
}
}
remoteClient.SendPrimitiveToClient(
new SendPrimitiveData(m_regionHandle, m_parentGroup.GetTimeDilation(), LocalId, m_shape,
lPos, Velocity, Acceleration, RotationOffset, AngularVelocity, clientFlags, m_uuid, _ownerID,
m_text, color, _parentID, m_particleSystem, m_clickAction, (byte)m_material, m_TextureAnimation, IsAttachment,
AttachmentPoint,FromItemID, Sound, SoundGain, SoundFlags, SoundRadius, priority));
// if (IsRoot && IsAttachment)
// {
// ScenePresence sp = ParentGroup.Scene.GetScenePresence(remoteClient.AgentId);
// remoteClient.ReprioritizeUpdates(StateUpdateTypes.PrimitiveFull, sp.UpdatePriority);
// }
}
/// <summary>

View File

@ -3871,8 +3871,10 @@ namespace OpenSim.Region.Framework.Scenes
}
}
private double UpdatePriority(UpdatePriorityData data)
internal double UpdatePriority(UpdatePriorityData data)
{
// m_log.DebugFormat("[SCENE PRESENCE]: Reprioritizing updates to client {0} for {1}", Name, data.localID);
EntityBase entity;
SceneObjectGroup group;

View File

@ -12,7 +12,9 @@
<log4net>
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{HH:mm:ss,fff} - %message" />
<conversionPattern value="%date{HH:mm:ss} - %message" />
<!-- Use the line below instead of the one above if you want milliseconds in your log timestamps -->
<!-- <conversionPattern value="%date{HH:mm:ss,fff} - %message" /> -->
</layout>
</appender>