Pipe Throttle Update Event to EventManager, client --> ScenePresence --> EventManager, so that modules can know when throttles are updated. The event contains no client specific data to preserve the possibility of 'multiple clients' and you must still call ControllingClient.GetThrottlesPacked(f) to see what the throttles actually are once the event fires. Hook EventManager.OnUpdateThrottle to GetTextureModule.

This commit is contained in:
teravus
2012-11-04 22:57:24 -05:00
parent 08b37efc32
commit 4fa088bafb
8 changed files with 75 additions and 3 deletions

View File

@@ -376,6 +376,10 @@ namespace OpenSim.Region.Framework.Scenes
public event ParcelPrimCountTainted OnParcelPrimCountTainted;
public event GetScriptRunning OnGetScriptRunning;
public delegate void ThrottleUpdate(ScenePresence scenePresence);
public event ThrottleUpdate OnThrottleUpdate;
/// <summary>
/// RegisterCapsEvent is called by Scene after the Caps object
/// has been instantiated and before it is return to the
@@ -2641,5 +2645,14 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
public void TriggerThrottleUpdate(ScenePresence scenePresence)
{
ThrottleUpdate handler = OnThrottleUpdate;
if (handler != null)
{
handler(scenePresence);
}
}
}
}

View File

@@ -793,6 +793,7 @@ namespace OpenSim.Region.Framework.Scenes
ControllingClient.OnChangeAnim += avnHandleChangeAnim;
ControllingClient.OnForceReleaseControls += HandleForceReleaseControls;
ControllingClient.OnAutoPilotGo += MoveToTarget;
ControllingClient.OnUpdateThrottles += RaiseUpdateThrottles;
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
// ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
@@ -3166,6 +3167,10 @@ namespace OpenSim.Region.Framework.Scenes
}
private static Vector3 marker = new Vector3(-1f, -1f, -1f);
private void RaiseUpdateThrottles()
{
m_scene.EventManager.TriggerThrottleUpdate(this);
}
/// <summary>
/// This updates important decision making data about a child agent
/// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region