* refactor: Make gestures module register its own events too

0.6.2-post-fixes
Justin Clarke Casey 2008-12-22 19:09:09 +00:00
parent c67bc4bf6a
commit eda69e81ef
2 changed files with 9 additions and 7 deletions

View File

@ -46,6 +46,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Gestures
public void Initialise(Scene scene, IConfigSource source)
{
m_scene = scene;
m_scene.EventManager.OnNewClient += OnNewClient;
m_scene.RegisterModuleInterface<IGesturesModule>(this);
}
@ -54,6 +57,12 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Gestures
public string Name { get { return "Gestures Module"; } }
public bool IsSharedModule { get { return false; } }
private void OnNewClient(IClientAPI client)
{
client.OnActivateGesture += ActivateGesture;
client.OnDeactivateGesture += DeactivateGesture;
}
public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId)
{
CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId);

View File

@ -2334,13 +2334,6 @@ namespace OpenSim.Region.Environment.Scenes
client.OnRegionHandleRequest += RegionHandleRequest;
client.OnUnackedTerrain += TerrainUnAcked;
IGesturesModule gesturesModule = RequestModuleInterface<IGesturesModule>();
if (gesturesModule != null)
{
client.OnActivateGesture += gesturesModule.ActivateGesture;
client.OnDeactivateGesture += gesturesModule.DeactivateGesture;
}
client.OnObjectOwner += ObjectOwner;
if (m_statsReporter != null)