diff options
author | Justin Clark-Casey (justincc) | 2014-07-29 18:54:16 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-29 18:54:16 +0100 |
commit | fcf5fb5dfdabf0c8318156522ca008ce50b19a94 (patch) | |
tree | d387b9d7b793962fce46b6f54ef0440001899773 /OpenSim/Region/Framework | |
parent | Add debug mechanism for only sending 1 in N AgentUpdate packets to child agents. (diff) | |
download | opensim-SC_OLD-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.zip opensim-SC_OLD-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.tar.gz opensim-SC_OLD-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.tar.bz2 opensim-SC_OLD-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.tar.xz |
Implement "scene debug set root-upd-per" for dropping 1 in N root agent updates except to originator
For experimental purposes.
Also corrects a previous bug where each terse update sent was counted rather than each set of terse updates to agents.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 |
2 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ab1d22c..cb2c4cd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -248,6 +248,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
248 | public float ClientVelocityUpdateTolerance { get; set; } | 248 | public float ClientVelocityUpdateTolerance { get; set; } |
249 | 249 | ||
250 | /// <summary> | 250 | /// <summary> |
251 | /// If greater than 1, we only send terse updates to other root agents on every n updates. | ||
252 | /// </summary> | ||
253 | public int RootTerseUpdatePeriod { get; set; } | ||
254 | |||
255 | /// <summary> | ||
251 | /// If greater than 1, we only send terse updates to child agents on every n updates. | 256 | /// If greater than 1, we only send terse updates to child agents on every n updates. |
252 | /// </summary> | 257 | /// </summary> |
253 | public int ChildTerseUpdatePeriod { get; set; } | 258 | public int ChildTerseUpdatePeriod { get; set; } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 73a5c25..c7db306 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3233,12 +3233,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3233 | /// <param name="remoteClient"></param> | 3233 | /// <param name="remoteClient"></param> |
3234 | public void SendTerseUpdateToClient(IClientAPI remoteClient) | 3234 | public void SendTerseUpdateToClient(IClientAPI remoteClient) |
3235 | { | 3235 | { |
3236 | m_terseUpdateCount++; | ||
3237 | |||
3238 | // If the client is inactive, it's getting its updates from another | 3236 | // If the client is inactive, it's getting its updates from another |
3239 | // server. | 3237 | // server. |
3240 | if (remoteClient.IsActive) | 3238 | if (remoteClient.IsActive) |
3241 | { | 3239 | { |
3240 | if (Scene.RootTerseUpdatePeriod > 1) | ||
3241 | { | ||
3242 | // Console.WriteLine( | ||
3243 | // "{0} {1} {2} {3} {4} {5} for {6} to {7}", | ||
3244 | // remoteClient.AgentId, UUID, remoteClient.SceneAgent.IsChildAgent, m_terseUpdateCount, Scene.RootTerseUpdatePeriod, Velocity.ApproxEquals(Vector3.Zero, 0.001f), Name, remoteClient.Name); | ||
3245 | if (remoteClient.AgentId != UUID | ||
3246 | && !remoteClient.SceneAgent.IsChildAgent | ||
3247 | && m_terseUpdateCount % Scene.RootTerseUpdatePeriod != 0 | ||
3248 | && !Velocity.ApproxEquals(Vector3.Zero, 0.001f)) | ||
3249 | { | ||
3250 | // m_log.DebugFormat("[SCENE PRESENCE]: Discarded update from {0} to {1}, args {2} {3} {4} {5} {6} {7}", | ||
3251 | // Name, remoteClient.Name, remoteClient.AgentId, UUID, remoteClient.SceneAgent.IsChildAgent, m_terseUpdateCount, Scene.RootTerseUpdatePeriod, Velocity.ApproxEquals(Vector3.Zero, 0.001f)); | ||
3252 | |||
3253 | return; | ||
3254 | } | ||
3255 | } | ||
3256 | |||
3242 | if (Scene.ChildTerseUpdatePeriod > 1 | 3257 | if (Scene.ChildTerseUpdatePeriod > 1 |
3243 | && remoteClient.SceneAgent.IsChildAgent | 3258 | && remoteClient.SceneAgent.IsChildAgent |
3244 | && m_terseUpdateCount % Scene.ChildTerseUpdatePeriod != 0 | 3259 | && m_terseUpdateCount % Scene.ChildTerseUpdatePeriod != 0 |
@@ -3304,6 +3319,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3304 | lastTerseUpdateToAllClientsTick = currentTick; | 3319 | lastTerseUpdateToAllClientsTick = currentTick; |
3305 | lastPositionSentToAllClients = OffsetPosition; | 3320 | lastPositionSentToAllClients = OffsetPosition; |
3306 | 3321 | ||
3322 | m_terseUpdateCount++; | ||
3323 | |||
3307 | // Console.WriteLine("Scheduled update for {0} in {1}", Name, Scene.Name); | 3324 | // Console.WriteLine("Scheduled update for {0} in {1}", Name, Scene.Name); |
3308 | m_scene.ForEachClient(SendTerseUpdateToClient); | 3325 | m_scene.ForEachClient(SendTerseUpdateToClient); |
3309 | } | 3326 | } |