diff options
author | Justin Clark-Casey (justincc) | 2014-07-29 18:09:11 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-29 18:09:11 +0100 |
commit | 0f87a99e54d0665824d055ce1dcf5f4240dec0bc (patch) | |
tree | e6675f9a29b63ecdaf7e9574f9f5cfd6fc8c322b /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Add "debug scene set appear-refresh true|false" to control whether periodic a... (diff) | |
download | opensim-SC_OLD-0f87a99e54d0665824d055ce1dcf5f4240dec0bc.zip opensim-SC_OLD-0f87a99e54d0665824d055ce1dcf5f4240dec0bc.tar.gz opensim-SC_OLD-0f87a99e54d0665824d055ce1dcf5f4240dec0bc.tar.bz2 opensim-SC_OLD-0f87a99e54d0665824d055ce1dcf5f4240dec0bc.tar.xz |
Add debug mechanism for only sending 1 in N AgentUpdate packets to child agents.
Allows experiments in manually reducing updates under heavy load.
Activated by "debug scene set client-upd-per" console command.
In a simple test, can send as few as every 4th update before observed movement starts becoming disturbingly rubber-banded.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 18a0491..73a5c25 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -859,6 +859,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
859 | get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); } | 859 | get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); } |
860 | } | 860 | } |
861 | 861 | ||
862 | /// <summary> | ||
863 | /// Count of how many terse updates we have sent out. It doesn't matter if this overflows. | ||
864 | /// </summary> | ||
865 | private int m_terseUpdateCount; | ||
866 | |||
862 | #endregion | 867 | #endregion |
863 | 868 | ||
864 | #region Constructor(s) | 869 | #region Constructor(s) |
@@ -3222,17 +3227,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
3222 | 3227 | ||
3223 | #region Update Client(s) | 3228 | #region Update Client(s) |
3224 | 3229 | ||
3225 | |||
3226 | /// <summary> | 3230 | /// <summary> |
3227 | /// Sends a location update to the client connected to this scenePresence | 3231 | /// Sends a location update to the client connected to this scenePresence |
3228 | /// </summary> | 3232 | /// </summary> |
3229 | /// <param name="remoteClient"></param> | 3233 | /// <param name="remoteClient"></param> |
3230 | public void SendTerseUpdateToClient(IClientAPI remoteClient) | 3234 | public void SendTerseUpdateToClient(IClientAPI remoteClient) |
3231 | { | 3235 | { |
3236 | m_terseUpdateCount++; | ||
3237 | |||
3232 | // If the client is inactive, it's getting its updates from another | 3238 | // If the client is inactive, it's getting its updates from another |
3233 | // server. | 3239 | // server. |
3234 | if (remoteClient.IsActive) | 3240 | if (remoteClient.IsActive) |
3235 | { | 3241 | { |
3242 | if (Scene.ChildTerseUpdatePeriod > 1 | ||
3243 | && remoteClient.SceneAgent.IsChildAgent | ||
3244 | && m_terseUpdateCount % Scene.ChildTerseUpdatePeriod != 0 | ||
3245 | && !Velocity.ApproxEquals(Vector3.Zero, 0.001f)) | ||
3246 | return; | ||
3247 | |||
3236 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); | 3248 | //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); |
3237 | 3249 | ||
3238 | remoteClient.SendEntityUpdate( | 3250 | remoteClient.SendEntityUpdate( |