diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | 63 |
2 files changed, 21 insertions, 77 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index a04ab22..ecd60bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -30,7 +30,6 @@ using System.Collections.Generic; | |||
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Mono.Addins; | ||
34 | using Nini.Config; | 33 | using Nini.Config; |
35 | using OpenMetaverse; | 34 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
@@ -42,11 +41,10 @@ using OpenSim.Services.Interfaces; | |||
42 | 41 | ||
43 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | 42 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver |
44 | { | 43 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
46 | /// <summary> | 44 | /// <summary> |
47 | /// This module loads and saves OpenSimulator inventory archives | 45 | /// This module loads and saves OpenSimulator inventory archives |
48 | /// </summary> | 46 | /// </summary> |
49 | public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule | 47 | public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule |
50 | { | 48 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 50 | ||
@@ -84,28 +82,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
84 | DisablePresenceChecks = disablePresenceChecks; | 82 | DisablePresenceChecks = disablePresenceChecks; |
85 | } | 83 | } |
86 | 84 | ||
87 | public void Initialise(IConfigSource source) | 85 | public void Initialise(Scene scene, IConfigSource source) |
88 | { | ||
89 | |||
90 | } | ||
91 | |||
92 | public Type ReplaceableInterface | ||
93 | { | ||
94 | get { return null; } | ||
95 | } | ||
96 | |||
97 | public void AddRegion(Scene scene) | ||
98 | { | 86 | { |
99 | if (m_scenes.Count == 0) | 87 | if (m_scenes.Count == 0) |
100 | { | 88 | { |
101 | scene.RegisterModuleInterface<IInventoryArchiverModule>(this); | 89 | scene.RegisterModuleInterface<IInventoryArchiverModule>(this); |
102 | OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; | 90 | OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted; |
103 | 91 | ||
104 | scene.AddCommand( | 92 | scene.AddCommand( |
105 | this, "load iar", | 93 | this, "load iar", |
106 | "load iar <first> <last> <inventory path> <password> [<archive path>]", | 94 | "load iar <first> <last> <inventory path> <password> [<archive path>]", |
107 | "Load user inventory archive.", HandleLoadInvConsoleCommand); | 95 | "Load user inventory archive.", HandleLoadInvConsoleCommand); |
108 | 96 | ||
109 | scene.AddCommand( | 97 | scene.AddCommand( |
110 | this, "save iar", | 98 | this, "save iar", |
111 | "save iar <first> <last> <inventory path> <password> [<archive path>]", | 99 | "save iar <first> <last> <inventory path> <password> [<archive path>]", |
@@ -113,21 +101,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
113 | 101 | ||
114 | m_aScene = scene; | 102 | m_aScene = scene; |
115 | } | 103 | } |
116 | 104 | ||
117 | m_scenes[scene.RegionInfo.RegionID] = scene; | 105 | m_scenes[scene.RegionInfo.RegionID] = scene; |
118 | } | 106 | } |
119 | 107 | ||
120 | public void RegionLoaded(Scene scene) | ||
121 | { | ||
122 | } | ||
123 | |||
124 | public void RemoveRegion(Scene scene) | ||
125 | { | ||
126 | scene.UnregisterModuleInterface<IInventoryArchiverModule>(this); | ||
127 | if(m_scenes.ContainsKey(scene.RegionInfo.RegionID)) | ||
128 | m_scenes.Remove(scene.RegionInfo.RegionID); | ||
129 | } | ||
130 | |||
131 | public void PostInitialise() {} | 108 | public void PostInitialise() {} |
132 | 109 | ||
133 | public void Close() {} | 110 | public void Close() {} |
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 | } |