diff options
author | Melanie | 2010-01-26 14:53:14 +0000 |
---|---|---|
committer | Melanie | 2010-01-26 14:53:14 +0000 |
commit | b80ea002654bd0ab232aee2b0f842be18b8d4edc (patch) | |
tree | 35971637efd7ec9cbfaee88bc5ea56edffddfc1b /OpenSim/Region/CoreModules/Scripting | |
parent | Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into ... (diff) | |
parent | Replace dome tabs with spaces (diff) | |
download | opensim-SC-b80ea002654bd0ab232aee2b0f842be18b8d4edc.zip opensim-SC-b80ea002654bd0ab232aee2b0f842be18b8d4edc.tar.gz opensim-SC-b80ea002654bd0ab232aee2b0f842be18b8d4edc.tar.bz2 opensim-SC-b80ea002654bd0ab232aee2b0f842be18b8d4edc.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
8 files changed, 210 insertions, 86 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index 679c871..40b7159 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Drawing; | 30 | using System.Drawing; |
31 | using System.Drawing.Imaging; | 31 | using System.Drawing.Imaging; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenMetaverse.Imaging; | 35 | using OpenMetaverse.Imaging; |
@@ -40,7 +41,8 @@ using System.Reflection; | |||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | 42 | namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture |
42 | { | 43 | { |
43 | public class DynamicTextureModule : IRegionModule, IDynamicTextureManager | 44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
45 | public class DynamicTextureModule : ISharedRegionModule, IDynamicTextureManager | ||
44 | { | 46 | { |
45 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 48 | ||
@@ -210,9 +212,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
210 | 212 | ||
211 | #endregion | 213 | #endregion |
212 | 214 | ||
213 | #region IRegionModule Members | 215 | #region ISharedRegionModule Members |
214 | 216 | ||
215 | public void Initialise(Scene scene, IConfigSource config) | 217 | public void Initialise(IConfigSource config) |
218 | { | ||
219 | |||
220 | } | ||
221 | |||
222 | public void AddRegion(Scene scene) | ||
216 | { | 223 | { |
217 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) | 224 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) |
218 | { | 225 | { |
@@ -221,6 +228,24 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
221 | } | 228 | } |
222 | } | 229 | } |
223 | 230 | ||
231 | public Type ReplaceableInterface | ||
232 | { | ||
233 | get { return null; } | ||
234 | } | ||
235 | |||
236 | public void RegionLoaded(Scene scene) | ||
237 | { | ||
238 | } | ||
239 | |||
240 | public void RemoveRegion(Scene scene) | ||
241 | { | ||
242 | if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) | ||
243 | { | ||
244 | RegisteredScenes.Remove(scene.RegionInfo.RegionID); | ||
245 | scene.UnregisterModuleInterface<IDynamicTextureManager>(this); | ||
246 | } | ||
247 | } | ||
248 | |||
224 | public void PostInitialise() | 249 | public void PostInitialise() |
225 | { | 250 | { |
226 | } | 251 | } |
@@ -234,11 +259,6 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
234 | get { return "DynamicTextureModule"; } | 259 | get { return "DynamicTextureModule"; } |
235 | } | 260 | } |
236 | 261 | ||
237 | public bool IsSharedModule | ||
238 | { | ||
239 | get { return true; } | ||
240 | } | ||
241 | |||
242 | #endregion | 262 | #endregion |
243 | 263 | ||
244 | #region Nested type: DynamicTextureUpdater | 264 | #region Nested type: DynamicTextureUpdater |
@@ -358,18 +378,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture | |||
358 | // tmptex.DefaultTexture.Fullbright = true; | 378 | // tmptex.DefaultTexture.Fullbright = true; |
359 | 379 | ||
360 | part.UpdateTexture(tmptex); | 380 | part.UpdateTexture(tmptex); |
361 | } | 381 | } |
362 | 382 | ||
363 | if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) | 383 | if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) |
364 | { | 384 | { |
365 | if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); | 385 | if (oldAsset == null) oldAsset = scene.AssetService.Get(oldID.ToString()); |
366 | if (oldAsset != null) | 386 | if (oldAsset != null) |
367 | { | 387 | { |
368 | if (oldAsset.Temporary == true) | 388 | if (oldAsset.Temporary == true) |
369 | { | 389 | { |
370 | scene.AssetService.Delete(oldID.ToString()); | 390 | scene.AssetService.Delete(oldID.ToString()); |
371 | } | 391 | } |
372 | } | 392 | } |
373 | } | 393 | } |
374 | } | 394 | } |
375 | 395 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 83f004d..d6ed468 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -32,6 +32,7 @@ using System.Text.RegularExpressions; | |||
32 | using DotNetOpenMail; | 32 | using DotNetOpenMail; |
33 | using DotNetOpenMail.SmtpAuth; | 33 | using DotNetOpenMail.SmtpAuth; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using OpenMetaverse; | 37 | using OpenMetaverse; |
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
@@ -40,6 +41,7 @@ using OpenSim.Region.Framework.Scenes; | |||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.Scripting.EmailModules | 42 | namespace OpenSim.Region.CoreModules.Scripting.EmailModules |
42 | { | 43 | { |
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | ||
43 | public class EmailModule : IEmailModule | 45 | public class EmailModule : IEmailModule |
44 | { | 46 | { |
45 | // | 47 | // |
@@ -94,7 +96,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
94 | } | 96 | } |
95 | } | 97 | } |
96 | 98 | ||
97 | public void Initialise(Scene scene, IConfigSource config) | 99 | public void Initialise(IConfigSource config) |
98 | { | 100 | { |
99 | m_Config = config; | 101 | m_Config = config; |
100 | IConfig SMTPConfig; | 102 | IConfig SMTPConfig; |
@@ -136,7 +138,16 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
136 | m_Enabled = false; | 138 | m_Enabled = false; |
137 | return; | 139 | return; |
138 | } | 140 | } |
141 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | ||
142 | } | ||
143 | |||
144 | public Type ReplaceableInterface | ||
145 | { | ||
146 | get { return null; } | ||
147 | } | ||
139 | 148 | ||
149 | public void AddRegion(Scene scene) | ||
150 | { | ||
140 | // It's a go! | 151 | // It's a go! |
141 | if (m_Enabled) | 152 | if (m_Enabled) |
142 | { | 153 | { |
@@ -155,8 +166,20 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
155 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); | 166 | m_Scenes.Add(scene.RegionInfo.RegionHandle, scene); |
156 | } | 167 | } |
157 | } | 168 | } |
169 | } | ||
170 | } | ||
158 | 171 | ||
159 | m_log.Info("[EMAIL] Activated DefaultEmailModule"); | 172 | public void RegionLoaded(Scene scene) |
173 | { | ||
174 | } | ||
175 | |||
176 | public void RemoveRegion(Scene scene) | ||
177 | { | ||
178 | scene.UnregisterModuleInterface<IEmailModule>(this); | ||
179 | |||
180 | if (m_Scenes.ContainsKey(scene.RegionInfo.RegionHandle)) | ||
181 | { | ||
182 | m_Scenes.Remove(scene.RegionInfo.RegionHandle); | ||
160 | } | 183 | } |
161 | } | 184 | } |
162 | 185 | ||
@@ -173,11 +196,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
173 | get { return "DefaultEmailModule"; } | 196 | get { return "DefaultEmailModule"; } |
174 | } | 197 | } |
175 | 198 | ||
176 | public bool IsSharedModule | ||
177 | { | ||
178 | get { return true; } | ||
179 | } | ||
180 | |||
181 | /// <summary> | 199 | /// <summary> |
182 | /// Delay function using thread in seconds | 200 | /// Delay function using thread in seconds |
183 | /// </summary> | 201 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index d78931a..e331b8d 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -31,6 +31,7 @@ using System.IO; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Text; | 32 | using System.Text; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using Mono.Addins; | ||
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
@@ -84,7 +85,8 @@ using OpenSim.Region.Framework.Scenes; | |||
84 | 85 | ||
85 | namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | 86 | namespace OpenSim.Region.CoreModules.Scripting.HttpRequest |
86 | { | 87 | { |
87 | public class HttpRequestModule : IRegionModule, IHttpRequestModule | 88 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
89 | public class HttpRequestModule : ISharedRegionModule, IHttpRequestModule | ||
88 | { | 90 | { |
89 | private object HttpListLock = new object(); | 91 | private object HttpListLock = new object(); |
90 | private int httpTimeout = 30000; | 92 | private int httpTimeout = 30000; |
@@ -229,18 +231,35 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
229 | 231 | ||
230 | #endregion | 232 | #endregion |
231 | 233 | ||
232 | #region IRegionModule Members | 234 | #region ISharedRegionModule Members |
233 | 235 | ||
234 | public void Initialise(Scene scene, IConfigSource config) | 236 | public void Initialise(IConfigSource config) |
237 | { | ||
238 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | ||
239 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | ||
240 | |||
241 | m_pendingRequests = new Dictionary<UUID, HttpRequestClass>(); | ||
242 | } | ||
243 | |||
244 | public void AddRegion(Scene scene) | ||
235 | { | 245 | { |
236 | m_scene = scene; | 246 | m_scene = scene; |
237 | 247 | ||
238 | m_scene.RegisterModuleInterface<IHttpRequestModule>(this); | 248 | m_scene.RegisterModuleInterface<IHttpRequestModule>(this); |
249 | } | ||
250 | |||
251 | public Type ReplaceableInterface | ||
252 | { | ||
253 | get { return null; } | ||
254 | } | ||
239 | 255 | ||
240 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | 256 | public void RegionLoaded(Scene scene) |
241 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | 257 | { |
258 | } | ||
242 | 259 | ||
243 | m_pendingRequests = new Dictionary<UUID, HttpRequestClass>(); | 260 | public void RemoveRegion(Scene scene) |
261 | { | ||
262 | scene.UnregisterModuleInterface<IHttpRequestModule>(this); | ||
244 | } | 263 | } |
245 | 264 | ||
246 | public void PostInitialise() | 265 | public void PostInitialise() |
@@ -256,11 +275,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest | |||
256 | get { return m_name; } | 275 | get { return m_name; } |
257 | } | 276 | } |
258 | 277 | ||
259 | public bool IsSharedModule | ||
260 | { | ||
261 | get { return true; } | ||
262 | } | ||
263 | |||
264 | #endregion | 278 | #endregion |
265 | } | 279 | } |
266 | 280 | ||
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 9b565ed..6ce55a9 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -126,6 +126,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
126 | 126 | ||
127 | public void RemoveRegion(Scene scene) | 127 | public void RemoveRegion(Scene scene) |
128 | { | 128 | { |
129 | scene.UnregisterModuleInterface<IUrlModule>(this); | ||
130 | scene.EventManager.OnScriptReset -= OnScriptReset; | ||
129 | } | 131 | } |
130 | 132 | ||
131 | public void Close() | 133 | public void Close() |
diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index c23cea5..35ce2cb 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Drawing; | 29 | using System.Drawing; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Net; | 31 | using System.Net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenMetaverse.Imaging; | 35 | using OpenMetaverse.Imaging; |
@@ -39,7 +40,8 @@ using System.Reflection; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | 41 | namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL |
41 | { | 42 | { |
42 | public class LoadImageURLModule : IRegionModule, IDynamicTextureRender | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
44 | public class LoadImageURLModule : ISharedRegionModule, IDynamicTextureRender | ||
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
@@ -97,20 +99,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
97 | 99 | ||
98 | #endregion | 100 | #endregion |
99 | 101 | ||
100 | #region IRegionModule Members | 102 | #region ISharedRegionModule Members |
101 | 103 | ||
102 | public void Initialise(Scene scene, IConfigSource config) | 104 | public void Initialise(IConfigSource config) |
105 | { | ||
106 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | ||
107 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | ||
108 | } | ||
109 | |||
110 | public void AddRegion(Scene scene) | ||
103 | { | 111 | { |
104 | if (m_scene == null) | 112 | if (m_scene == null) |
105 | { | 113 | { |
106 | m_scene = scene; | 114 | m_scene = scene; |
107 | } | 115 | } |
108 | |||
109 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | ||
110 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | ||
111 | } | 116 | } |
112 | 117 | ||
113 | public void PostInitialise() | 118 | public Type ReplaceableInterface |
119 | { | ||
120 | get { return null; } | ||
121 | } | ||
122 | |||
123 | public void RegionLoaded(Scene scene) | ||
114 | { | 124 | { |
115 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); | 125 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); |
116 | if (m_textureManager != null) | 126 | if (m_textureManager != null) |
@@ -119,18 +129,21 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL | |||
119 | } | 129 | } |
120 | } | 130 | } |
121 | 131 | ||
122 | public void Close() | 132 | public void RemoveRegion(Scene scene) |
123 | { | 133 | { |
124 | } | 134 | } |
125 | 135 | ||
126 | public string Name | 136 | public void PostInitialise() |
127 | { | 137 | { |
128 | get { return m_name; } | ||
129 | } | 138 | } |
130 | 139 | ||
131 | public bool IsSharedModule | 140 | public void Close() |
132 | { | 141 | { |
133 | get { return true; } | 142 | } |
143 | |||
144 | public string Name | ||
145 | { | ||
146 | get { return m_name; } | ||
134 | } | 147 | } |
135 | 148 | ||
136 | #endregion | 149 | #endregion |
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index d57a8e5..71b01a1 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -31,6 +31,7 @@ using System.Drawing.Imaging; | |||
31 | using System.Globalization; | 31 | using System.Globalization; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Net; | 33 | using System.Net; |
34 | using Mono.Addins; | ||
34 | using Nini.Config; | 35 | using Nini.Config; |
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
36 | using OpenMetaverse.Imaging; | 37 | using OpenMetaverse.Imaging; |
@@ -43,7 +44,8 @@ using System.Reflection; | |||
43 | 44 | ||
44 | namespace OpenSim.Region.CoreModules.Scripting.VectorRender | 45 | namespace OpenSim.Region.CoreModules.Scripting.VectorRender |
45 | { | 46 | { |
46 | public class VectorRenderModule : IRegionModule, IDynamicTextureRender | 47 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
48 | public class VectorRenderModule : ISharedRegionModule, IDynamicTextureRender | ||
47 | { | 49 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 51 | ||
@@ -110,15 +112,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
110 | 112 | ||
111 | #endregion | 113 | #endregion |
112 | 114 | ||
113 | #region IRegionModule Members | 115 | #region ISharedRegionModule Members |
114 | 116 | ||
115 | public void Initialise(Scene scene, IConfigSource config) | 117 | public void Initialise(IConfigSource config) |
116 | { | 118 | { |
117 | if (m_scene == null) | ||
118 | { | ||
119 | m_scene = scene; | ||
120 | } | ||
121 | |||
122 | if (m_graph == null) | 119 | if (m_graph == null) |
123 | { | 120 | { |
124 | Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); | 121 | Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); |
@@ -133,7 +130,20 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
133 | m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); | 130 | m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); |
134 | } | 131 | } |
135 | 132 | ||
136 | public void PostInitialise() | 133 | public void AddRegion(Scene scene) |
134 | { | ||
135 | if (m_scene == null) | ||
136 | { | ||
137 | m_scene = scene; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | public Type ReplaceableInterface | ||
142 | { | ||
143 | get { return null; } | ||
144 | } | ||
145 | |||
146 | public void RegionLoaded(Scene scene) | ||
137 | { | 147 | { |
138 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); | 148 | m_textureManager = m_scene.RequestModuleInterface<IDynamicTextureManager>(); |
139 | if (m_textureManager != null) | 149 | if (m_textureManager != null) |
@@ -142,18 +152,21 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
142 | } | 152 | } |
143 | } | 153 | } |
144 | 154 | ||
145 | public void Close() | 155 | public void RemoveRegion(Scene scene) |
146 | { | 156 | { |
147 | } | 157 | } |
148 | 158 | ||
149 | public string Name | 159 | public void PostInitialise() |
150 | { | 160 | { |
151 | get { return m_name; } | ||
152 | } | 161 | } |
153 | 162 | ||
154 | public bool IsSharedModule | 163 | public void Close() |
164 | { | ||
165 | } | ||
166 | |||
167 | public string Name | ||
155 | { | 168 | { |
156 | get { return true; } | 169 | get { return m_name; } |
157 | } | 170 | } |
158 | 171 | ||
159 | #endregion | 172 | #endregion |
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 60df2e7..acd8dbf 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using Mono.Addins; | ||
31 | using Nini.Config; | 32 | using Nini.Config; |
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
@@ -85,7 +86,8 @@ using OpenSim.Region.Framework.Scenes; | |||
85 | 86 | ||
86 | namespace OpenSim.Region.CoreModules.Scripting.WorldComm | 87 | namespace OpenSim.Region.CoreModules.Scripting.WorldComm |
87 | { | 88 | { |
88 | public class WorldCommModule : IRegionModule, IWorldComm | 89 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
90 | public class WorldCommModule : INonSharedRegionModule, IWorldComm | ||
89 | { | 91 | { |
90 | // private static readonly ILog m_log = | 92 | // private static readonly ILog m_log = |
91 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 93 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -98,9 +100,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
98 | private int m_saydistance = 30; | 100 | private int m_saydistance = 30; |
99 | private int m_shoutdistance = 100; | 101 | private int m_shoutdistance = 100; |
100 | 102 | ||
101 | #region IRegionModule Members | 103 | #region ISharedRegionModule Members |
102 | 104 | ||
103 | public void Initialise(Scene scene, IConfigSource config) | 105 | public void Initialise(IConfigSource config) |
104 | { | 106 | { |
105 | // wrap this in a try block so that defaults will work if | 107 | // wrap this in a try block so that defaults will work if |
106 | // the config file doesn't specify otherwise. | 108 | // the config file doesn't specify otherwise. |
@@ -120,31 +122,42 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
120 | if (maxlisteners < 1) maxlisteners = int.MaxValue; | 122 | if (maxlisteners < 1) maxlisteners = int.MaxValue; |
121 | if (maxhandles < 1) maxhandles = int.MaxValue; | 123 | if (maxhandles < 1) maxhandles = int.MaxValue; |
122 | 124 | ||
125 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); | ||
126 | m_pendingQ = new Queue(); | ||
127 | m_pending = Queue.Synchronized(m_pendingQ); | ||
128 | } | ||
129 | |||
130 | public void AddRegion(Scene scene) | ||
131 | { | ||
123 | m_scene = scene; | 132 | m_scene = scene; |
124 | m_scene.RegisterModuleInterface<IWorldComm>(this); | 133 | m_scene.RegisterModuleInterface<IWorldComm>(this); |
125 | m_listenerManager = new ListenerManager(maxlisteners, maxhandles); | ||
126 | m_scene.EventManager.OnChatFromClient += DeliverClientMessage; | 134 | m_scene.EventManager.OnChatFromClient += DeliverClientMessage; |
127 | m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; | 135 | m_scene.EventManager.OnChatBroadcast += DeliverClientMessage; |
128 | m_pendingQ = new Queue(); | ||
129 | m_pending = Queue.Synchronized(m_pendingQ); | ||
130 | } | 136 | } |
131 | 137 | ||
132 | public void PostInitialise() | 138 | public Type ReplaceableInterface |
133 | { | 139 | { |
140 | get { return null; } | ||
134 | } | 141 | } |
135 | 142 | ||
136 | public void Close() | 143 | public void RegionLoaded(Scene scene) |
137 | { | 144 | { |
138 | } | 145 | } |
139 | 146 | ||
140 | public string Name | 147 | public void RemoveRegion(Scene scene) |
141 | { | 148 | { |
142 | get { return "WorldCommModule"; } | 149 | scene.UnregisterModuleInterface<IWorldComm>(this); |
150 | scene.EventManager.OnChatFromClient -= DeliverClientMessage; | ||
151 | scene.EventManager.OnChatBroadcast -= DeliverClientMessage; | ||
143 | } | 152 | } |
144 | 153 | ||
145 | public bool IsSharedModule | 154 | public void Close() |
146 | { | 155 | { |
147 | get { return false; } | 156 | } |
157 | |||
158 | public string Name | ||
159 | { | ||
160 | get { return "WorldCommModule"; } | ||
148 | } | 161 | } |
149 | 162 | ||
150 | #endregion | 163 | #endregion |
diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 27b64bf..a9147fb6 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | |||
@@ -32,6 +32,7 @@ using System.Net; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using Nwc.XmlRpc; | 37 | using Nwc.XmlRpc; |
37 | using OpenMetaverse; | 38 | using OpenMetaverse; |
@@ -76,7 +77,8 @@ using OpenSim.Region.Framework.Scenes; | |||
76 | 77 | ||
77 | namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | 78 | namespace OpenSim.Region.CoreModules.Scripting.XMLRPC |
78 | { | 79 | { |
79 | public class XMLRPCModule : IRegionModule, IXMLRPC | 80 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
81 | public class XMLRPCModule : ISharedRegionModule, IXMLRPC | ||
80 | { | 82 | { |
81 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 83 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
82 | 84 | ||
@@ -94,9 +96,9 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
94 | private int RemoteReplyScriptWait = 300; | 96 | private int RemoteReplyScriptWait = 300; |
95 | private object XMLRPCListLock = new object(); | 97 | private object XMLRPCListLock = new object(); |
96 | 98 | ||
97 | #region IRegionModule Members | 99 | #region ISharedRegionModule Members |
98 | 100 | ||
99 | public void Initialise(Scene scene, IConfigSource config) | 101 | public void Initialise(IConfigSource config) |
100 | { | 102 | { |
101 | // We need to create these early because the scripts might be calling | 103 | // We need to create these early because the scripts might be calling |
102 | // But since this gets called for every region, we need to make sure they | 104 | // But since this gets called for every region, we need to make sure they |
@@ -116,7 +118,14 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
116 | { | 118 | { |
117 | } | 119 | } |
118 | } | 120 | } |
121 | } | ||
122 | |||
123 | public void PostInitialise() | ||
124 | { | ||
125 | } | ||
119 | 126 | ||
127 | public void AddRegion(Scene scene) | ||
128 | { | ||
120 | if (!m_scenes.Contains(scene)) | 129 | if (!m_scenes.Contains(scene)) |
121 | { | 130 | { |
122 | m_scenes.Add(scene); | 131 | m_scenes.Add(scene); |
@@ -125,7 +134,12 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
125 | } | 134 | } |
126 | } | 135 | } |
127 | 136 | ||
128 | public void PostInitialise() | 137 | public Type ReplaceableInterface |
138 | { | ||
139 | get { return null; } | ||
140 | } | ||
141 | private Dictionary<Scene, BaseHttpServer> m_HttpServers = new Dictionary<Scene, BaseHttpServer>(); | ||
142 | public void RegionLoaded(Scene scene) | ||
129 | { | 143 | { |
130 | if (IsEnabled()) | 144 | if (IsEnabled()) |
131 | { | 145 | { |
@@ -133,24 +147,41 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC | |||
133 | // Attach xmlrpc handlers | 147 | // Attach xmlrpc handlers |
134 | m_log.Info("[REMOTE_DATA]: " + | 148 | m_log.Info("[REMOTE_DATA]: " + |
135 | "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); | 149 | "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); |
136 | BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); | 150 | BaseHttpServer httpServer = new BaseHttpServer((uint)m_remoteDataPort); |
137 | httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); | 151 | httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); |
138 | httpServer.Start(); | 152 | httpServer.Start(); |
153 | m_HttpServers.Add(scene, httpServer); | ||
139 | } | 154 | } |
140 | } | 155 | } |
141 | 156 | ||
142 | public void Close() | 157 | public void RemoveRegion(Scene scene) |
143 | { | 158 | { |
159 | if (m_scenes.Contains(scene)) | ||
160 | m_scenes.Remove(scene); | ||
161 | scene.UnregisterModuleInterface<IXMLRPC>(this); | ||
162 | if (IsEnabled()) | ||
163 | { | ||
164 | // Start http server | ||
165 | // Attach xmlrpc handlers | ||
166 | if (m_HttpServers.ContainsKey(scene)) | ||
167 | { | ||
168 | BaseHttpServer httpServer; | ||
169 | m_HttpServers.TryGetValue(scene, out httpServer); | ||
170 | m_log.Info("[REMOTE_DATA]: " + | ||
171 | "Stopping XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); | ||
172 | httpServer.RemoveXmlRPCHandler("llRemoteData"); | ||
173 | httpServer.Stop(); | ||
174 | } | ||
175 | } | ||
144 | } | 176 | } |
145 | 177 | ||
146 | public string Name | 178 | public void Close() |
147 | { | 179 | { |
148 | get { return m_name; } | ||
149 | } | 180 | } |
150 | 181 | ||
151 | public bool IsSharedModule | 182 | public string Name |
152 | { | 183 | { |
153 | get { return true; } | 184 | get { return m_name; } |
154 | } | 185 | } |
155 | 186 | ||
156 | public int Port | 187 | public int Port |