* Like most other modules, make the sound module register for its event directly, rather than needing Scene to know about it
parent
e0b7ad7677
commit
85557fb0ef
|
@ -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<ISoundModule>(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)
|
||||
{
|
||||
|
|
|
@ -2340,10 +2340,6 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
client.OnActivateGesture += gesturesModule.ActivateGesture;
|
||||
client.OnDeactivateGesture += gesturesModule.DeactivateGesture;
|
||||
}
|
||||
|
||||
ISoundModule soundModule = RequestModuleInterface<ISoundModule>();
|
||||
if (soundModule != null)
|
||||
client.OnSoundTrigger += soundModule.TriggerSound;
|
||||
|
||||
client.OnObjectOwner += ObjectOwner;
|
||||
|
||||
|
|
Loading…
Reference in New Issue