diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 401ff6c..2c26e63 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -30,6 +30,7 @@ using System.Collections; | |||
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text.RegularExpressions; | 31 | using System.Text.RegularExpressions; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using Mono.Addins; | ||
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
35 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
@@ -86,7 +87,8 @@ using OpenSim.Region.Framework.Scenes; | |||
86 | 87 | ||
87 | namespace OpenSim.Region.CoreModules.Scripting.WorldComm | 88 | namespace OpenSim.Region.CoreModules.Scripting.WorldComm |
88 | { | 89 | { |
89 | public class WorldCommModule : IRegionModule, IWorldComm | 90 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
91 | public class WorldCommModule : IWorldComm, INonSharedRegionModule | ||
90 | { | 92 | { |
91 | // private static readonly ILog m_log = | 93 | // private static readonly ILog m_log = |
92 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 94 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -99,9 +101,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
99 | private int m_saydistance = 20; | 101 | private int m_saydistance = 20; |
100 | private int m_shoutdistance = 100; | 102 | private int m_shoutdistance = 100; |
101 | 103 | ||
102 | #region IRegionModule Members | 104 | #region INonSharedRegionModule Members |
103 | 105 | ||
104 | public void Initialise(Scene scene, IConfigSource config) | 106 | public void Initialise(IConfigSource config) |
105 | { | 107 | { |
106 | // wrap this in a try block so that defaults will work if | 108 | // wrap this in a try block so that defaults will work if |
107 | // the config file doesn't specify otherwise. | 109 | // the config file doesn't specify otherwise. |
@@ -120,18 +122,33 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
120 | } | 122 | } |
121 | if (maxlisteners < 1) maxlisteners = int.MaxValue; | 123 | if (maxlisteners < 1) maxlisteners = int.MaxValue; |
122 | if (maxhandles < 1) maxhandles = int.MaxValue; | 124 | if (maxhandles < 1) maxhandles = int.MaxValue; |
125 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); | ||
126 | m_pendingQ = new Queue(); | ||
127 | m_pending = Queue.Synchronized(m_pendingQ); | ||
128 | } | ||
123 | 129 | ||
130 | public void PostInitialise() | ||
131 | { | ||
132 | } | ||
133 | |||
134 | public void AddRegion(Scene scene) | ||
135 | { | ||
124 | m_scene = scene; | 136 | m_scene = scene; |
125 | m_scene.RegisterModuleInterface<IWorldComm>(this); | 137 | m_scene.RegisterModuleInterface<IWorldComm>(this); |
126 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); | ||
127 | m_scene.EventManager.OnChatFromClient += DeliverClientMessage; | 138 | m_scene.EventManager.OnChatFromClient += DeliverClientMessage; |
128 | m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; | 139 | m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; |
129 | m_pendingQ = new Queue(); | ||
130 | m_pending = Queue.Synchronized(m_pendingQ); | ||
131 | } | 140 | } |
132 | 141 | ||
133 | public void PostInitialise() | 142 | public void RegionLoaded(Scene scene) { } |
143 | |||
144 | public void RemoveRegion(Scene scene) | ||
134 | { | 145 | { |
146 | if (scene != m_scene) | ||
147 | return; | ||
148 | |||
149 | m_scene.UnregisterModuleInterface<IWorldComm>(this); | ||
150 | m_scene.EventManager.OnChatBroadcast -= DeliverClientMessage; | ||
151 | m_scene.EventManager.OnChatBroadcast -= DeliverClientMessage; | ||
135 | } | 152 | } |
136 | 153 | ||
137 | public void Close() | 154 | public void Close() |
@@ -143,10 +160,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
143 | get { return "WorldCommModule"; } | 160 | get { return "WorldCommModule"; } |
144 | } | 161 | } |
145 | 162 | ||
146 | public bool IsSharedModule | 163 | public Type ReplaceableInterface { get { return null; } } |
147 | { | ||
148 | get { return false; } | ||
149 | } | ||
150 | 164 | ||
151 | #endregion | 165 | #endregion |
152 | 166 | ||