aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs58
1 files changed, 28 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 929f282..d63b719 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -3554,7 +3554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3554 double priority = m_prioritizer.GetUpdatePriority(this, entity); 3554 double priority = m_prioritizer.GetUpdatePriority(this, entity);
3555 3555
3556 lock (m_entityUpdates.SyncRoot) 3556 lock (m_entityUpdates.SyncRoot)
3557 m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); 3557 m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation), entity.LocalId);
3558 } 3558 }
3559 3559
3560 private void ProcessEntityUpdates(int maxUpdates) 3560 private void ProcessEntityUpdates(int maxUpdates)
@@ -3570,14 +3570,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3570 // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race 3570 // We must lock for both manipulating the kill record and sending the packet, in order to avoid a race
3571 // condition where a kill can be processed before an out-of-date update for the same object. 3571 // condition where a kill can be processed before an out-of-date update for the same object.
3572 lock (m_killRecord) 3572 lock (m_killRecord)
3573 { 3573 {
3574 float avgTimeDilation = 1.0f;
3574 EntityUpdate update; 3575 EntityUpdate update;
3575 while (updatesThisCall < maxUpdates) 3576 while (updatesThisCall < maxUpdates)
3576 { 3577 {
3577 lock (m_entityUpdates.SyncRoot) 3578 lock (m_entityUpdates.SyncRoot)
3578 if (!m_entityUpdates.TryDequeue(out update)) 3579 if (!m_entityUpdates.TryDequeue(out update))
3579 break; 3580 break;
3580 3581 avgTimeDilation += update.TimeDilation;
3582 avgTimeDilation *= 0.5f;
3583
3581 if (update.Entity is SceneObjectPart) 3584 if (update.Entity is SceneObjectPart)
3582 { 3585 {
3583 SceneObjectPart part = (SceneObjectPart)update.Entity; 3586 SceneObjectPart part = (SceneObjectPart)update.Entity;
@@ -3725,8 +3728,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3725 3728
3726 #region Packet Sending 3729 #region Packet Sending
3727 3730
3728 const float TIME_DILATION = 1.0f; 3731 //const float TIME_DILATION = 1.0f;
3729 ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); 3732
3733
3734 ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f);
3730 3735
3731 if (terseAgentUpdateBlocks.IsValueCreated) 3736 if (terseAgentUpdateBlocks.IsValueCreated)
3732 { 3737 {
@@ -3739,7 +3744,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3739 3744
3740 for (int i = 0; i < blocks.Count; i++) 3745 for (int i = 0; i < blocks.Count; i++)
3741 packet.ObjectData[i] = blocks[i]; 3746 packet.ObjectData[i] = blocks[i];
3742 3747
3748
3743 OutPacket(packet, ThrottleOutPacketType.Unknown, true); 3749 OutPacket(packet, ThrottleOutPacketType.Unknown, true);
3744 } 3750 }
3745 3751
@@ -7189,34 +7195,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7189 //handlerTextureRequest = null; 7195 //handlerTextureRequest = null;
7190 for (int i = 0; i < imageRequest.RequestImage.Length; i++) 7196 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
7191 { 7197 {
7192 if (OnRequestTexture != null) 7198 TextureRequestArgs args = new TextureRequestArgs();
7193 {
7194 TextureRequestArgs args = new TextureRequestArgs();
7195
7196 RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i];
7197 7199
7198 args.RequestedAssetID = block.Image; 7200 RequestImagePacket.RequestImageBlock block = imageRequest.RequestImage[i];
7199 args.DiscardLevel = block.DiscardLevel;
7200 args.PacketNumber = block.Packet;
7201 args.Priority = block.DownloadPriority;
7202 args.requestSequence = imageRequest.Header.Sequence;
7203 7201
7204 // NOTE: This is not a built in part of the LLUDP protocol, but we double the 7202 args.RequestedAssetID = block.Image;
7205 // priority of avatar textures to get avatars rezzing in faster than the 7203 args.DiscardLevel = block.DiscardLevel;
7206 // surrounding scene 7204 args.PacketNumber = block.Packet;
7207 if ((ImageType)block.Type == ImageType.Baked) 7205 args.Priority = block.DownloadPriority;
7208 args.Priority *= 2.0f; 7206 args.requestSequence = imageRequest.Header.Sequence;
7209 7207
7210 //handlerTextureRequest = OnRequestTexture; 7208 // NOTE: This is not a built in part of the LLUDP protocol, but we double the
7209 // priority of avatar textures to get avatars rezzing in faster than the
7210 // surrounding scene
7211 if ((ImageType)block.Type == ImageType.Baked)
7212 args.Priority *= 2.0f;
7211 7213
7212 //if (handlerTextureRequest != null) 7214 // in the end, we null this, so we have to check if it's null
7213 //OnRequestTexture(this, args); 7215 if (m_imageManager != null)
7214 7216 {
7215 // in the end, we null this, so we have to check if it's null 7217 m_imageManager.EnqueueReq(args);
7216 if (m_imageManager != null)
7217 {
7218 m_imageManager.EnqueueReq(args);
7219 }
7220 } 7218 }
7221 } 7219 }
7222 return true; 7220 return true;