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)
This commit is contained in:
Melanie Thielker
2008-11-16 00:47:21 +00:00
parent a3f785e978
commit 27e557eb98
11 changed files with 798 additions and 754 deletions

View File

@@ -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
}
}
///<summary>Used to pass instnat messages around between the Scene, the Friends Module and the Instant Messsage Module</summary>
///<param name="message">Object containing the Instant Message Data</param>
///<param name="whichModule">A bit vector containing the modules to send the message to</param>
public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule)
public void TriggerIncomingInstantMessage(GridInstantMessage message)
{
handlerGridInstantMessage = OnGridInstantMessage;
if (handlerGridInstantMessage != null)
handlerIncomingInstantMessage = OnIncomingInstantMessage;
if (handlerIncomingInstantMessage != null)
{
handlerGridInstantMessage(message, whichModule);
handlerIncomingInstantMessage(message);
}
}
public void TriggerUnhandledInstantMessage(GridInstantMessage message)
{
handlerUnhandledInstantMessage = OnUnhandledInstantMessage;
if (handlerUnhandledInstantMessage != null)
{
handlerUnhandledInstantMessage(message);
}
}

View File

@@ -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;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="message">object containing the instant message data</param>
/// <returns>void</returns>
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;

View File

@@ -1211,6 +1211,9 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="datastore"></param>
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.