From 85557fb0efb95b1c2f378ce6695a76c8ea3f4604 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 22 Dec 2008 18:47:20 +0000 Subject: * Like most other modules, make the sound module register for its event directly, rather than needing Scene to know about it --- OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs | 8 ++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs b/OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs index 05f2002..7c89466 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 c359e4a..ee27be1 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; -- cgit v1.1