aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authordr scofield (aka dirk husemann)2009-08-31 15:02:21 +0200
committerdr scofield (aka dirk husemann)2009-08-31 15:02:21 +0200
commit3581b9abce2cf5e29a2e25ae50e3112d98860e13 (patch)
treefc5774cdcaf7a96bdac20b82c50e219daa3e2a0e /OpenSim
parentMerge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff)
parentcleaning up RegionReadyModule: (diff)
downloadopensim-SC_OLD-3581b9abce2cf5e29a2e25ae50e3112d98860e13.zip
opensim-SC_OLD-3581b9abce2cf5e29a2e25ae50e3112d98860e13.tar.gz
opensim-SC_OLD-3581b9abce2cf5e29a2e25ae50e3112d98860e13.tar.bz2
opensim-SC_OLD-3581b9abce2cf5e29a2e25ae50e3112d98860e13.tar.xz
Merge branch 'regionready' into opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml1
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs (renamed from OpenSim/Region/OptionalModules/Scripting/RegionReady/RegionReady.cs)68
2 files changed, 45 insertions, 24 deletions
diff --git a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml
index 389044e..352052a 100644
--- a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml
+++ b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml
@@ -8,6 +8,7 @@
8 </Dependencies> 8 </Dependencies>
9 9
10 <Extension path = "/OpenSim/RegionModules"> 10 <Extension path = "/OpenSim/RegionModules">
11 <RegionModule id="RegionReady" type="OpenSim.Region.OptionalModules.Scripting.RegionReady.RegionReadyModule" />
11 <RegionModule id="IRCBridge" type="OpenSim.Region.OptionalModules.Avatar.Chat.IRCBridgeModule" /> 12 <RegionModule id="IRCBridge" type="OpenSim.Region.OptionalModules.Avatar.Chat.IRCBridgeModule" />
12 <RegionModule id="Concierge" type="OpenSim.Region.OptionalModules.Avatar.Concierge.ConciergeModule" /> 13 <RegionModule id="Concierge" type="OpenSim.Region.OptionalModules.Avatar.Concierge.ConciergeModule" />
13 <RegionModule id="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" /> 14 <RegionModule id="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" />
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReady/RegionReady.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index f2c6db1..1b02bb0 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReady/RegionReady.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -37,11 +37,13 @@ using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
39 39
40namespace OpenSim.Region.CoreModules.Scripting.RegionReady 40namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
41{ 41{
42 public class RegionReady : IRegionModule 42 public class RegionReadyModule : INonSharedRegionModule
43 { 43 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log =
45 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46
45 private IConfig m_config = null; 47 private IConfig m_config = null;
46 private bool m_firstEmptyCompileQueue; 48 private bool m_firstEmptyCompileQueue;
47 private bool m_oarFileLoading; 49 private bool m_oarFileLoading;
@@ -51,15 +53,17 @@ namespace OpenSim.Region.CoreModules.Scripting.RegionReady
51 53
52 Scene m_scene = null; 54 Scene m_scene = null;
53 55
54 #region IRegionModule interface 56 #region INonSharedRegionModule interface
57
58 public Type ReplaceableInterface
59 {
60 get { return null; }
61 }
55 62
56 public void Initialise(Scene scene, IConfigSource config) 63 public void Initialise(IConfigSource config)
57 { 64 {
58 m_log.Info("[RegionReady] Initialising"); 65 m_log.Info("[RegionReady] Initialising");
59 m_scene = scene; 66
60 m_firstEmptyCompileQueue = true;
61 m_oarFileLoading = false;
62 m_lastOarLoadedOk = true;
63 m_config = config.Configs["RegionReady"]; 67 m_config = config.Configs["RegionReady"];
64 68
65 if (m_config != null) 69 if (m_config != null)
@@ -70,34 +74,50 @@ namespace OpenSim.Region.CoreModules.Scripting.RegionReady
70 m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify); 74 m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify);
71 } 75 }
72 } 76 }
77
78 if (!m_enabled)
79 m_log.Info("[RegionReady] disabled.");
73 } 80 }
74 81
75 public void PostInitialise() 82 public void AddRegion(Scene scene)
76 { 83 {
77 if (m_enabled) 84 if (!m_enabled)
78 { 85 return;
79 m_log.Info("[RegionReady]: Enabled"); 86
80 m_scene.EventManager.OnEmptyScriptCompileQueue += new EventManager.EmptyScriptCompileQueue(OnEmptyScriptCompileQueue); 87 m_firstEmptyCompileQueue = true;
81 m_scene.EventManager.OnOarFileLoaded += new EventManager.OarFileLoaded(OnOarFileLoaded); 88 m_oarFileLoading = false;
82 } 89 m_lastOarLoadedOk = true;
83 else 90
84 { 91 m_scene = scene;
85 m_log.Info("[RegionReady]: Disabled"); 92
86 } 93 m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
94 m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
95
96 m_log.InfoFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
97 }
98
99 public void RemoveRegion(Scene scene)
100 {
101 if (!m_enabled)
102 return;
103
104 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
105 m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
106
107 m_scene = null;
87 } 108 }
88 109
89 public void Close() 110 public void Close()
90 { 111 {
91 } 112 }
92 113
93 public string Name 114 public void RegionLoaded(Scene scene)
94 { 115 {
95 get { return "RegionReadyModule"; }
96 } 116 }
97 117
98 public bool IsSharedModule 118 public string Name
99 { 119 {
100 get { return false; } 120 get { return "RegionReadyModule"; }
101 } 121 }
102 122
103 #endregion 123 #endregion