* Like most other modules, make the sound module register for its event directly, rather than needing Scene to know about it

0.6.2-post-fixes
Justin Clarke Casey 2008-12-22 18:47:20 +00:00
parent e0b7ad7677
commit 85557fb0ef
2 changed files with 8 additions and 4 deletions

View File

@ -45,6 +45,9 @@ namespace OpenSim.Region.Environment.World.Sound
public void Initialise(Scene scene, IConfigSource source) public void Initialise(Scene scene, IConfigSource source)
{ {
m_scene = scene; m_scene = scene;
m_scene.EventManager.OnNewClient += OnNewClient;
m_scene.RegisterModuleInterface<ISoundModule>(this); m_scene.RegisterModuleInterface<ISoundModule>(this);
} }
@ -53,6 +56,11 @@ namespace OpenSim.Region.Environment.World.Sound
public string Name { get { return "Sound Module"; } } public string Name { get { return "Sound Module"; } }
public bool IsSharedModule { get { return false; } } public bool IsSharedModule { get { return false; } }
private void OnNewClient(IClientAPI client)
{
client.OnSoundTrigger += TriggerSound;
}
public virtual void TriggerSound( public virtual void TriggerSound(
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, float gain, Vector3 position, UInt64 handle) UUID soundId, UUID ownerID, UUID objectID, UUID parentID, float gain, Vector3 position, UInt64 handle)
{ {

View File

@ -2340,10 +2340,6 @@ namespace OpenSim.Region.Environment.Scenes
client.OnActivateGesture += gesturesModule.ActivateGesture; client.OnActivateGesture += gesturesModule.ActivateGesture;
client.OnDeactivateGesture += gesturesModule.DeactivateGesture; client.OnDeactivateGesture += gesturesModule.DeactivateGesture;
} }
ISoundModule soundModule = RequestModuleInterface<ISoundModule>();
if (soundModule != null)
client.OnSoundTrigger += soundModule.TriggerSound;
client.OnObjectOwner += ObjectOwner; client.OnObjectOwner += ObjectOwner;