aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 5229c08..27ace68 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -32,6 +32,7 @@ using log4net;
32using Nini.Config; 32using Nini.Config;
33using Mono.Addins; 33using Mono.Addins;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenMetaverse.StructuredData;
35using OpenSim.Framework; 36using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
@@ -94,6 +95,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
94 95
95 public virtual void RegionLoaded(Scene scene) 96 public virtual void RegionLoaded(Scene scene)
96 { 97 {
98 if (!m_enabled)
99 return;
100
101 ISimulatorFeaturesModule featuresModule = scene.RequestModuleInterface<ISimulatorFeaturesModule>();
102
103 if (featuresModule != null)
104 featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest;
105
97 } 106 }
98 107
99 public virtual void RemoveRegion(Scene scene) 108 public virtual void RemoveRegion(Scene scene)
@@ -353,5 +362,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
353 362
354 return true; 363 return true;
355 } 364 }
365
366 #region SimulatorFeaturesRequest
367
368 static OSDInteger m_SayRange, m_WhisperRange, m_ShoutRange;
369
370 private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features)
371 {
372 OSD extras = new OSDMap();
373 if (features.ContainsKey("OpenSimExtras"))
374 extras = features["OpenSimExtras"];
375 else
376 features["OpenSimExtras"] = extras;
377
378 if (m_SayRange == null)
379 {
380 // Do this only once
381 m_SayRange = new OSDInteger(m_saydistance);
382 m_WhisperRange = new OSDInteger(m_whisperdistance);
383 m_ShoutRange = new OSDInteger(m_shoutdistance);
384 }
385
386 ((OSDMap)extras)["say-range"] = m_SayRange;
387 ((OSDMap)extras)["whisper-range"] = m_WhisperRange;
388 ((OSDMap)extras)["shout-range"] = m_ShoutRange;
389
390 }
391
392 #endregion
356 } 393 }
357} \ No newline at end of file 394} \ No newline at end of file