diff options
author | Melanie | 2010-12-23 12:08:38 +0000 |
---|---|---|
committer | Melanie | 2010-12-23 12:08:38 +0000 |
commit | 2cc07de0bac6c5eae48a3a61056ecedaa06c2bca (patch) | |
tree | c8b32755bee00ff1b0dbf795bddd97ef5afc6aab /OpenSim | |
parent | Revert "reactivating some traces to track a dead thread" (diff) | |
parent | Put back a commented section of code. With some viewers, object inventory (diff) | |
download | opensim-SC_OLD-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.zip opensim-SC_OLD-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.gz opensim-SC_OLD-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.bz2 opensim-SC_OLD-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/IClientAPI.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 19 |
4 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 34ec420..da893b6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -577,11 +577,13 @@ namespace OpenSim.Framework | |||
577 | { | 577 | { |
578 | public ISceneEntity Entity; | 578 | public ISceneEntity Entity; |
579 | public PrimUpdateFlags Flags; | 579 | public PrimUpdateFlags Flags; |
580 | public float TimeDilation; | ||
580 | 581 | ||
581 | public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags) | 582 | public EntityUpdate(ISceneEntity entity, PrimUpdateFlags flags, float timedilation) |
582 | { | 583 | { |
583 | Entity = entity; | 584 | Entity = entity; |
584 | Flags = flags; | 585 | Flags = flags; |
586 | TimeDilation = timedilation; | ||
585 | } | 587 | } |
586 | } | 588 | } |
587 | 589 | ||
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6a6bd12..56f8880 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -3591,7 +3591,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3591 | double priority = m_prioritizer.GetUpdatePriority(this, entity); | 3591 | double priority = m_prioritizer.GetUpdatePriority(this, entity); |
3592 | 3592 | ||
3593 | lock (m_entityUpdates.SyncRoot) | 3593 | lock (m_entityUpdates.SyncRoot) |
3594 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); | 3594 | m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags, m_scene.TimeDilation), entity.LocalId); |
3595 | } | 3595 | } |
3596 | 3596 | ||
3597 | private void ProcessEntityUpdates(int maxUpdates) | 3597 | private void ProcessEntityUpdates(int maxUpdates) |
@@ -3604,6 +3604,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3604 | if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; | 3604 | if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; |
3605 | int updatesThisCall = 0; | 3605 | int updatesThisCall = 0; |
3606 | 3606 | ||
3607 | float avgTimeDilation = 0; | ||
3608 | |||
3607 | EntityUpdate update; | 3609 | EntityUpdate update; |
3608 | while (updatesThisCall < maxUpdates) | 3610 | while (updatesThisCall < maxUpdates) |
3609 | { | 3611 | { |
@@ -3611,6 +3613,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3611 | if (!m_entityUpdates.TryDequeue(out update)) | 3613 | if (!m_entityUpdates.TryDequeue(out update)) |
3612 | break; | 3614 | break; |
3613 | 3615 | ||
3616 | avgTimeDilation += update.TimeDilation; | ||
3617 | avgTimeDilation *= 0.5f; | ||
3618 | |||
3614 | if (update.Entity is SceneObjectPart) | 3619 | if (update.Entity is SceneObjectPart) |
3615 | { | 3620 | { |
3616 | SceneObjectPart part = (SceneObjectPart)update.Entity; | 3621 | SceneObjectPart part = (SceneObjectPart)update.Entity; |
@@ -3790,8 +3795,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3790 | #region Packet Sending | 3795 | #region Packet Sending |
3791 | 3796 | ||
3792 | const float TIME_DILATION = 1.0f; | 3797 | const float TIME_DILATION = 1.0f; |
3793 | ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); | 3798 | ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f); |
3794 | 3799 | ||
3795 | if (terseAgentUpdateBlocks.IsValueCreated) | 3800 | if (terseAgentUpdateBlocks.IsValueCreated) |
3796 | { | 3801 | { |
3797 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; | 3802 | List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value; |
@@ -3830,7 +3835,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3830 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; | 3835 | packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; |
3831 | packet.RegionData.TimeDilation = timeDilation; | 3836 | packet.RegionData.TimeDilation = timeDilation; |
3832 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; | 3837 | packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; |
3833 | 3838 | ||
3834 | for (int i = 0; i < blocks.Count; i++) | 3839 | for (int i = 0; i < blocks.Count; i++) |
3835 | packet.ObjectData[i] = blocks[i]; | 3840 | packet.ObjectData[i] = blocks[i]; |
3836 | 3841 | ||
diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index c5a6e62..4f9e32b 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs | |||
@@ -105,12 +105,11 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer | |||
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | // This should not be here | 108 | if (Requests.ContainsKey(fileName)) |
109 | //if (Requests.ContainsKey(fileName)) | 109 | { |
110 | //{ | 110 | RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName); |
111 | // RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName); | 111 | Requests.Remove(fileName); |
112 | // Requests.Remove(fileName); | 112 | } |
113 | //} | ||
114 | 113 | ||
115 | return true; | 114 | return true; |
116 | } | 115 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 7fd59a0..eb97f41 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -287,6 +287,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
287 | private OdePrim cp1; | 287 | private OdePrim cp1; |
288 | private OdeCharacter cc2; | 288 | private OdeCharacter cc2; |
289 | private OdePrim cp2; | 289 | private OdePrim cp2; |
290 | private int tickCountFrameRun; | ||
291 | |||
292 | private int latertickcount=0; | ||
290 | //private int cStartStop = 0; | 293 | //private int cStartStop = 0; |
291 | //private string cDictKey = ""; | 294 | //private string cDictKey = ""; |
292 | 295 | ||
@@ -3123,6 +3126,22 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3123 | } | 3126 | } |
3124 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); | 3127 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); |
3125 | } | 3128 | } |
3129 | latertickcount = Util.EnvironmentTickCount() - tickCountFrameRun; | ||
3130 | |||
3131 | // OpenSimulator above does 10 fps. 10 fps = means that the main thread loop and physics | ||
3132 | // has a max of 100 ms to run theoretically. | ||
3133 | // If the main loop stalls, it calls Simulate later which makes the tick count ms larger. | ||
3134 | // If Physics stalls, it takes longer which makes the tick count ms larger. | ||
3135 | |||
3136 | if (latertickcount < 100) | ||
3137 | m_timeDilation = 1.0f; | ||
3138 | else | ||
3139 | { | ||
3140 | m_timeDilation = 100f / latertickcount; | ||
3141 | //m_timeDilation = Math.Min((Math.Max(100 - (Util.EnvironmentTickCount() - tickCountFrameRun), 1) / 100f), 1.0f); | ||
3142 | } | ||
3143 | |||
3144 | tickCountFrameRun = Util.EnvironmentTickCount(); | ||
3126 | } | 3145 | } |
3127 | 3146 | ||
3128 | return fps; | 3147 | return fps; |