diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs (renamed from OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs) | 2 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 9 |
4 files changed, 64 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index ff3036a..d895bb1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -29,6 +29,7 @@ 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; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenMetaverse.Packets; | 35 | using OpenMetaverse.Packets; |
@@ -39,38 +40,64 @@ using OpenSim.Region.Framework.Scenes; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 41 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
41 | { | 42 | { |
42 | public class AttachmentsModule : IAttachmentsModule, IRegionModule | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] |
44 | public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule | ||
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
46 | protected Scene m_scene = null; | 48 | protected Scene m_scene = null; |
49 | |||
50 | public string Name { get { return "Attachments Module"; } } | ||
51 | public Type ReplaceableInterface { get { return null; } } | ||
47 | 52 | ||
48 | public void Initialise(Scene scene, IConfigSource source) | 53 | public void Initialise(IConfigSource source) {} |
54 | |||
55 | public void AddRegion(Scene scene) | ||
49 | { | 56 | { |
50 | scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
51 | m_scene = scene; | 57 | m_scene = scene; |
58 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
59 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
60 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI | ||
52 | } | 61 | } |
53 | 62 | ||
54 | public void PostInitialise() | 63 | public void RemoveRegion(Scene scene) |
55 | { | 64 | { |
65 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); | ||
66 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | ||
56 | } | 67 | } |
57 | 68 | ||
58 | public void Close() | 69 | public void RegionLoaded(Scene scene) {} |
70 | |||
71 | public void Close() | ||
59 | { | 72 | { |
73 | RemoveRegion(m_scene); | ||
60 | } | 74 | } |
61 | 75 | ||
62 | public string Name | 76 | public void SubscribeToClientEvents(IClientAPI client) |
63 | { | 77 | { |
64 | get { return "Attachments Module"; } | 78 | client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory; |
79 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; | ||
80 | client.OnObjectAttach += AttachObject; | ||
81 | client.OnObjectDetach += DetachObject; | ||
82 | client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; | ||
65 | } | 83 | } |
66 | 84 | ||
67 | public bool IsSharedModule | 85 | public void UnsubscribeFromClientEvents(IClientAPI client) |
68 | { | 86 | { |
69 | get { return false; } | 87 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory; |
88 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; | ||
89 | client.OnObjectAttach -= AttachObject; | ||
90 | client.OnObjectDetach -= DetachObject; | ||
91 | client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; | ||
70 | } | 92 | } |
71 | 93 | ||
72 | // Called by client | 94 | /// <summary> |
73 | // | 95 | /// Called by client |
96 | /// </summary> | ||
97 | /// <param name="remoteClient"></param> | ||
98 | /// <param name="objectLocalID"></param> | ||
99 | /// <param name="AttachmentPt"></param> | ||
100 | /// <param name="silent"></param> | ||
74 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | 101 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) |
75 | { | 102 | { |
76 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 103 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 50171a3..4b30b0d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
47 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | 48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); |
49 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 49 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
50 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
50 | } | 51 | } |
51 | 52 | ||
52 | public void PostInitialise() {} | 53 | public void PostInitialise() {} |
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
54 | public string Name { get { return "Gods Module"; } } | 55 | public string Name { get { return "Gods Module"; } } |
55 | public bool IsSharedModule { get { return false; } } | 56 | public bool IsSharedModule { get { return false; } } |
56 | 57 | ||
58 | public void SubscribeToClientEvents(IClientAPI client) | ||
59 | { | ||
60 | client.OnGodKickUser += KickUser; | ||
61 | client.OnRequestGodlikePowers += RequestGodlikePowers; | ||
62 | } | ||
63 | |||
64 | public void UnsubscribeFromClientEvents(IClientAPI client) | ||
65 | { | ||
66 | client.OnGodKickUser -= KickUser; | ||
67 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | ||
68 | } | ||
69 | |||
57 | public void RequestGodlikePowers( | 70 | public void RequestGodlikePowers( |
58 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) | 71 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) |
59 | { | 72 | { |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs index e23be59..36917e9 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs | |||
@@ -30,7 +30,7 @@ using OpenSim.Region.CoreModules.World.Terrain; | |||
30 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; | 30 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; |
31 | using OpenSim.Region.Framework.Interfaces; | 31 | using OpenSim.Region.Framework.Interfaces; |
32 | 32 | ||
33 | namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects | 33 | namespace OpenSim.Region.CoreModules.World.Terrain.Effects |
34 | { | 34 | { |
35 | public class ChannelDigger : ITerrainEffect | 35 | public class ChannelDigger : ITerrainEffect |
36 | { | 36 | { |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 1e7ea7b..2c5e444 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
68 | #endregion | 68 | #endregion |
69 | 69 | ||
70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
71 | 71 | ||
72 | private readonly Commander m_commander = new Commander("terrain"); | 72 | private readonly Commander m_commander = new Commander("terrain"); |
73 | 73 | ||
74 | private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects = | 74 | private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects = |
@@ -381,8 +381,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
381 | private void LoadPlugins() | 381 | private void LoadPlugins() |
382 | { | 382 | { |
383 | m_plugineffects = new Dictionary<string, ITerrainEffect>(); | 383 | m_plugineffects = new Dictionary<string, ITerrainEffect>(); |
384 | string plugineffectsPath = "Terrain"; | ||
385 | |||
384 | // Load the files in the Terrain/ dir | 386 | // Load the files in the Terrain/ dir |
385 | string[] files = Directory.GetFiles("Terrain"); | 387 | if (!Directory.Exists(plugineffectsPath)) |
388 | return; | ||
389 | |||
390 | string[] files = Directory.GetFiles(plugineffectsPath); | ||
386 | foreach (string file in files) | 391 | foreach (string file in files) |
387 | { | 392 | { |
388 | m_log.Info("Loading effects in " + file); | 393 | m_log.Info("Loading effects in " + file); |