aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
diff options
context:
space:
mode:
authorMelanie2012-11-11 16:31:01 +0000
committerMelanie2012-11-11 16:31:01 +0000
commit389077345f9fc78fddcaa39e29daa532a32815d6 (patch)
treea455d88d93ac5fe984ebf5342276ca1ddc831442 /OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
parentMerge branch 'master' into careminster (diff)
parentDeleted 2 obsolete modules: OGSRadmin and OpenGridProtocol. They were still I... (diff)
downloadopensim-SC_OLD-389077345f9fc78fddcaa39e29daa532a32815d6.zip
opensim-SC_OLD-389077345f9fc78fddcaa39e29daa532a32815d6.tar.gz
opensim-SC_OLD-389077345f9fc78fddcaa39e29daa532a32815d6.tar.bz2
opensim-SC_OLD-389077345f9fc78fddcaa39e29daa532a32815d6.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs50
1 files changed, 41 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
index 82816d9..e7a9f53 100644
--- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using Nini.Config; 30using Nini.Config;
30using OpenMetaverse; 31using OpenMetaverse;
@@ -50,9 +51,12 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
50using OSDArray = OpenMetaverse.StructuredData.OSDArray; 51using OSDArray = OpenMetaverse.StructuredData.OSDArray;
51using OSDMap = OpenMetaverse.StructuredData.OSDMap; 52using OSDMap = OpenMetaverse.StructuredData.OSDMap;
52 53
54using Mono.Addins;
55
53namespace OpenSim.Region.CoreModules.Avatar.Gods 56namespace OpenSim.Region.CoreModules.Avatar.Gods
54{ 57{
55 public class GodsModule : IRegionModule, IGodsModule 58 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
59 public class GodsModule : INonSharedRegionModule, IGodsModule
56 { 60 {
57 private static readonly ILog m_log = 61 private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 62 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -66,10 +70,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
66 protected Dictionary<UUID, string> m_capsDict = 70 protected Dictionary<UUID, string> m_capsDict =
67 new Dictionary<UUID, string>(); 71 new Dictionary<UUID, string>();
68 72
69 public void Initialise(Scene scene, IConfigSource source) 73 protected IDialogModule DialogModule
74 {
75 get
76 {
77 if (m_dialogModule == null)
78 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
79
80 return m_dialogModule;
81 }
82 }
83
84 public void Initialise(IConfigSource source)
85 {
86 }
87
88 public void AddRegion(Scene scene)
70 { 89 {
71 m_scene = scene; 90 m_scene = scene;
72 m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
73 m_scene.RegisterModuleInterface<IGodsModule>(this); 91 m_scene.RegisterModuleInterface<IGodsModule>(this);
74 m_scene.EventManager.OnNewClient += SubscribeToClientEvents; 92 m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
75 m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; 93 m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
@@ -77,12 +95,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
77 scene.EventManager.OnIncomingInstantMessage += 95 scene.EventManager.OnIncomingInstantMessage +=
78 OnIncomingInstantMessage; 96 OnIncomingInstantMessage;
79 } 97 }
80 98
81 public void PostInitialise() {} 99 public void RemoveRegion(Scene scene)
100 {
101 m_scene.UnregisterModuleInterface<IGodsModule>(this);
102 m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
103 m_scene = null;
104 }
105
106 public void RegionLoaded(Scene scene)
107 {
108 }
109
82 public void Close() {} 110 public void Close() {}
83 public string Name { get { return "Gods Module"; } } 111 public string Name { get { return "Gods Module"; } }
84 public bool IsSharedModule { get { return false; } } 112
85 113 public Type ReplaceableInterface
114 {
115 get { return null; }
116 }
117
86 public void SubscribeToClientEvents(IClientAPI client) 118 public void SubscribeToClientEvents(IClientAPI client)
87 { 119 {
88 client.OnGodKickUser += KickUser; 120 client.OnGodKickUser += KickUser;
@@ -172,8 +204,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
172 } 204 }
173 else 205 else
174 { 206 {
175 if (m_dialogModule != null) 207 if (DialogModule != null)
176 m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied"); 208 DialogModule.SendAlertToUser(agentID, "Request for god powers denied");
177 } 209 }
178 } 210 }
179 } 211 }