aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2013-10-04 17:32:17 -0700
committerDiva Canto2013-10-04 17:32:17 -0700
commit083eb7679b8565757e025d8fe090e9d147fe132d (patch)
treefff1e5dffc03b1a76c5a511c710be110bc288b72 /OpenSim
parentUpdate an AssmblyVersion property that I missed to 0.8.0 (diff)
downloadopensim-SC_OLD-083eb7679b8565757e025d8fe090e9d147fe132d.zip
opensim-SC_OLD-083eb7679b8565757e025d8fe090e9d147fe132d.tar.gz
opensim-SC_OLD-083eb7679b8565757e025d8fe090e9d147fe132d.tar.bz2
opensim-SC_OLD-083eb7679b8565757e025d8fe090e9d147fe132d.tar.xz
Added SimulatorFeatures/OpenSimExtras: say-range, whisper-range, shout-range, at the request of Singularity dev Liru-Dargon
Diffstat (limited to 'OpenSim')
-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