diff options
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 63 |
1 files changed, 15 insertions, 48 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 44906b4..d9a021f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -29,7 +29,6 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
33 | using Nini.Config; | 32 | using Nini.Config; |
34 | using OpenMetaverse; | 33 | using OpenMetaverse; |
35 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
@@ -40,8 +39,7 @@ using OpenSim.Services.Interfaces; | |||
40 | 39 | ||
41 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | 40 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer |
42 | { | 41 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 42 | public class InventoryTransferModule : IInventoryTransferModule, IRegionModule |
44 | public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule | ||
45 | { | 43 | { |
46 | private static readonly ILog m_log | 44 | private static readonly ILog m_log |
47 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -52,11 +50,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
52 | new Dictionary<UUID, Scene>(); | 50 | new Dictionary<UUID, Scene>(); |
53 | 51 | ||
54 | private IMessageTransferModule m_TransferModule = null; | 52 | private IMessageTransferModule m_TransferModule = null; |
55 | private bool m_enabled = true; | ||
56 | 53 | ||
57 | #region ISharedRegionModule Members | 54 | #region IRegionModule Members |
58 | 55 | ||
59 | public void Initialise(IConfigSource config) | 56 | public void Initialise(Scene scene, IConfigSource config) |
60 | { | 57 | { |
61 | if (config.Configs["Messaging"] != null) | 58 | if (config.Configs["Messaging"] != null) |
62 | { | 59 | { |
@@ -65,61 +62,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
65 | if (config.Configs["Messaging"].GetString( | 62 | if (config.Configs["Messaging"].GetString( |
66 | "InventoryTransferModule", "InventoryTransferModule") != | 63 | "InventoryTransferModule", "InventoryTransferModule") != |
67 | "InventoryTransferModule") | 64 | "InventoryTransferModule") |
68 | m_enabled = false; | 65 | return; |
69 | } | 66 | } |
70 | } | ||
71 | |||
72 | public Type ReplaceableInterface | ||
73 | { | ||
74 | get { return null; } | ||
75 | } | ||
76 | 67 | ||
77 | public void AddRegion(Scene scene) | 68 | if (!m_Scenelist.Contains(scene)) |
78 | { | ||
79 | if (m_enabled) | ||
80 | { | 69 | { |
81 | if (!m_Scenelist.Contains(scene)) | 70 | m_Scenelist.Add(scene); |
82 | { | ||
83 | m_Scenelist.Add(scene); | ||
84 | 71 | ||
85 | scene.RegisterModuleInterface<IInventoryTransferModule>(this); | 72 | scene.RegisterModuleInterface<IInventoryTransferModule>(this); |
86 | 73 | ||
87 | scene.EventManager.OnNewClient += OnNewClient; | 74 | scene.EventManager.OnNewClient += OnNewClient; |
88 | scene.EventManager.OnClientClosed += ClientLoggedOut; | 75 | scene.EventManager.OnClientClosed += ClientLoggedOut; |
89 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; | 76 | scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; |
90 | } | ||
91 | } | 77 | } |
92 | } | 78 | } |
93 | 79 | ||
94 | public void RegionLoaded(Scene scene) | 80 | public void PostInitialise() |
95 | { | 81 | { |
96 | if (m_enabled) | 82 | if (m_Scenelist.Count > 0) |
97 | { | 83 | { |
98 | if (m_Scenelist.Count > 0) | 84 | m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>(); |
99 | { | 85 | if (m_TransferModule == null) |
100 | m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>(); | 86 | m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); |
101 | if (m_TransferModule == null) | ||
102 | m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); | ||
103 | } | ||
104 | } | 87 | } |
105 | } | 88 | } |
106 | 89 | ||
107 | public void RemoveRegion(Scene scene) | ||
108 | { | ||
109 | if (m_Scenelist.Contains(scene)) | ||
110 | m_Scenelist.Remove(scene); | ||
111 | |||
112 | scene.UnregisterModuleInterface<IInventoryTransferModule>(this); | ||
113 | |||
114 | scene.EventManager.OnNewClient -= OnNewClient; | ||
115 | scene.EventManager.OnClientClosed -= ClientLoggedOut; | ||
116 | scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; | ||
117 | } | ||
118 | |||
119 | public void PostInitialise() | ||
120 | { | ||
121 | } | ||
122 | |||
123 | public void Close() | 90 | public void Close() |
124 | { | 91 | { |
125 | } | 92 | } |