diff options
-rw-r--r-- | OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml | 1 | ||||
-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; | |||
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | 39 | ||
40 | namespace OpenSim.Region.CoreModules.Scripting.RegionReady | 40 | namespace 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 |