From 46db73b62baec7baf0e33d83efbaafaadcd4db0d Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 23 Dec 2010 03:30:09 -0500 Subject: * Re-Adding Scene TimeDilation to Object Update Packets. * Added Calculating Time Dilation in the OdePlubin * When multiple object updates are stuffed into one packet, average the time dilation between them as a compromise. * Time Dilation on the update is calculated when the EntityUpdate object is created. The pre-calc-ed TD is stored in the Entity update and used when it goes out on the wire. Previously, it was 1.0 all the time. The time dilation is tied to when the update is created, not when the update is sent. --- OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 929f282..f27a6eb 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3554,7 +3554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP double priority = m_prioritizer.GetUpdatePriority(this, entity); lock (m_entityUpdates.SyncRoot) - m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); + m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation), entity.LocalId); } private void ProcessEntityUpdates(int maxUpdates) @@ -3570,14 +3570,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race // condition where a kill can be processed before an out-of-date update for the same object. lock (m_killRecord) - { + { + float avgTimeDilation = 1.0f; EntityUpdate update; while (updatesThisCall < maxUpdates) { lock (m_entityUpdates.SyncRoot) if (!m_entityUpdates.TryDequeue(out update)) break; - + avgTimeDilation += update.TimeDilation; + avgTimeDilation *= 0.5f; + if (update.Entity is SceneObjectPart) { SceneObjectPart part = (SceneObjectPart)update.Entity; @@ -3725,8 +3728,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Packet Sending - const float TIME_DILATION = 1.0f; - ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); + //const float TIME_DILATION = 1.0f; + + + ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); if (terseAgentUpdateBlocks.IsValueCreated) { @@ -3739,7 +3744,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP for (int i = 0; i < blocks.Count; i++) packet.ObjectData[i] = blocks[i]; - + + OutPacket(packet, ThrottleOutPacketType.Unknown, true); } -- cgit v1.1 From 54418c5e69c5085750762e2bd3220ae7a6808471 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 23 Dec 2010 10:05:08 -0800 Subject: Removed unused code -- this was the previous version of UDP texture sending, which now lives entirely in LindenUDP space. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 40 +++++++++------------- 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 929f282..4e4ecea 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -7189,34 +7189,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP //handlerTextureRequest = null; for (int i = 0; i < imageRequest.RequestImage.Length; i++) { - if (OnRequestTexture != null) - { - TextureRequestArgs args = new TextureRequestArgs(); - - RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i]; - - args.RequestedAssetID = block.Image; - args.DiscardLevel = block.DiscardLevel; - args.PacketNumber = block.Packet; - args.Priority = block.DownloadPriority; - args.requestSequence = imageRequest.Header.Sequence; + TextureRequestArgs args = new TextureRequestArgs(); - // NOTE: This is not a built in part of the LLUDP protocol, but we double the - // priority of avatar textures to get avatars rezzing in faster than the - // surrounding scene - if ((ImageType)block.Type == ImageType.Baked) - args.Priority *= 2.0f; + RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i]; - //handlerTextureRequest = OnRequestTexture; + args.RequestedAssetID = block.Image; + args.DiscardLevel = block.DiscardLevel; + args.PacketNumber = block.Packet; + args.Priority = block.DownloadPriority; + args.requestSequence = imageRequest.Header.Sequence; - //if (handlerTextureRequest != null) - //OnRequestTexture(this, args); + // NOTE: This is not a built in part of the LLUDP protocol, but we double the + // priority of avatar textures to get avatars rezzing in faster than the + // surrounding scene + if ((ImageType)block.Type == ImageType.Baked) + args.Priority *= 2.0f; - // in the end, we null this, so we have to check if it's null - if (m_imageManager != null) - { - m_imageManager.EnqueueReq(args); - } + // in the end, we null this, so we have to check if it's null + if (m_imageManager != null) + { + m_imageManager.EnqueueReq(args); } } return true; -- cgit v1.1