Use the message transfer module to pass items across the grid via the profile

0.6.1-post-fixes
Melanie Thielker 2008-11-17 08:29:37 +00:00
parent bb936d8a2f
commit 05fb40dc0b
1 changed files with 16 additions and 9 deletions

View File

@ -33,6 +33,7 @@ using OpenMetaverse;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Interfaces;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes; using OpenSim.Region.Environment.Scenes;
using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Communications.Cache;
@ -49,6 +50,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
private Dictionary<UUID, Scene> m_AgentRegions = private Dictionary<UUID, Scene> m_AgentRegions =
new Dictionary<UUID, Scene>(); new Dictionary<UUID, Scene>();
private IMessageTransferModule m_TransferModule = null;
#region IRegionModule Members #region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config) public void Initialise(Scene scene, IConfigSource config)
@ -65,6 +68,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
if (!m_Scenelist.Contains(scene)) if (!m_Scenelist.Contains(scene))
{ {
if (m_Scenelist.Count == 0)
{
m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
if (m_TransferModule == null)
m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only");
}
m_Scenelist.Add(scene); m_Scenelist.Add(scene);
scene.RegisterModuleInterface<IInventoryTransferModule>(this); scene.RegisterModuleInterface<IInventoryTransferModule>(this);
@ -169,9 +179,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
} }
else else
{ {
// Send via grid services if (m_TransferModule != null)
// m_TransferModule.SendInstantMessage(im, delegate(bool success) {} );
// TODO: Implement grid sending
} }
} }
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted)
@ -188,9 +197,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
} }
else else
{ {
// Send via grid if (m_TransferModule != null)
// m_TransferModule.SendInstantMessage(im, delegate(bool success) {} );
// TODO: Implement sending via grid
} }
} }
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined)
@ -246,9 +254,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer
} }
else else
{ {
// Send via grid if (m_TransferModule != null)
// m_TransferModule.SendInstantMessage(im, delegate(bool success) {} );
// TODO: Implement sending via grid
} }
} }
} }