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.0.8-extended
parent
71d425c07c
commit
6757633f12
|
@ -247,6 +247,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float ClientVelocityUpdateTolerance { get; set; }
|
public float ClientVelocityUpdateTolerance { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If greater than 1, we only send terse updates to child agents on every n updates.
|
||||||
|
/// </summary>
|
||||||
|
public int ChildTerseUpdatePeriod { get; set; }
|
||||||
|
|
||||||
protected float m_defaultDrawDistance = 255.0f;
|
protected float m_defaultDrawDistance = 255.0f;
|
||||||
public float DefaultDrawDistance
|
public float DefaultDrawDistance
|
||||||
{
|
{
|
||||||
|
|
|
@ -859,6 +859,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); }
|
get { return Util.GetViewerName(m_scene.AuthenticateHandler.GetAgentCircuitData(ControllingClient.CircuitCode)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Count of how many terse updates we have sent out. It doesn't matter if this overflows.
|
||||||
|
/// </summary>
|
||||||
|
private int m_terseUpdateCount;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor(s)
|
#region Constructor(s)
|
||||||
|
@ -3221,17 +3226,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
#region Update Client(s)
|
#region Update Client(s)
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends a location update to the client connected to this scenePresence
|
/// Sends a location update to the client connected to this scenePresence
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
|
m_terseUpdateCount++;
|
||||||
|
|
||||||
// If the client is inactive, it's getting its updates from another
|
// If the client is inactive, it's getting its updates from another
|
||||||
// server.
|
// server.
|
||||||
if (remoteClient.IsActive)
|
if (remoteClient.IsActive)
|
||||||
{
|
{
|
||||||
|
if (Scene.ChildTerseUpdatePeriod > 1
|
||||||
|
&& remoteClient.SceneAgent.IsChildAgent
|
||||||
|
&& m_terseUpdateCount % Scene.ChildTerseUpdatePeriod != 0
|
||||||
|
&& !Velocity.ApproxEquals(Vector3.Zero, 0.001f))
|
||||||
|
return;
|
||||||
|
|
||||||
//m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity);
|
//m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity);
|
||||||
|
|
||||||
remoteClient.SendEntityUpdate(
|
remoteClient.SendEntityUpdate(
|
||||||
|
|
|
@ -100,6 +100,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
+ "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
+ "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
||||||
+ "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
+ "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
||||||
+ "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
|
+ "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
|
||||||
|
+ "client-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
|
||||||
+ "collisions - if false then collisions with other objects are turned off.\n"
|
+ "collisions - if false then collisions with other objects are turned off.\n"
|
||||||
+ "pbackup - if false then periodic scene backup is turned off.\n"
|
+ "pbackup - if false then periodic scene backup is turned off.\n"
|
||||||
+ "physics - if false then all physics objects are non-physical.\n"
|
+ "physics - if false then all physics objects are non-physical.\n"
|
||||||
|
@ -119,6 +120,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
+ "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
+ "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
||||||
+ "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
+ "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
|
||||||
+ "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
|
+ "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
|
||||||
|
+ "client-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
|
||||||
+ "collisions - if false then collisions with other objects are turned off.\n"
|
+ "collisions - if false then collisions with other objects are turned off.\n"
|
||||||
+ "pbackup - if false then periodic scene backup is turned off.\n"
|
+ "pbackup - if false then periodic scene backup is turned off.\n"
|
||||||
+ "physics - if false then all physics objects are non-physical.\n"
|
+ "physics - if false then all physics objects are non-physical.\n"
|
||||||
|
@ -153,6 +155,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance);
|
cdl.AddRow("client-pos-upd", m_scene.ClientPositionUpdateTolerance);
|
||||||
cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance);
|
cdl.AddRow("client-rot-upd", m_scene.ClientRotationUpdateTolerance);
|
||||||
cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance);
|
cdl.AddRow("client-vel-upd", m_scene.ClientVelocityUpdateTolerance);
|
||||||
|
cdl.AddRow("client-upd-per", m_scene.ChildTerseUpdatePeriod);
|
||||||
cdl.AddRow("pbackup", m_scene.PeriodicBackup);
|
cdl.AddRow("pbackup", m_scene.PeriodicBackup);
|
||||||
cdl.AddRow("physics", m_scene.PhysicsEnabled);
|
cdl.AddRow("physics", m_scene.PhysicsEnabled);
|
||||||
cdl.AddRow("scripting", m_scene.ScriptsEnabled);
|
cdl.AddRow("scripting", m_scene.ScriptsEnabled);
|
||||||
|
@ -245,6 +248,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
|
||||||
m_scene.ClientVelocityUpdateTolerance = newValue;
|
m_scene.ClientVelocityUpdateTolerance = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.ContainsKey("client-upd-per"))
|
||||||
|
{
|
||||||
|
int newValue;
|
||||||
|
|
||||||
|
// FIXME: This can only come from the console at the moment but might not always be true.
|
||||||
|
if (ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, options["client-upd-per"], out newValue))
|
||||||
|
m_scene.ChildTerseUpdatePeriod = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
if (options.ContainsKey("pbackup"))
|
if (options.ContainsKey("pbackup"))
|
||||||
{
|
{
|
||||||
bool active;
|
bool active;
|
||||||
|
|
Loading…
Reference in New Issue