Merge branch 'ubitworkmaster'

avinationmerge
Melanie Thielker 2014-08-21 02:38:57 +02:00
commit f06f13b59d
9 changed files with 140 additions and 66 deletions

View File

@ -1116,6 +1116,8 @@ namespace OpenSim.Framework
/// <param name="localID"></param> /// <param name="localID"></param>
void SendKillObject(List<uint> localID); void SendKillObject(List<uint> localID);
void SendPartFullUpdate(ISceneEntity ent, uint? parentID);
void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args); void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);

View File

@ -62,7 +62,9 @@ namespace OpenSim.Framework
private uint m_nextQueue = 0; private uint m_nextQueue = 0;
private uint m_countFromQueue = 0; private uint m_countFromQueue = 0;
// first queues are imediate, so no counts // first queues are imediate, so no counts
private uint[] m_queueCounts = {0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1}; // private uint[] m_queueCounts = { 0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1 };
private uint[] m_queueCounts = {0, 0, 8, 8, 5, 4, 3, 2, 1, 1, 1, 1};
// this is ava, ava, attach, <10m, 20,40,80,160m,320,640,1280, +
// next request is a counter of the number of updates queued, it provides // next request is a counter of the number of updates queued, it provides
// a total ordering on the updates coming through the queue and is more // a total ordering on the updates coming through the queue and is more

View File

@ -3838,6 +3838,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation)); m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation));
} }
/* dont use this
udp packet resent must be done at udp level only
re map from a packet to original updates just doesnt work
/// <summary> /// <summary>
/// Requeue an EntityUpdate when it was not acknowledged by the client. /// Requeue an EntityUpdate when it was not acknowledged by the client.
/// We will update the priority and put it in the correct queue, merging update flags /// We will update the priority and put it in the correct queue, merging update flags
@ -3854,6 +3858,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_entityUpdates.Enqueue(priority, update); m_entityUpdates.Enqueue(priority, update);
} }
/// <summary> /// <summary>
/// Requeue a list of EntityUpdates when they were not acknowledged by the client. /// Requeue a list of EntityUpdates when they were not acknowledged by the client.
/// We will update the priority and put it in the correct queue, merging update flags /// We will update the priority and put it in the correct queue, merging update flags
@ -3879,6 +3884,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
foreach (EntityUpdate update in updates) foreach (EntityUpdate update in updates)
ResendPrimUpdate(update); ResendPrimUpdate(update);
} }
*/
// OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>(); // OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>> objectUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdatePacket.ObjectDataBlock>>();
// OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>(); // OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>> compressedUpdateBlocks = new OpenSim.Framework.Lazy<List<ObjectUpdateCompressedPacket.ObjectDataBlock>>();
@ -4197,10 +4203,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
for (int i = 0; i < blocks.Count; i++) for (int i = 0; i < blocks.Count; i++)
packet.ObjectData[i] = blocks[i]; packet.ObjectData[i] = blocks[i];
OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); // OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
// use default udp retry
OutPacket(packet, ThrottleOutPacketType.Task, true);
} }
#endregion Packet Sending #endregion Packet Sending
}
// hack.. dont use
public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
{
if (ent is SceneObjectPart)
{
SceneObjectPart part = (SceneObjectPart)ent;
ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
packet.RegionData.TimeDilation = 1;
packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
ObjectUpdatePacket.ObjectDataBlock blk = CreatePrimUpdateBlock(part, this.m_agentId);
if (parentID.HasValue)
{
blk.ParentID = parentID.Value;
}
packet.ObjectData[0] = blk;
OutPacket(packet, ThrottleOutPacketType.Task, true);
}
} }
public void ReprioritizeUpdates() public void ReprioritizeUpdates()

View File

@ -175,7 +175,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// Attachments are high priority, // Attachments are high priority,
if (((SceneObjectPart)entity).ParentGroup.IsAttachment) if (((SceneObjectPart)entity).ParentGroup.IsAttachment)
return 1; return 2;
pqueue = ComputeDistancePriority(client, entity, false); pqueue = ComputeDistancePriority(client, entity, false);
@ -233,15 +233,27 @@ namespace OpenSim.Region.Framework.Scenes
// And convert the distance to a priority queue, this computation gives queues // And convert the distance to a priority queue, this computation gives queues
// at 10, 20, 40, 80, 160, 320, 640, and 1280m // at 10, 20, 40, 80, 160, 320, 640, and 1280m
uint pqueue = PriorityQueue.NumberOfImmediateQueues; uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue
uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues;
/*
for (int i = 0; i < queues - 1; i++) for (int i = 0; i < queues - 1; i++)
{ {
if (distance < 30 * Math.Pow(2.0,i)) if (distance < 30 * Math.Pow(2.0,i))
break; break;
pqueue++; pqueue++;
} }
*/
if (distance > 10f)
{
float tmp = (float)Math.Log((double)distance) * 1.4426950408889634073599246810019f - 3.3219280948873623478703194294894f;
// for a map identical to original:
// now
// 1st constant is 1/(log(2)) (natural log) so we get log2(distance)
// 2st constant makes it be log2(distance/10)
pqueue += (uint)tmp;
if (pqueue > queues - 1)
pqueue = queues - 1;
}
// If this is a root agent, then determine front & back // If this is a root agent, then determine front & back
// Bump up the priority queue (drop the priority) for any objects behind the avatar // Bump up the priority queue (drop the priority) for any objects behind the avatar

View File

@ -296,6 +296,18 @@ namespace OpenSim.Region.Framework.Scenes
return myID; return myID;
} }
public uint AllocatePresenceLocalId()
{
uint myID;
_primAllocateMutex.WaitOne();
myID = ++m_lastAllocatedLocalId;
++m_lastAllocatedLocalId;
_primAllocateMutex.ReleaseMutex();
return myID;
}
#region Module Methods #region Module Methods
/// <summary> /// <summary>

View File

@ -969,7 +969,7 @@ namespace OpenSim.Region.Framework.Scenes
m_name = String.Format("{0} {1}", Firstname, Lastname); m_name = String.Format("{0} {1}", Firstname, Lastname);
m_scene = world; m_scene = world;
m_uuid = client.AgentId; m_uuid = client.AgentId;
LocalId = m_scene.AllocateLocalId(); LocalId = m_scene.AllocatePresenceLocalId();
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
if (account != null) if (account != null)
@ -1878,7 +1878,6 @@ namespace OpenSim.Region.Framework.Scenes
if (!IsChildAgent) if (!IsChildAgent)
{ {
ValidateAndSendAppearanceAndAgentData(); ValidateAndSendAppearanceAndAgentData();
m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
@ -1900,35 +1899,31 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name);
List<uint> kk = new List<uint>();
// Resume scripts this possible should also be moved down after sending the avatar to viewer ? // Resume scripts this possible should also be moved down after sending the avatar to viewer ?
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {
foreach (SceneObjectPart part in sog.Parts)
kk.Add(part.LocalId);
sog.SendFullUpdateToClient(ControllingClient); sog.SendFullUpdateToClient(ControllingClient);
SendFullUpdateToClient(ControllingClient); SendFullUpdateToClient(ControllingClient);
if (!sog.HasPrivateAttachmentPoint)
{
// sog.ScheduleGroupForFullUpdate(); // sog.ScheduleGroupForFullUpdate();
m_scene.ForEachScenePresence(delegate(ScenePresence p) m_scene.ForEachScenePresence(delegate(ScenePresence p)
{ {
if (p == this) if (p == this)
return; return;
if (sog.HasPrivateAttachmentPoint)
return;
if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
return; return;
p.ControllingClient.SendKillObject(kk); p.ControllingClient.SendPartFullUpdate(sog.RootPart,LocalId + 1);
sog.SendFullUpdateToClient(p.ControllingClient); sog.SendFullUpdateToClient(p.ControllingClient);
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
}); });
}
sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource());
sog.ResumeScripts(); sog.ResumeScripts();
kk.Clear();
} }
} }
} }
@ -4752,12 +4747,18 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)
{ {
if (p == this || !sog.HasPrivateAttachmentPoint) if (p == this || !sog.HasPrivateAttachmentPoint)
{
p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1);
sog.SendFullUpdateToClient(p.ControllingClient); sog.SendFullUpdateToClient(p.ControllingClient);
} }
}
SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path
} }
} }
// send attachments to a client without filters except for huds
// for now they are checked in several places down the line...
// kills all parts before sending
public void SendAttachmentsToAgentNFPK(ScenePresence p) public void SendAttachmentsToAgentNFPK(ScenePresence p)
{ {
lock (m_attachments) lock (m_attachments)
@ -5680,7 +5681,7 @@ namespace OpenSim.Region.Framework.Scenes
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNFPK(this); p.SendAttachmentsToAgentNF(this);
} }
} }
} }
@ -5995,7 +5996,7 @@ namespace OpenSim.Region.Framework.Scenes
SendAppearanceToAgent(p); SendAppearanceToAgent(p);
if (Animator != null) if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient); Animator.SendAnimPackToClient(p.ControllingClient);
SendAttachmentsToAgentNFPK(p); SendAttachmentsToAgentNF(p);
} }
} }
@ -6011,7 +6012,7 @@ namespace OpenSim.Region.Framework.Scenes
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
if (p.Animator != null) if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient); p.Animator.SendAnimPackToClient(ControllingClient);
p.SendAttachmentsToAgentNFPK(this); p.SendAttachmentsToAgentNF(this);
} }
} }
} }

View File

@ -1702,5 +1702,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
{ {
} }
public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
{
}
} }
} }

View File

@ -1272,5 +1272,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{ {
} }
public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
{
}
} }
} }

View File

@ -536,6 +536,10 @@ namespace OpenSim.Tests.Common.Mock
ReceivedKills.AddRange(localID); ReceivedKills.AddRange(localID);
} }
public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
{
}
public virtual void SetChildAgentThrottle(byte[] throttle) public virtual void SetChildAgentThrottle(byte[] throttle)
{ {
} }