* refactor: Make gestures module register its own events too
parent
c67bc4bf6a
commit
eda69e81ef
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue