diff options
author | Justin Clarke Casey | 2008-12-22 18:47:20 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-22 18:47:20 +0000 |
commit | 85557fb0efb95b1c2f378ce6695a76c8ea3f4604 (patch) | |
tree | 67d1ce1cfded7f5bedfdeb533dce1544c658f075 /OpenSim/Region | |
parent | * Refactor: Move some code into separate methods in FriendsModule (diff) | |
download | opensim-SC_OLD-85557fb0efb95b1c2f378ce6695a76c8ea3f4604.zip opensim-SC_OLD-85557fb0efb95b1c2f378ce6695a76c8ea3f4604.tar.gz opensim-SC_OLD-85557fb0efb95b1c2f378ce6695a76c8ea3f4604.tar.bz2 opensim-SC_OLD-85557fb0efb95b1c2f378ce6695a76c8ea3f4604.tar.xz |
* Like most other modules, make the sound module register for its event directly, rather than needing Scene to know about it
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Sound/SoundModule.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 4 |
2 files changed, 8 insertions, 4 deletions
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 | |||
45 | public void Initialise(Scene scene, IConfigSource source) | 45 | public void Initialise(Scene scene, IConfigSource source) |
46 | { | 46 | { |
47 | m_scene = scene; | 47 | m_scene = scene; |
48 | |||
49 | m_scene.EventManager.OnNewClient += OnNewClient; | ||
50 | |||
48 | m_scene.RegisterModuleInterface<ISoundModule>(this); | 51 | m_scene.RegisterModuleInterface<ISoundModule>(this); |
49 | } | 52 | } |
50 | 53 | ||
@@ -53,6 +56,11 @@ namespace OpenSim.Region.Environment.World.Sound | |||
53 | public string Name { get { return "Sound Module"; } } | 56 | public string Name { get { return "Sound Module"; } } |
54 | public bool IsSharedModule { get { return false; } } | 57 | public bool IsSharedModule { get { return false; } } |
55 | 58 | ||
59 | private void OnNewClient(IClientAPI client) | ||
60 | { | ||
61 | client.OnSoundTrigger += TriggerSound; | ||
62 | } | ||
63 | |||
56 | public virtual void TriggerSound( | 64 | public virtual void TriggerSound( |
57 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, float gain, Vector3 position, UInt64 handle) | 65 | UUID soundId, UUID ownerID, UUID objectID, UUID parentID, float gain, Vector3 position, UInt64 handle) |
58 | { | 66 | { |
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 | |||
2340 | client.OnActivateGesture += gesturesModule.ActivateGesture; | 2340 | client.OnActivateGesture += gesturesModule.ActivateGesture; |
2341 | client.OnDeactivateGesture += gesturesModule.DeactivateGesture; | 2341 | client.OnDeactivateGesture += gesturesModule.DeactivateGesture; |
2342 | } | 2342 | } |
2343 | |||
2344 | ISoundModule soundModule = RequestModuleInterface<ISoundModule>(); | ||
2345 | if (soundModule != null) | ||
2346 | client.OnSoundTrigger += soundModule.TriggerSound; | ||
2347 | 2343 | ||
2348 | client.OnObjectOwner += ObjectOwner; | 2344 | client.OnObjectOwner += ObjectOwner; |
2349 | 2345 | ||