From 27e557eb9857ccc34ae3588c4e0ff43bd5e6644a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 16 Nov 2008 00:47:21 +0000 Subject: Introduces the message transfer module. It splits the transfer mechanics off the IM module and makes it into a module of it's own, which can be used by all other modules. Removes some ugly hacks. Refer to the IM module to see how it's used. Also fixes the persistence issue (Mantis #2598) --- OpenSim/Region/Environment/Scenes/EventManager.cs | 29 ++++++++++++++-------- OpenSim/Region/Environment/Scenes/Scene.cs | 18 ++------------ .../Region/Environment/Scenes/SceneObjectGroup.cs | 3 +++ 3 files changed, 24 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 5d21dc5..bcefe37 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -144,9 +144,11 @@ namespace OpenSim.Region.Environment.Scenes public event SignificantClientMovement OnSignificantClientMovement; - public delegate void NewGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule); + public delegate void IncomingInstantMessage(GridInstantMessage message); - public event NewGridInstantMessage OnGridInstantMessage; + public event IncomingInstantMessage OnIncomingInstantMessage; + + public event IncomingInstantMessage OnUnhandledInstantMessage; public delegate void ClientClosed(UUID clientID); @@ -352,7 +354,8 @@ namespace OpenSim.Region.Environment.Scenes private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded; private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved; private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel; - private NewGridInstantMessage handlerGridInstantMessage = null; //OnGridInstantMessage; + private IncomingInstantMessage handlerIncomingInstantMessage = null; //OnIncomingInstantMessage; + private IncomingInstantMessage handlerUnhandledInstantMessage = null; //OnUnhandledInstantMessage; private ClientClosed handlerClientClosed = null; //OnClientClosed; private OnMakeChildAgentDelegate handlerMakeChildAgent = null; //OnMakeChildAgent; private OnMakeRootAgentDelegate handlerMakeRootAgent = null; //OnMakeRootAgent; @@ -641,15 +644,21 @@ namespace OpenSim.Region.Environment.Scenes } } - ///Used to pass instnat messages around between the Scene, the Friends Module and the Instant Messsage Module - ///Object containing the Instant Message Data - ///A bit vector containing the modules to send the message to - public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule) + public void TriggerIncomingInstantMessage(GridInstantMessage message) + { + handlerIncomingInstantMessage = OnIncomingInstantMessage; + if (handlerIncomingInstantMessage != null) + { + handlerIncomingInstantMessage(message); + } + } + + public void TriggerUnhandledInstantMessage(GridInstantMessage message) { - handlerGridInstantMessage = OnGridInstantMessage; - if (handlerGridInstantMessage != null) + handlerUnhandledInstantMessage = OnUnhandledInstantMessage; + if (handlerUnhandledInstantMessage != null) { - handlerGridInstantMessage(message, whichModule); + handlerUnhandledInstantMessage(message); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 08b7bdb..7485134 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -993,7 +993,8 @@ namespace OpenSim.Region.Environment.Scenes else msg.message = string.Format("Your object {0} was returned from {1} in region {2} due to parcel auto return", ret.Value.objectName, ret.Value.location.ToString(), RegionInfo.RegionName); - TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); +// TODO: Send IM +// TriggerGridInstantMessage(msg); } } @@ -3304,21 +3305,6 @@ namespace OpenSim.Region.Environment.Scenes return UUID.Zero; } - /// - /// This method is a way for the Friends Module to create an instant - /// message to the avatar and for Instant Messages that travel across - /// gridcomms to make it to the Instant Message Module. - /// - /// Friendship establishment and groups are unfortunately tied with instant messaging and - /// there's no way to separate them completely. - /// - /// object containing the instant message data - /// void - public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver options) - { - m_eventManager.TriggerGridInstantMessage(message, options); - } - public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms) { // TODO: m_sceneGridService.DoStuff; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index d929be2..acb6888 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -1211,6 +1211,9 @@ namespace OpenSim.Region.Environment.Scenes /// public void ProcessBackup(IRegionDataStore datastore) { + if (!m_isBackedUp) + return; + // Since this is the top of the section of call stack for backing up a particular scene object, don't let // any exception propogate upwards. -- cgit v1.1