From 388c053dcb8de3d9b89c99989af1990296cf2001 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 1 Nov 2008 18:18:19 +0000 Subject: Make the IM and friends modules optional. Clean up some code that dealt with the old Grid Instant Message over OGS1. Refactor the EventManager to be independent of the rigid module structure design imposed by the current implementation. Message routing is now done in the destination module rather than in the event manager. This way, more or less granular solutions are possible without core changes. --- OpenSim/Region/Environment/Scenes/EventManager.cs | 28 +++++------------------ 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/EventManager.cs') diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index c629faf..99aac93 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -135,13 +135,9 @@ namespace OpenSim.Region.Environment.Scenes public event SignificantClientMovement OnSignificantClientMovement; - public delegate void NewGridInstantMessage(GridInstantMessage message); + public delegate void NewGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule); - public event NewGridInstantMessage OnGridInstantMessageToIMModule; - - public event NewGridInstantMessage OnGridInstantMessageToFriendsModule; - - public event NewGridInstantMessage OnGridInstantMessageToGroupsModule; + public event NewGridInstantMessage OnGridInstantMessage; public delegate void ClientClosed(UUID clientID); @@ -346,8 +342,7 @@ namespace OpenSim.Region.Environment.Scenes private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded; private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved; private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel; - private NewGridInstantMessage handlerGridInstantMessageToIM = null; //OnGridInstantMessageToIMModule; - private NewGridInstantMessage handlerGridInstantMessageToFriends = null; //OnGridInstantMessageToFriendsModule; + private NewGridInstantMessage handlerGridInstantMessage = null; //OnGridInstantMessage; private ClientClosed handlerClientClosed = null; //OnClientClosed; private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; @@ -635,21 +630,10 @@ namespace OpenSim.Region.Environment.Scenes ///A bit vector containing the modules to send the message to public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule) { - if ((whichModule & InstantMessageReceiver.IMModule) != 0) - { - handlerGridInstantMessageToIM = OnGridInstantMessageToIMModule; - if (handlerGridInstantMessageToIM != null) - { - handlerGridInstantMessageToIM(message); - } - } - if ((whichModule & InstantMessageReceiver.FriendsModule) != 0) + handlerGridInstantMessage = OnGridInstantMessage; + if (handlerGridInstantMessage != null) { - handlerGridInstantMessageToFriends = OnGridInstantMessageToFriendsModule; - if (handlerGridInstantMessageToFriends != null) - { - handlerGridInstantMessageToFriends(message); - } + handlerGridInstantMessage(message, whichModule); } } -- cgit v1.1