From 05fb40dc0b88b9a711c4993e0b546e1ab0722ae6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Nov 2008 08:29:37 +0000 Subject: Use the message transfer module to pass items across the grid via the profile --- .../Inventory/Transfer/InventoryTransferModule.cs | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index f4707de..85b5d3f 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -33,6 +33,7 @@ using OpenMetaverse; using log4net; using Nini.Config; using OpenSim.Framework; +using OpenSim.Region.Interfaces; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications.Cache; @@ -49,6 +50,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer private Dictionary m_AgentRegions = new Dictionary(); + private IMessageTransferModule m_TransferModule = null; + #region IRegionModule Members 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.Count == 0) + { + m_TransferModule = scene.RequestModuleInterface(); + if (m_TransferModule == null) + m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + } + m_Scenelist.Add(scene); scene.RegisterModuleInterface(this); @@ -169,9 +179,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer } else { - // Send via grid services - // - // TODO: Implement grid sending + if (m_TransferModule != null) + m_TransferModule.SendInstantMessage(im, delegate(bool success) {} ); } } else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) @@ -188,9 +197,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer } else { - // Send via grid - // - // TODO: Implement sending via grid + if (m_TransferModule != null) + m_TransferModule.SendInstantMessage(im, delegate(bool success) {} ); } } else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) @@ -246,9 +254,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Transfer } else { - // Send via grid - // - // TODO: Implement sending via grid + if (m_TransferModule != null) + m_TransferModule.SendInstantMessage(im, delegate(bool success) {} ); } } } -- cgit v1.1