aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-07-29 18:54:16 +0100
committerJustin Clark-Casey (justincc)2014-07-29 18:54:16 +0100
commitfcf5fb5dfdabf0c8318156522ca008ce50b19a94 (patch)
treed387b9d7b793962fce46b6f54ef0440001899773 /OpenSim/Region
parentAdd debug mechanism for only sending 1 in N AgentUpdate packets to child agents. (diff)
downloadopensim-SC-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.zip
opensim-SC-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.tar.gz
opensim-SC-fcf5fb5dfdabf0c8318156522ca008ce50b19a94.tar.bz2
opensim-SC-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')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs21
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs22
3 files changed, 41 insertions, 7 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 }
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 9e4f344..0dc47f9 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -100,7 +100,8 @@ 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 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
104 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
104 + "collisions - if false then collisions with other objects are turned off.\n" 105 + "collisions - if false then collisions with other objects are turned off.\n"
105 + "pbackup - if false then periodic scene backup is turned off.\n" 106 + "pbackup - if false then periodic scene backup is turned off.\n"
106 + "physics - if false then all physics objects are non-physical.\n" 107 + "physics - if false then all physics objects are non-physical.\n"
@@ -120,7 +121,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
120 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 121 + "client-pos-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" 122 + "client-rot-upd - the tolerance before clients are updated with new rotation 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-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" 124 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
125 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
124 + "collisions - if false then collisions with other objects are turned off.\n" 126 + "collisions - if false then collisions with other objects are turned off.\n"
125 + "pbackup - if false then periodic scene backup is turned off.\n" 127 + "pbackup - if false then periodic scene backup is turned off.\n"
126 + "physics - if false then all physics objects are non-physical.\n" 128 + "physics - if false then all physics objects are non-physical.\n"
@@ -155,7 +157,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
155 cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance); 157 cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance);
156 cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance); 158 cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance);
157 cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance); 159 cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance);
158 cdl.AddRow("client-upd-per", m_scene.ChildTerseUpdatePeriod); 160 cdl.AddRow("root-upd-per", m_scene.RootTerseUpdatePeriod);
161 cdl.AddRow("child-upd-per", m_scene.ChildTerseUpdatePeriod);
159 cdl.AddRow("pbackup", m_scene.PeriodicBackup); 162 cdl.AddRow("pbackup", m_scene.PeriodicBackup);
160 cdl.AddRow("physics", m_scene.PhysicsEnabled); 163 cdl.AddRow("physics", m_scene.PhysicsEnabled);
161 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 164 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
@@ -248,12 +251,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
248 m_scene.ClientVelocityUpdateTolerance = newValue; 251 m_scene.ClientVelocityUpdateTolerance = newValue;
249 } 252 }
250 253
251 if (options.ContainsKey("client-upd-per")) 254 if (options.ContainsKey("root-upd-per"))
252 { 255 {
253 int newValue; 256 int newValue;
254 257
255 // FIXME: This can only come from the console at the moment but might not always be true. 258 // 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)) 259 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["root-upd-per"], out newValue))
260 m_scene.RootTerseUpdatePeriod = newValue;
261 }
262
263 if (options.ContainsKey("child-upd-per"))
264 {
265 int newValue;
266
267 // FIXME: This can only come from the console at the moment but might not always be true.
268 if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["child-upd-per"], out newValue))
257 m_scene.ChildTerseUpdatePeriod = newValue; 269 m_scene.ChildTerseUpdatePeriod = newValue;
258 } 270 }
259 271