diff options
author | Melanie | 2010-07-31 00:57:50 +0100 |
---|---|---|
committer | Melanie | 2010-07-31 00:57:50 +0100 |
commit | 3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116 (patch) | |
tree | 87bbf9ba4bf4e4e3b31e00d276dda98f1ecd156e /OpenSim/Region/CoreModules | |
parent | Bannination fixes. Objects in nonpublic parcels were muted by default. Gods (diff) | |
parent | Slight improvement on previous commit. (diff) | |
download | opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.zip opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.gz opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.bz2 opensim-SC_OLD-3302e8ddc4b7a99fc664d3fcc69cb61f9ee60116.tar.xz |
Merge branch 'master' into careminster-presence-refactor
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 34198d2..e557d2c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Xml; | 31 | using System.Xml; |
32 | using log4net; | 32 | using log4net; |
33 | using Mono.Addins; | ||
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using OpenMetaverse.Packets; | 36 | using OpenMetaverse.Packets; |
@@ -41,38 +42,64 @@ using OpenSim.Region.Framework.Scenes.Serialization; | |||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 43 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
43 | { | 44 | { |
44 | public class AttachmentsModule : IAttachmentsModule, IRegionModule | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] |
46 | public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule | ||
45 | { | 47 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 49 | ||
48 | protected Scene m_scene = null; | 50 | protected Scene m_scene = null; |
51 | |||
52 | public string Name { get { return "Attachments Module"; } } | ||
53 | public Type ReplaceableInterface { get { return null; } } | ||
49 | 54 | ||
50 | public void Initialise(Scene scene, IConfigSource source) | 55 | public void Initialise(IConfigSource source) {} |
56 | |||
57 | public void AddRegion(Scene scene) | ||
51 | { | 58 | { |
52 | scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
53 | m_scene = scene; | 59 | m_scene = scene; |
60 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
61 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
62 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI | ||
54 | } | 63 | } |
55 | 64 | ||
56 | public void PostInitialise() | 65 | public void RemoveRegion(Scene scene) |
57 | { | 66 | { |
67 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); | ||
68 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | ||
58 | } | 69 | } |
59 | 70 | ||
60 | public void Close() | 71 | public void RegionLoaded(Scene scene) {} |
72 | |||
73 | public void Close() | ||
61 | { | 74 | { |
75 | RemoveRegion(m_scene); | ||
62 | } | 76 | } |
63 | 77 | ||
64 | public string Name | 78 | public void SubscribeToClientEvents(IClientAPI client) |
65 | { | 79 | { |
66 | get { return "Attachments Module"; } | 80 | client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory; |
81 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; | ||
82 | client.OnObjectAttach += AttachObject; | ||
83 | client.OnObjectDetach += DetachObject; | ||
84 | client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; | ||
67 | } | 85 | } |
68 | 86 | ||
69 | public bool IsSharedModule | 87 | public void UnsubscribeFromClientEvents(IClientAPI client) |
70 | { | 88 | { |
71 | get { return false; } | 89 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory; |
90 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; | ||
91 | client.OnObjectAttach -= AttachObject; | ||
92 | client.OnObjectDetach -= DetachObject; | ||
93 | client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; | ||
72 | } | 94 | } |
73 | 95 | ||
74 | // Called by client | 96 | /// <summary> |
75 | // | 97 | /// Called by client |
98 | /// </summary> | ||
99 | /// <param name="remoteClient"></param> | ||
100 | /// <param name="objectLocalID"></param> | ||
101 | /// <param name="AttachmentPt"></param> | ||
102 | /// <param name="silent"></param> | ||
76 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | 103 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) |
77 | { | 104 | { |
78 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 105 | 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 0c20393..2817477 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); |