diff --git a/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs b/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs index 05f2002b81..7c8946621b 100644 --- a/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs @@ -45,6 +45,9 @@ namespace OpenSim.Region.Environment.World.Sound public void Initialise(Scene scene, IConfigSource source) { m_scene = scene; + + m_scene.EventManager.OnNewClient += OnNewClient; + m_scene.RegisterModuleInterface(this); } @@ -53,6 +56,11 @@ namespace OpenSim.Region.Environment.World.Sound public string Name { get { return "Sound Module"; } } public bool IsSharedModule { get { return false; } } + private void OnNewClient(IClientAPI client) + { + client.OnSoundTrigger += TriggerSound; + } + public virtual void TriggerSound( UUID soundId, UUID ownerID, UUID objectID, UUID parentID, float gain, Vector3 position, UInt64 handle) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c359e4ae52..ee27be13a8 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2340,10 +2340,6 @@ namespace OpenSim.Region.Environment.Scenes client.OnActivateGesture += gesturesModule.ActivateGesture; client.OnDeactivateGesture += gesturesModule.DeactivateGesture; } - - ISoundModule soundModule = RequestModuleInterface(); - if (soundModule != null) - client.OnSoundTrigger += soundModule.TriggerSound; client.OnObjectOwner += ObjectOwner;