aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-29 18:09:11 +0100
committerJustin Clark-Casey (justincc)2014-07-29 18:09:11 +0100
commit0f87a99e54d0665824d055ce1dcf5f4240dec0bc (patch)
treee6675f9a29b63ecdaf7e9574f9f5cfd6fc8c322b /OpenSim/Region
parentAdd "debug scene set appear-refresh true|false" to control whether periodic a... (diff)
downloadopensim-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')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs14
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs12
3 files changed, 30 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 482e803..ab1d22c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -247,6 +247,11 @@ namespace OpenSim.Region.Framework.Scenes
247 /// </summary> 247 /// </summary>
248 public float ClientVelocityUpdateTolerance { get; set; } 248 public float ClientVelocityUpdateTolerance { get; set; }
249 249
250 /// <summary>
251 /// If greater than 1, we only send terse updates to child agents on every n updates.
252 /// </summary>
253 public int ChildTerseUpdatePeriod { get; set; }
254
250 protected float m_defaultDrawDistance = 255.0f; 255 protected float m_defaultDrawDistance = 255.0f;
251 public float DefaultDrawDistance 256 public float DefaultDrawDistance
252 { 257 {
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(
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index e49c95c..9e4f344 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -100,6 +100,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
100 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 100 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
101 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 101 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
102 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n" 102 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
103 + "client-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
103 + "collisions - if false then collisions with other objects are turned off.\n" 104 + "collisions - if false then collisions with other objects are turned off.\n"
104 + "pbackup - if false then periodic scene backup is turned off.\n" 105 + "pbackup - if false then periodic scene backup is turned off.\n"
105 + "physics - if false then all physics objects are non-physical.\n" 106 + "physics - if false then all physics objects are non-physical.\n"
@@ -119,6 +120,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
119 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 120 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
120 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 121 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
121 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n" 122 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
123 + "client-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
122 + "collisions - if false then collisions with other objects are turned off.\n" 124 + "collisions - if false then collisions with other objects are turned off.\n"
123 + "pbackup - if false then periodic scene backup is turned off.\n" 125 + "pbackup - if false then periodic scene backup is turned off.\n"
124 + "physics - if false then all physics objects are non-physical.\n" 126 + "physics - if false then all physics objects are non-physical.\n"
@@ -153,6 +155,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
153 cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance); 155 cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance);
154 cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance); 156 cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance);
155 cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance); 157 cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance);
158 cdl.AddRow("client-upd-per", m_scene.ChildTerseUpdatePeriod);
156 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 159 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
157 cdl.AddRow("physics", m_scene.PhysicsEnabled); 160 cdl.AddRow("physics", m_scene.PhysicsEnabled);
158 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 161 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -245,6 +248,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
245 m_scene.ClientVelocityUpdateTolerance = newValue; 248 m_scene.ClientVelocityUpdateTolerance = newValue;
246 } 249 }
247 250
251 if (options.ContainsKey("client-upd-per"))
252 {
253 int newValue;
254
255 // FIXME: This can only come from the console at the moment but might not always be true.
256 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["client-upd-per"], out newValue))
257 m_scene.ChildTerseUpdatePeriod = newValue;
258 }
259
248 if (options.ContainsKey("pbackup")) 260 if (options.ContainsKey("pbackup"))
249 { 261 {
250 bool active; 262 bool active;