aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorMelanie2010-01-29 07:20:13 +0000
committerMelanie2010-01-29 07:21:06 +0000
commita87a247f0548d39a8c39b1d28123d7da8db44598 (patch)
tree7f9f77c38a224bc6d4bea7ccced1d4710c8a91b1 /OpenSim/Region/CoreModules/World
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.zip
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.gz
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.bz2
opensim-SC_OLD-a87a247f0548d39a8c39b1d28123d7da8db44598.tar.xz
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e5e540f822891110df9bc978655bbaf.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs58
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs212
-rw-r--r--OpenSim/Region/CoreModules/World/Sound/SoundModule.cs33
-rw-r--r--OpenSim/Region/CoreModules/World/Sun/SunModule.cs96
-rw-r--r--OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs27
-rw-r--r--OpenSim/Region/CoreModules/World/Wind/WindModule.cs45
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs30
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs35
10 files changed, 197 insertions, 370 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
index c738b65..fc8d4e1 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs
@@ -81,7 +81,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
81 81
82 public void RemoveRegion(Scene scene) 82 public void RemoveRegion(Scene scene)
83 { 83 {
84 scene.UnregisterModuleInterface<IRegionArchiverModule>(this);
85 } 84 }
86 85
87 public void Close() 86 public void Close()
diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
index a2cfce6..5fa3dc2 100644
--- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
+++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs
@@ -27,7 +27,6 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using Mono.Addins;
31using Nini.Config; 30using Nini.Config;
32using OpenMetaverse; 31using OpenMetaverse;
33using OpenSim.Framework; 32using OpenSim.Framework;
@@ -36,7 +35,6 @@ using OpenSim.Region.Framework.Scenes;
36 35
37namespace OpenSim.Region.CoreModules 36namespace OpenSim.Region.CoreModules
38{ 37{
39 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
40 public class CloudModule : ICloudModule 38 public class CloudModule : ICloudModule
41 { 39 {
42// private static readonly log4net.ILog m_log 40// private static readonly log4net.ILog m_log
@@ -50,7 +48,7 @@ namespace OpenSim.Region.CoreModules
50 private float m_cloudDensity = 1.0F; 48 private float m_cloudDensity = 1.0F;
51 private float[] cloudCover = new float[16 * 16]; 49 private float[] cloudCover = new float[16 * 16];
52 50
53 public void Initialise(IConfigSource config) 51 public void Initialise(Scene scene, IConfigSource config)
54 { 52 {
55 IConfig cloudConfig = config.Configs["Cloud"]; 53 IConfig cloudConfig = config.Configs["Cloud"];
56 54
@@ -60,17 +58,10 @@ namespace OpenSim.Region.CoreModules
60 m_cloudDensity = cloudConfig.GetFloat("density", 0.5F); 58 m_cloudDensity = cloudConfig.GetFloat("density", 0.5F);
61 m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000); 59 m_frameUpdateRate = cloudConfig.GetInt("cloud_update_rate", 1000);
62 } 60 }
63 }
64
65 public Type ReplaceableInterface
66 {
67 get { return null; }
68 }
69 61
70 public void AddRegion(Scene scene)
71 {
72 if (m_enabled) 62 if (m_enabled)
73 { 63 {
64
74 m_scene = scene; 65 m_scene = scene;
75 66
76 scene.EventManager.OnNewClient += CloudsToClient; 67 scene.EventManager.OnNewClient += CloudsToClient;
@@ -80,18 +71,9 @@ namespace OpenSim.Region.CoreModules
80 GenerateCloudCover(); 71 GenerateCloudCover();
81 72
82 m_ready = true; 73 m_ready = true;
83 }
84 }
85 74
86 public void RegionLoaded(Scene scene) 75 }
87 {
88 }
89 76
90 public void RemoveRegion(Scene scene)
91 {
92 scene.EventManager.OnNewClient -= CloudsToClient;
93 scene.UnregisterModuleInterface<ICloudModule>(this);
94 scene.EventManager.OnFrame -= CloudUpdate;
95 } 77 }
96 78
97 public void PostInitialise() 79 public void PostInitialise()
@@ -114,6 +96,12 @@ namespace OpenSim.Region.CoreModules
114 get { return "CloudModule"; } 96 get { return "CloudModule"; }
115 } 97 }
116 98
99 public bool IsSharedModule
100 {
101 get { return false; }
102 }
103
104
117 public float CloudCover(int x, int y, int z) 105 public float CloudCover(int x, int y, int z)
118 { 106 {
119 float cover = 0f; 107 float cover = 0f;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 39836ae..695cced 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -30,7 +30,6 @@ using System.IO;
30using System.Reflection; 30using System.Reflection;
31using System.Security; 31using System.Security;
32using log4net; 32using log4net;
33using Mono.Addins;
34using Nini.Config; 33using Nini.Config;
35using OpenMetaverse; 34using OpenMetaverse;
36using OpenSim.Framework; 35using OpenSim.Framework;
@@ -39,7 +38,6 @@ using OpenSim.Region.Framework.Scenes;
39 38
40namespace OpenSim.Region.CoreModules.World.Estate 39namespace OpenSim.Region.CoreModules.World.Estate
41{ 40{
42 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
43 public class EstateManagementModule : IEstateModule 41 public class EstateManagementModule : IEstateModule
44 { 42 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -900,16 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
900 898
901 #region IRegionModule Members 899 #region IRegionModule Members
902 900
903 public void Initialise(IConfigSource source) 901 public void Initialise(Scene scene, IConfigSource source)
904 {
905 }
906
907 public Type ReplaceableInterface
908 {
909 get { return null; }
910 }
911
912 public void AddRegion(Scene scene)
913 { 902 {
914 m_scene = scene; 903 m_scene = scene;
915 m_scene.RegisterModuleInterface<IEstateModule>(this); 904 m_scene.RegisterModuleInterface<IEstateModule>(this);
@@ -931,29 +920,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
931 consoleSetTerrainHeights); 920 consoleSetTerrainHeights);
932 } 921 }
933 922
934 public void RegionLoaded(Scene scene)
935 {
936 // Sets up the sun module based on the saved Estate and Region Settings
937 // DO NOT REMOVE or the sun will stop working
938 TriggerEstateToolsSunUpdate();
939 }
940
941 public void RemoveRegion(Scene scene)
942 {
943 scene.UnregisterModuleInterface<IEstateModule>(this);
944 scene.EventManager.OnNewClient -= EventManager_OnNewClient;
945 scene.EventManager.OnRequestChangeWaterHeight -= changeWaterHeight;
946 }
947
948 public void Close()
949 {
950 }
951
952 public string Name
953 {
954 get { return "EstateManagementModule"; }
955 }
956
957 #region Console Commands 923 #region Console Commands
958 924
959 public void consoleSetTerrainTexture(string module, string[] args) 925 public void consoleSetTerrainTexture(string module, string[] args)
@@ -1040,6 +1006,28 @@ namespace OpenSim.Region.CoreModules.World.Estate
1040 } 1006 }
1041 1007
1042 #endregion 1008 #endregion
1009
1010 public void PostInitialise()
1011 {
1012 // Sets up the sun module based no the saved Estate and Region Settings
1013 // DO NOT REMOVE or the sun will stop working
1014 TriggerEstateToolsSunUpdate();
1015 }
1016
1017 public void Close()
1018 {
1019 }
1020
1021 public string Name
1022 {
1023 get { return "EstateManagementModule"; }
1024 }
1025
1026 public bool IsSharedModule
1027 {
1028 get { return false; }
1029 }
1030
1043 #endregion 1031 #endregion
1044 1032
1045 #region Other Functions 1033 #region Other Functions
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 5b15065..1533462 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -29,7 +29,6 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using log4net; 31using log4net;
32using Mono.Addins;
33using Nini.Config; 32using Nini.Config;
34using OpenMetaverse; 33using OpenMetaverse;
35using OpenSim.Framework; 34using OpenSim.Framework;
@@ -90,8 +89,7 @@ enum GroupPowers : long
90 89
91namespace OpenSim.Region.CoreModules.World.Permissions 90namespace OpenSim.Region.CoreModules.World.Permissions
92{ 91{
93 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 92 public class PermissionsModule : IRegionModule
94 public class PermissionsModule : INonSharedRegionModule
95 { 93 {
96 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 94 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
97 95
@@ -151,10 +149,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
151 149
152 #endregion 150 #endregion
153 151
154 #region INonSharedRegionModule Members 152 #region IRegionModule Members
155 153
156 public void Initialise(IConfigSource config) 154 public void Initialise(Scene scene, IConfigSource config)
157 { 155 {
156 m_scene = scene;
157
158 IConfig myConfig = config.Configs["Startup"]; 158 IConfig myConfig = config.Configs["Startup"];
159 159
160 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); 160 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
@@ -179,57 +179,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
179 if (m_bypassPermissions) 179 if (m_bypassPermissions)
180 m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks"); 180 m_log.Info("[PERMISSIONS]: serviceside_object_permissions = false in ini file so disabling all region service permission checks");
181 else 181 else
182 m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); 182 m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks");
183
184 string grant = myConfig.GetString("GrantLSL","");
185 if (grant.Length > 0) {
186 foreach (string uuidl in grant.Split(',')) {
187 string uuid = uuidl.Trim(" \t".ToCharArray());
188 GrantLSL.Add(uuid, true);
189 }
190 }
191
192 grant = myConfig.GetString("GrantCS","");
193 if (grant.Length > 0) {
194 foreach (string uuidl in grant.Split(',')) {
195 string uuid = uuidl.Trim(" \t".ToCharArray());
196 GrantCS.Add(uuid, true);
197 }
198 }
199
200 grant = myConfig.GetString("GrantVB","");
201 if (grant.Length > 0) {
202 foreach (string uuidl in grant.Split(',')) {
203 string uuid = uuidl.Trim(" \t".ToCharArray());
204 GrantVB.Add(uuid, true);
205 }
206 }
207
208 grant = myConfig.GetString("GrantJS", "");
209 if (grant.Length > 0)
210 {
211 foreach (string uuidl in grant.Split(','))
212 {
213 string uuid = uuidl.Trim(" \t".ToCharArray());
214 GrantJS.Add(uuid, true);
215 }
216 }
217
218 grant = myConfig.GetString("GrantYP", "");
219 if (grant.Length > 0)
220 {
221 foreach (string uuidl in grant.Split(','))
222 {
223 string uuid = uuidl.Trim(" \t".ToCharArray());
224 GrantYP.Add(uuid, true);
225 }
226 }
227
228 }
229
230 public void AddRegion(Scene scene)
231 {
232 m_scene = scene;
233 183
234 //Register functions with Scene External Checks! 184 //Register functions with Scene External Checks!
235 m_scene.Permissions.OnBypassPermissions += BypassPermissions; 185 m_scene.Permissions.OnBypassPermissions += BypassPermissions;
@@ -262,23 +212,23 @@ namespace OpenSim.Region.CoreModules.World.Permissions
262 m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED 212 m_scene.Permissions.OnLinkObject += CanLinkObject; //NOT YET IMPLEMENTED
263 m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED 213 m_scene.Permissions.OnDelinkObject += CanDelinkObject; //NOT YET IMPLEMENTED
264 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED 214 m_scene.Permissions.OnBuyLand += CanBuyLand; //NOT YET IMPLEMENTED
265 215
266 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED 216 m_scene.Permissions.OnViewNotecard += CanViewNotecard; //NOT YET IMPLEMENTED
267 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED 217 m_scene.Permissions.OnViewScript += CanViewScript; //NOT YET IMPLEMENTED
268 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED 218 m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED
269 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED 219 m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED
270 220
271 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE 221 m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE
272 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED 222 m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
273 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED 223 m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED
274 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED 224 m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED
275 m_scene.Permissions.OnResetScript += CanResetScript; 225 m_scene.Permissions.OnResetScript += CanResetScript;
276 226
277 m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED 227 m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; //NOT YET IMPLEMENTED
278 m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED 228 m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; //NOT YET IMPLEMENTED
279 m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED 229 m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; //NOT YET IMPLEMENTED
280 m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED 230 m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED
281 231
282 m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED 232 m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED
283 m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED 233 m_scene.Permissions.OnUseObjectReturn += CanUseObjectReturn; //NOT YET IMPLEMENTED
284 234
@@ -296,87 +246,52 @@ namespace OpenSim.Region.CoreModules.World.Permissions
296 "debug permissions <true / false>", 246 "debug permissions <true / false>",
297 "Enable permissions debugging", 247 "Enable permissions debugging",
298 HandleDebugPermissions); 248 HandleDebugPermissions);
299 } 249
300 250
301 public Type ReplaceableInterface 251 string grant = myConfig.GetString("GrantLSL","");
302 { 252 if (grant.Length > 0) {
303 get { return null; } 253 foreach (string uuidl in grant.Split(',')) {
304 } 254 string uuid = uuidl.Trim(" \t".ToCharArray());
305 255 GrantLSL.Add(uuid, true);
306 public void RegionLoaded(Scene scene) 256 }
307 { 257 }
308 m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
309 258
310 if (m_friendsModule == null) 259 grant = myConfig.GetString("GrantCS","");
311 m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); 260 if (grant.Length > 0) {
312 else 261 foreach (string uuidl in grant.Split(',')) {
313 m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); 262 string uuid = uuidl.Trim(" \t".ToCharArray());
314 } 263 GrantCS.Add(uuid, true);
264 }
265 }
315 266
316 public void RemoveRegion(Scene scene) 267 grant = myConfig.GetString("GrantVB","");
317 { 268 if (grant.Length > 0) {
318 scene.Permissions.OnBypassPermissions -= BypassPermissions; 269 foreach (string uuidl in grant.Split(',')) {
319 scene.Permissions.OnSetBypassPermissions -= SetBypassPermissions; 270 string uuid = uuidl.Trim(" \t".ToCharArray());
320 scene.Permissions.OnPropagatePermissions -= PropagatePermissions; 271 GrantVB.Add(uuid, true);
321 scene.Permissions.OnGenerateClientFlags -= GenerateClientFlags; 272 }
322 scene.Permissions.OnAbandonParcel -= CanAbandonParcel; 273 }
323 scene.Permissions.OnReclaimParcel -= CanReclaimParcel;
324 scene.Permissions.OnDeedParcel -= CanDeedParcel;
325 scene.Permissions.OnDeedObject -= CanDeedObject;
326 scene.Permissions.OnIsGod -= IsGod;
327 scene.Permissions.OnDuplicateObject -= CanDuplicateObject;
328 scene.Permissions.OnDeleteObject -= CanDeleteObject; //MAYBE FULLY IMPLEMENTED
329 scene.Permissions.OnEditObject -= CanEditObject; //MAYBE FULLY IMPLEMENTED
330 scene.Permissions.OnEditParcel -= CanEditParcel; //MAYBE FULLY IMPLEMENTED
331 scene.Permissions.OnInstantMessage -= CanInstantMessage;
332 scene.Permissions.OnInventoryTransfer -= CanInventoryTransfer; //NOT YET IMPLEMENTED
333 scene.Permissions.OnIssueEstateCommand -= CanIssueEstateCommand; //FULLY IMPLEMENTED
334 scene.Permissions.OnMoveObject -= CanMoveObject; //MAYBE FULLY IMPLEMENTED
335 scene.Permissions.OnObjectEntry -= CanObjectEntry;
336 scene.Permissions.OnReturnObject -= CanReturnObject; //NOT YET IMPLEMENTED
337 scene.Permissions.OnRezObject -= CanRezObject; //MAYBE FULLY IMPLEMENTED
338 scene.Permissions.OnRunConsoleCommand -= CanRunConsoleCommand;
339 scene.Permissions.OnRunScript -= CanRunScript; //NOT YET IMPLEMENTED
340 scene.Permissions.OnCompileScript -= CanCompileScript;
341 scene.Permissions.OnSellParcel -= CanSellParcel;
342 scene.Permissions.OnTakeObject -= CanTakeObject;
343 scene.Permissions.OnTakeCopyObject -= CanTakeCopyObject;
344 scene.Permissions.OnTerraformLand -= CanTerraformLand;
345 scene.Permissions.OnLinkObject -= CanLinkObject; //NOT YET IMPLEMENTED
346 scene.Permissions.OnDelinkObject -= CanDelinkObject; //NOT YET IMPLEMENTED
347 scene.Permissions.OnBuyLand -= CanBuyLand; //NOT YET IMPLEMENTED
348
349 scene.Permissions.OnViewNotecard -= CanViewNotecard; //NOT YET IMPLEMENTED
350 scene.Permissions.OnViewScript -= CanViewScript; //NOT YET IMPLEMENTED
351 scene.Permissions.OnEditNotecard -= CanEditNotecard; //NOT YET IMPLEMENTED
352 scene.Permissions.OnEditScript -= CanEditScript; //NOT YET IMPLEMENTED
353
354 scene.Permissions.OnCreateObjectInventory -= CanCreateObjectInventory; //NOT IMPLEMENTED HERE
355 scene.Permissions.OnEditObjectInventory -= CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED
356 scene.Permissions.OnCopyObjectInventory -= CanCopyObjectInventory; //NOT YET IMPLEMENTED
357 scene.Permissions.OnDeleteObjectInventory -= CanDeleteObjectInventory; //NOT YET IMPLEMENTED
358 scene.Permissions.OnResetScript -= CanResetScript;
359
360 scene.Permissions.OnCreateUserInventory -= CanCreateUserInventory; //NOT YET IMPLEMENTED
361 scene.Permissions.OnCopyUserInventory -= CanCopyUserInventory; //NOT YET IMPLEMENTED
362 scene.Permissions.OnEditUserInventory -= CanEditUserInventory; //NOT YET IMPLEMENTED
363 scene.Permissions.OnDeleteUserInventory -= CanDeleteUserInventory; //NOT YET IMPLEMENTED
364
365 scene.Permissions.OnTeleport -= CanTeleport; //NOT YET IMPLEMENTED
366 scene.Permissions.OnUseObjectReturn -= CanUseObjectReturn; //NOT YET IMPLEMENTED
367 }
368 274
369 public void PostInitialise() 275 grant = myConfig.GetString("GrantJS", "");
370 { 276 if (grant.Length > 0)
371 } 277 {
278 foreach (string uuidl in grant.Split(','))
279 {
280 string uuid = uuidl.Trim(" \t".ToCharArray());
281 GrantJS.Add(uuid, true);
282 }
283 }
372 284
373 public void Close() 285 grant = myConfig.GetString("GrantYP", "");
374 { 286 if (grant.Length > 0)
375 } 287 {
288 foreach (string uuidl in grant.Split(','))
289 {
290 string uuid = uuidl.Trim(" \t".ToCharArray());
291 GrantYP.Add(uuid, true);
292 }
293 }
376 294
377 public string Name
378 {
379 get { return "PermissionsModule"; }
380 } 295 }
381 296
382 public void HandleBypassPermissions(string module, string[] args) 297 public void HandleBypassPermissions(string module, string[] args)
@@ -449,6 +364,31 @@ namespace OpenSim.Region.CoreModules.World.Permissions
449 m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName); 364 m_log.InfoFormat("[PERMISSIONS] Set permissions debugging to {0} in {1}", m_debugPermissions, m_scene.RegionInfo.RegionName);
450 } 365 }
451 } 366 }
367
368 public void PostInitialise()
369 {
370 m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
371
372 if (m_friendsModule == null)
373 m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work");
374 else
375 m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled");
376 }
377
378 public void Close()
379 {
380 }
381
382 public string Name
383 {
384 get { return "PermissionsModule"; }
385 }
386
387 public bool IsSharedModule
388 {
389 get { return false; }
390 }
391
452 #endregion 392 #endregion
453 393
454 #region Helper Functions 394 #region Helper Functions
diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
index ed7bfe1..37f1f2e 100644
--- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28using System; 28using System;
29using Mono.Addins;
30using Nini.Config; 29using Nini.Config;
31using OpenMetaverse; 30using OpenMetaverse;
32using OpenSim.Framework; 31using OpenSim.Framework;
@@ -35,44 +34,26 @@ using OpenSim.Region.Framework.Scenes;
35 34
36namespace OpenSim.Region.CoreModules.World.Sound 35namespace OpenSim.Region.CoreModules.World.Sound
37{ 36{
38 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 37 public class SoundModule : IRegionModule, ISoundModule
39 public class SoundModule : INonSharedRegionModule, ISoundModule
40 { 38 {
41 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 39 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 40
43 protected Scene m_scene; 41 protected Scene m_scene;
44 42
45 public void Initialise(IConfigSource source) 43 public void Initialise(Scene scene, IConfigSource source)
46 {
47 }
48
49 public void AddRegion(Scene scene)
50 { 44 {
51 m_scene = scene; 45 m_scene = scene;
52 46
53 m_scene.EventManager.OnNewClient += OnNewClient; 47 m_scene.EventManager.OnNewClient += OnNewClient;
54 48
55 m_scene.RegisterModuleInterface<ISoundModule>(this); 49 m_scene.RegisterModuleInterface<ISoundModule>(this);
56 } 50 }
57
58 public Type ReplaceableInterface
59 {
60 get { return null; }
61 }
62
63 public void RegionLoaded(Scene scene)
64 {
65 }
66
67 public void RemoveRegion(Scene scene)
68 {
69 scene.EventManager.OnNewClient -= OnNewClient;
70 scene.UnregisterModuleInterface<ISoundModule>(this);
71 }
72 51
52 public void PostInitialise() {}
73 public void Close() {} 53 public void Close() {}
74 public string Name { get { return "Sound Module"; } } 54 public string Name { get { return "Sound Module"; } }
75 55 public bool IsSharedModule { get { return false; } }
56
76 private void OnNewClient(IClientAPI client) 57 private void OnNewClient(IClientAPI client)
77 { 58 {
78 client.OnSoundTrigger += TriggerSound; 59 client.OnSoundTrigger += TriggerSound;
diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
index 948c47c..0712a7f 100644
--- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs
@@ -29,7 +29,6 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using log4net; 31using log4net;
32using Mono.Addins;
33using Nini.Config; 32using Nini.Config;
34using OpenMetaverse; 33using OpenMetaverse;
35using OpenSim.Framework; 34using OpenSim.Framework;
@@ -38,7 +37,6 @@ using OpenSim.Region.Framework.Scenes;
38 37
39namespace OpenSim.Region.CoreModules 38namespace OpenSim.Region.CoreModules
40{ 39{
41 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
42 public class SunModule : ISunModule 40 public class SunModule : ISunModule
43 { 41 {
44 /// <summary> 42 /// <summary>
@@ -280,12 +278,27 @@ namespace OpenSim.Region.CoreModules
280 return GetCurrentSunHour() + 6.0f; 278 return GetCurrentSunHour() + 6.0f;
281 } 279 }
282 280
283 #region INonSharedRegionModule Methods 281 #region IRegion Methods
284 282
285 // Called immediately after the module is loaded for a given region 283 // Called immediately after the module is loaded for a given region
286 // i.e. Immediately after instance creation. 284 // i.e. Immediately after instance creation.
287 public void Initialise(IConfigSource config) 285 public void Initialise(Scene scene, IConfigSource config)
288 { 286 {
287 m_scene = scene;
288 m_frame = 0;
289
290 // This one puts an entry in the main help screen
291 m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null);
292
293 // This one enables the ability to type just "sun" without any parameters
294 m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand);
295 foreach (KeyValuePair<string, string> kvp in GetParamList())
296 {
297 m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand);
298 }
299
300
301
289 TimeZone local = TimeZone.CurrentTimeZone; 302 TimeZone local = TimeZone.CurrentTimeZone;
290 TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; 303 TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
291 m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); 304 m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset);
@@ -333,43 +346,7 @@ namespace OpenSim.Region.CoreModules
333 // m_latitude = d_latitude; 346 // m_latitude = d_latitude;
334 // m_longitude = d_longitude; 347 // m_longitude = d_longitude;
335 } 348 }
336 }
337
338 public void Close()
339 {
340 ready = false;
341
342 // Remove our hooks
343 m_scene.EventManager.OnFrame -= SunUpdate;
344 m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
345 m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate;
346 m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour;
347 }
348
349 public string Name
350 {
351 get { return "SunModule"; }
352 }
353
354 public Type ReplaceableInterface
355 {
356 get { return null; }
357 }
358
359 public void AddRegion(Scene scene)
360 {
361 m_scene = scene;
362 m_frame = 0;
363
364 // This one puts an entry in the main help screen
365 m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null);
366 349
367 // This one enables the ability to type just "sun" without any parameters
368 m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand);
369 foreach (KeyValuePair<string, string> kvp in GetParamList())
370 {
371 m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand);
372 }
373 switch (m_RegionMode) 350 switch (m_RegionMode)
374 { 351 {
375 case "T1": 352 case "T1":
@@ -377,8 +354,8 @@ namespace OpenSim.Region.CoreModules
377 case "SL": 354 case "SL":
378 // Time taken to complete a cycle (day and season) 355 // Time taken to complete a cycle (day and season)
379 356
380 SecondsPerSunCycle = (uint)(m_DayLengthHours * 60 * 60); 357 SecondsPerSunCycle = (uint) (m_DayLengthHours * 60 * 60);
381 SecondsPerYear = (uint)(SecondsPerSunCycle * m_YearLengthDays); 358 SecondsPerYear = (uint) (SecondsPerSunCycle*m_YearLengthDays);
382 359
383 // Ration of real-to-virtual time 360 // Ration of real-to-virtual time
384 361
@@ -387,17 +364,17 @@ namespace OpenSim.Region.CoreModules
387 // Speed of rotation needed to complete a cycle in the 364 // Speed of rotation needed to complete a cycle in the
388 // designated period (day and season) 365 // designated period (day and season)
389 366
390 SunSpeed = m_SunCycle / SecondsPerSunCycle; 367 SunSpeed = m_SunCycle/SecondsPerSunCycle;
391 SeasonSpeed = m_SeasonalCycle / SecondsPerYear; 368 SeasonSpeed = m_SeasonalCycle/SecondsPerYear;
392 369
393 // Horizon translation 370 // Horizon translation
394 371
395 HorizonShift = m_HorizonShift; // Z axis translation 372 HorizonShift = m_HorizonShift; // Z axis translation
396 // HoursToRadians = (SunCycle/24)*VWTimeRatio; 373 // HoursToRadians = (SunCycle/24)*VWTimeRatio;
397 374
398 // Insert our event handling hooks 375 // Insert our event handling hooks
399 376
400 scene.EventManager.OnFrame += SunUpdate; 377 scene.EventManager.OnFrame += SunUpdate;
401 scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel; 378 scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
402 scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate; 379 scene.EventManager.OnEstateToolsSunUpdate += EstateToolsSunUpdate;
403 scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour; 380 scene.EventManager.OnGetCurrentTimeAsLindenSunHour += GetCurrentTimeAsLindenSunHour;
@@ -414,21 +391,34 @@ namespace OpenSim.Region.CoreModules
414 } 391 }
415 392
416 scene.RegisterModuleInterface<ISunModule>(this); 393 scene.RegisterModuleInterface<ISunModule>(this);
394
417 } 395 }
418 396
419 public void RegionLoaded(Scene scene) 397
398 public void PostInitialise()
420 { 399 {
421 } 400 }
422 401
423 public void RemoveRegion(Scene scene) 402 public void Close()
424 { 403 {
425 scene.RegisterModuleInterface<ISunModule>(this); 404 ready = false;
426 scene.EventManager.OnFrame -= SunUpdate; 405
427 scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; 406 // Remove our hooks
428 scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate; 407 m_scene.EventManager.OnFrame -= SunUpdate;
429 scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour; 408 m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
409 m_scene.EventManager.OnEstateToolsSunUpdate -= EstateToolsSunUpdate;
410 m_scene.EventManager.OnGetCurrentTimeAsLindenSunHour -= GetCurrentTimeAsLindenSunHour;
411 }
412
413 public string Name
414 {
415 get { return "SunModule"; }
430 } 416 }
431 417
418 public bool IsSharedModule
419 {
420 get { return false; }
421 }
432 #endregion 422 #endregion
433 423
434 #region EventManager Events 424 #region EventManager Events
diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
index 0b487ed..c2ad7b8 100644
--- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
+++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs
@@ -28,7 +28,6 @@
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using log4net; 30using log4net;
31using Mono.Addins;
32using Nini.Config; 31using Nini.Config;
33using OpenMetaverse; 32using OpenMetaverse;
34using OpenSim.Framework; 33using OpenSim.Framework;
@@ -37,8 +36,7 @@ using OpenSim.Region.Framework.Scenes;
37 36
38namespace OpenSim.Region.CoreModules.Avatar.Vegetation 37namespace OpenSim.Region.CoreModules.Avatar.Vegetation
39{ 38{
40 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 39 public class VegetationModule : IRegionModule, IVegetationModule
41 public class VegetationModule : INonSharedRegionModule, IVegetationModule
42 { 40 {
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 42
@@ -47,34 +45,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Vegetation
47 protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; 45 protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree };
48 public PCode[] CreationCapabilities { get { return creationCapabilities; } } 46 public PCode[] CreationCapabilities { get { return creationCapabilities; } }
49 47
50 public void Initialise(IConfigSource source) 48 public void Initialise(Scene scene, IConfigSource source)
51 {
52 }
53
54 public void AddRegion(Scene scene)
55 { 49 {
56 m_scene = scene; 50 m_scene = scene;
57 m_scene.RegisterModuleInterface<IVegetationModule>(this); 51 m_scene.RegisterModuleInterface<IVegetationModule>(this);
58 } 52 }
59
60 public Type ReplaceableInterface
61 {
62 get { return null; }
63 }
64
65 public void RegionLoaded(Scene scene)
66 {
67 }
68
69 public void RemoveRegion(Scene scene)
70 {
71 scene.UnregisterModuleInterface<IVegetationModule>(this);
72 }
73 53
74 public void PostInitialise() {} 54 public void PostInitialise() {}
75 public void Close() {} 55 public void Close() {}
76 public string Name { get { return "Vegetation Module"; } } 56 public string Name { get { return "Vegetation Module"; } }
77 57 public bool IsSharedModule { get { return false; } }
58
78 public SceneObjectGroup AddTree( 59 public SceneObjectGroup AddTree(
79 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree) 60 UUID uuid, UUID groupID, Vector3 scale, Quaternion rotation, Vector3 position, Tree treeType, bool newTree)
80 { 61 {
diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
index cd3706d..3283c1f 100644
--- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
+++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs
@@ -55,19 +55,17 @@ namespace OpenSim.Region.CoreModules
55 55
56 private IWindModelPlugin m_activeWindPlugin = null; 56 private IWindModelPlugin m_activeWindPlugin = null;
57 private const string m_dWindPluginName = "SimpleRandomWind"; 57 private const string m_dWindPluginName = "SimpleRandomWind";
58 private string m_desiredWindPlugin = "SimpleRandomWind";
59 private Dictionary<string, IWindModelPlugin> m_availableWindPlugins = new Dictionary<string, IWindModelPlugin>(); 58 private Dictionary<string, IWindModelPlugin> m_availableWindPlugins = new Dictionary<string, IWindModelPlugin>();
60 59
61 // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m 60 // Simplified windSpeeds based on the fact that the client protocal tracks at a resolution of 16m
62 private Vector2[] windSpeeds = new Vector2[16 * 16]; 61 private Vector2[] windSpeeds = new Vector2[16 * 16];
63 private IConfig windConfig;
64 62
65 #region IRegion Methods 63 #region IRegion Methods
66 64
67 public void Initialise(IConfigSource config) 65 public void Initialise(Scene scene, IConfigSource config)
68 { 66 {
69 windConfig = config.Configs["Wind"]; 67 IConfig windConfig = config.Configs["Wind"];
70 m_desiredWindPlugin = m_dWindPluginName; 68 string desiredWindPlugin = m_dWindPluginName;
71 69
72 if (windConfig != null) 70 if (windConfig != null)
73 { 71 {
@@ -78,18 +76,10 @@ namespace OpenSim.Region.CoreModules
78 // Determine which wind model plugin is desired 76 // Determine which wind model plugin is desired
79 if (windConfig.Contains("wind_plugin")) 77 if (windConfig.Contains("wind_plugin"))
80 { 78 {
81 m_desiredWindPlugin = windConfig.GetString("wind_plugin"); 79 desiredWindPlugin = windConfig.GetString("wind_plugin");
82 } 80 }
83 } 81 }
84 }
85
86 public Type ReplaceableInterface
87 {
88 get { return null; }
89 }
90 82
91 public void AddRegion(Scene scene)
92 {
93 if (m_enabled) 83 if (m_enabled)
94 { 84 {
95 m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate); 85 m_log.InfoFormat("[WIND] Enabled with an update rate of {0} frames.", m_frameUpdateRate);
@@ -105,30 +95,30 @@ namespace OpenSim.Region.CoreModules
105 } 95 }
106 96
107 // Check for desired plugin 97 // Check for desired plugin
108 if (m_availableWindPlugins.ContainsKey(m_desiredWindPlugin)) 98 if (m_availableWindPlugins.ContainsKey(desiredWindPlugin))
109 { 99 {
110 m_activeWindPlugin = m_availableWindPlugins[m_desiredWindPlugin]; 100 m_activeWindPlugin = m_availableWindPlugins[desiredWindPlugin];
111 101
112 m_log.InfoFormat("[WIND] {0} plugin found, initializing.", m_desiredWindPlugin); 102 m_log.InfoFormat("[WIND] {0} plugin found, initializing.", desiredWindPlugin);
113 103
114 if (windConfig != null) 104 if (windConfig != null)
115 { 105 {
116 m_activeWindPlugin.Initialise(); 106 m_activeWindPlugin.Initialise();
117 m_activeWindPlugin.WindConfig(m_scene, windConfig); 107 m_activeWindPlugin.WindConfig(m_scene, windConfig);
118 } 108 }
119 } 109 }
120 110
121 111
122 // if the plug-in wasn't found, default to no wind. 112 // if the plug-in wasn't found, default to no wind.
123 if (m_activeWindPlugin == null) 113 if (m_activeWindPlugin == null)
124 { 114 {
125 m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", m_desiredWindPlugin); 115 m_log.ErrorFormat("[WIND] Could not find specified wind plug-in: {0}", desiredWindPlugin);
126 m_log.ErrorFormat("[WIND] Defaulting to no wind."); 116 m_log.ErrorFormat("[WIND] Defaulting to no wind.");
127 } 117 }
128 118
129 // This one puts an entry in the main help screen 119 // This one puts an entry in the main help screen
130 m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null); 120 m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null);
131 121
132 // This one enables the ability to type just the base command without any parameters 122 // This one enables the ability to type just the base command without any parameters
133 m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand); 123 m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand);
134 124
@@ -137,7 +127,7 @@ namespace OpenSim.Region.CoreModules
137 { 127 {
138 m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand); 128 m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand);
139 m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand); 129 m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand);
140 130
141 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams()) 131 foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams())
142 { 132 {
143 m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand); 133 m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand);
@@ -159,17 +149,11 @@ namespace OpenSim.Region.CoreModules
159 m_ready = true; 149 m_ready = true;
160 150
161 } 151 }
162 }
163 152
164 public void RegionLoaded(Scene scene)
165 {
166 } 153 }
167 154
168 public void RemoveRegion(Scene scene) 155 public void PostInitialise()
169 { 156 {
170 scene.EventManager.OnFrame -= WindUpdate;
171 scene.EventManager.OnMakeRootAgent -= OnAgentEnteredRegion;
172 scene.UnregisterModuleInterface<IWindModule>(this);
173 } 157 }
174 158
175 public void Close() 159 public void Close()
@@ -198,6 +182,11 @@ namespace OpenSim.Region.CoreModules
198 get { return "WindModule"; } 182 get { return "WindModule"; }
199 } 183 }
200 184
185 public bool IsSharedModule
186 {
187 get { return false; }
188 }
189
201 190
202 #endregion 191 #endregion
203 192
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
index 6bda1e9..285d36a 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
@@ -30,7 +30,6 @@ using System.Collections.Generic;
30using System.Drawing; 30using System.Drawing;
31using System.Reflection; 31using System.Reflection;
32using log4net; 32using log4net;
33using Mono.Addins;
34using Nini.Config; 33using Nini.Config;
35using OpenMetaverse; 34using OpenMetaverse;
36using OpenMetaverse.Imaging; 35using OpenMetaverse.Imaging;
@@ -60,8 +59,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
60 public face[] trns; 59 public face[] trns;
61 } 60 }
62 61
63 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 62 public class MapImageModule : IMapImageGenerator, IRegionModule
64 public class MapImageModule : IMapImageGenerator, INonSharedRegionModule
65 { 63 {
66 private static readonly ILog m_log = 64 private static readonly ILog m_log =
67 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 65 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -130,38 +128,25 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
130 128
131 #endregion 129 #endregion
132 130
133 #region INonSharedRegionModule Members 131 #region IRegionModule Members
134 132
135 public void Initialise(IConfigSource source) 133 public void Initialise(Scene scene, IConfigSource source)
136 { 134 {
135 m_scene = scene;
137 m_config = source; 136 m_config = source;
138 137
139 IConfig startupConfig = m_config.Configs["Startup"]; 138 IConfig startupConfig = m_config.Configs["Startup"];
140 if (startupConfig.GetString("MapImageModule", "MapImageModule") != 139 if (startupConfig.GetString("MapImageModule", "MapImageModule") !=
141 "MapImageModule") 140 "MapImageModule")
142 return; 141 return;
143 }
144 142
145 public void AddRegion(Scene scene)
146 {
147 m_scene = scene;
148 m_scene.RegisterModuleInterface<IMapImageGenerator>(this); 143 m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
149 } 144 }
150 145
151 public Type ReplaceableInterface 146 public void PostInitialise()
152 {
153 get { return null; }
154 }
155
156 public void RegionLoaded(Scene scene)
157 { 147 {
158 } 148 }
159 149
160 public void RemoveRegion(Scene scene)
161 {
162 scene.UnregisterModuleInterface<IMapImageGenerator>(this);
163 }
164
165 public void Close() 150 public void Close()
166 { 151 {
167 } 152 }
@@ -171,6 +156,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
171 get { return "MapImageModule"; } 156 get { return "MapImageModule"; }
172 } 157 }
173 158
159 public bool IsSharedModule
160 {
161 get { return false; }
162 }
163
174 #endregion 164 #endregion
175 165
176// TODO: unused: 166// TODO: unused:
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index dd33673..be46fa5 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -24,12 +24,9 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
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
28using System;
29using System.Collections.Generic; 27using System.Collections.Generic;
30using System.Reflection; 28using System.Reflection;
31using log4net; 29using log4net;
32using Mono.Addins;
33using Nini.Config; 30using Nini.Config;
34using OpenMetaverse; 31using OpenMetaverse;
35using OpenSim.Framework; 32using OpenSim.Framework;
@@ -41,8 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 38
42namespace OpenSim.Region.CoreModules.World.WorldMap 39namespace OpenSim.Region.CoreModules.World.WorldMap
43{ 40{
44 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 41 public class MapSearchModule : IRegionModule
45 public class MapSearchModule : ISharedRegionModule
46 { 42 {
47 private static readonly ILog m_log = 43 private static readonly ILog m_log =
48 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -50,12 +46,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
50 Scene m_scene = null; // only need one for communication with GridService 46 Scene m_scene = null; // only need one for communication with GridService
51 List<Scene> m_scenes = new List<Scene>(); 47 List<Scene> m_scenes = new List<Scene>();
52 48
53 #region ISharedRegionModule Members 49 #region IRegionModule Members
54 public void Initialise(IConfigSource source) 50 public void Initialise(Scene scene, IConfigSource source)
55 {
56 }
57
58 public void AddRegion(Scene scene)
59 { 51 {
60 if (m_scene == null) 52 if (m_scene == null)
61 { 53 {
@@ -66,22 +58,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
66 scene.EventManager.OnNewClient += OnNewClient; 58 scene.EventManager.OnNewClient += OnNewClient;
67 } 59 }
68 60
69 public Type ReplaceableInterface
70 {
71 get { return null; }
72 }
73
74 public void RegionLoaded(Scene scene)
75 {
76 }
77
78 public void RemoveRegion(Scene scene)
79 {
80 if(m_scenes.Contains(scene))
81 m_scenes.Remove(scene);
82 scene.EventManager.OnNewClient -= OnNewClient;
83 }
84
85 public void PostInitialise() 61 public void PostInitialise()
86 { 62 {
87 } 63 }
@@ -97,6 +73,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
97 get { return "MapSearchModule"; } 73 get { return "MapSearchModule"; }
98 } 74 }
99 75
76 public bool IsSharedModule
77 {
78 get { return true; }
79 }
80
100 #endregion 81 #endregion
101 82
102 private void OnNewClient(IClientAPI client) 83 private void OnNewClient(IClientAPI client)