From 4f1abe3e76421e0e02df908102db61e45fab8779 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 19 Oct 2007 23:36:27 +0000 Subject: * Whisper, Say and Shout distances are now configurable (what the hell!) --- OpenSim/Region/Environment/Modules/ChatModule.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index b6bbdb7..518454c 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -49,7 +49,11 @@ namespace OpenSim.Region.Environment.Modules private int m_port = 6668; private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; private string m_nick = null; - private string m_channel = null; + private string m_channel = null; + + private int m_whisperdistance = 10; + private int m_saydistance = 30; + private int m_shoutdistance = 100; private NetworkStream m_stream; private TcpClient m_irc; @@ -87,6 +91,10 @@ namespace OpenSim.Region.Environment.Modules Console.WriteLine("No IRC config information, skipping IRC bridge configuration"); } + m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance"); + m_saydistance = config.Configs["Chat"].GetInt("say_distance"); + m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance"); + if (!m_scenes.Contains(scene)) { m_scenes.Add(scene); @@ -257,7 +265,7 @@ namespace OpenSim.Region.Environment.Modules switch (e.Type) { case ChatTypeEnum.Whisper: - if ((dis < 10) && (dis > -10)) + if ((dis < m_whisperdistance) && (dis > -m_whisperdistance)) { //should change so the message is sent through the avatar rather than direct to the ClientView presence.ControllingClient.SendChatMessage(message, @@ -268,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules } break; case ChatTypeEnum.Say: - if ((dis < 30) && (dis > -30)) + if ((dis < m_saydistance) && (dis > -m_saydistance)) { //Console.WriteLine("sending chat"); presence.ControllingClient.SendChatMessage(message, @@ -279,7 +287,7 @@ namespace OpenSim.Region.Environment.Modules } break; case ChatTypeEnum.Shout: - if ((dis < 100) && (dis > -100)) + if ((dis < m_shoutdistance) && (dis > -m_shoutdistance)) { presence.ControllingClient.SendChatMessage(message, type, -- cgit v1.1