diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 37 |
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 7bc5e51..db62b31 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -32,6 +32,7 @@ using log4net; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using Mono.Addins; | 33 | using Mono.Addins; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenMetaverse.StructuredData; | ||
35 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
36 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using 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) |
@@ -351,5 +360,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
351 | 360 | ||
352 | return true; | 361 | return true; |
353 | } | 362 | } |
363 | |||
364 | #region SimulatorFeaturesRequest | ||
365 | |||
366 | static OSDInteger m_SayRange, m_WhisperRange, m_ShoutRange; | ||
367 | |||
368 | private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) | ||
369 | { | ||
370 | OSD extras = new OSDMap(); | ||
371 | if (features.ContainsKey("OpenSimExtras")) | ||
372 | extras = features["OpenSimExtras"]; | ||
373 | else | ||
374 | features["OpenSimExtras"] = extras; | ||
375 | |||
376 | if (m_SayRange == null) | ||
377 | { | ||
378 | // Do this only once | ||
379 | m_SayRange = new OSDInteger(m_saydistance); | ||
380 | m_WhisperRange = new OSDInteger(m_whisperdistance); | ||
381 | m_ShoutRange = new OSDInteger(m_shoutdistance); | ||
382 | } | ||
383 | |||
384 | ((OSDMap)extras)["say-range"] = m_SayRange; | ||
385 | ((OSDMap)extras)["whisper-range"] = m_WhisperRange; | ||
386 | ((OSDMap)extras)["shout-range"] = m_ShoutRange; | ||
387 | |||
388 | } | ||
389 | |||
390 | #endregion | ||
354 | } | 391 | } |
355 | } \ No newline at end of file | 392 | } \ No newline at end of file |