* Whisper, Say and Shout distances are now configurable (what the hell!)

afrisby
Adam Frisby 2007-10-19 23:36:27 +00:00
parent f364a084f1
commit 4f1abe3e76
2 changed files with 17 additions and 4 deletions

View File

@ -49,7 +49,11 @@ namespace OpenSim.Region.Environment.Modules
private int m_port = 6668; private int m_port = 6668;
private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
private string m_nick = null; 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 NetworkStream m_stream;
private TcpClient m_irc; private TcpClient m_irc;
@ -87,6 +91,10 @@ namespace OpenSim.Region.Environment.Modules
Console.WriteLine("No IRC config information, skipping IRC bridge configuration"); 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)) if (!m_scenes.Contains(scene))
{ {
m_scenes.Add(scene); m_scenes.Add(scene);
@ -257,7 +265,7 @@ namespace OpenSim.Region.Environment.Modules
switch (e.Type) switch (e.Type)
{ {
case ChatTypeEnum.Whisper: 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 //should change so the message is sent through the avatar rather than direct to the ClientView
presence.ControllingClient.SendChatMessage(message, presence.ControllingClient.SendChatMessage(message,
@ -268,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules
} }
break; break;
case ChatTypeEnum.Say: case ChatTypeEnum.Say:
if ((dis < 30) && (dis > -30)) if ((dis < m_saydistance) && (dis > -m_saydistance))
{ {
//Console.WriteLine("sending chat"); //Console.WriteLine("sending chat");
presence.ControllingClient.SendChatMessage(message, presence.ControllingClient.SendChatMessage(message,
@ -279,7 +287,7 @@ namespace OpenSim.Region.Environment.Modules
} }
break; break;
case ChatTypeEnum.Shout: case ChatTypeEnum.Shout:
if ((dis < 100) && (dis > -100)) if ((dis < m_shoutdistance) && (dis > -m_shoutdistance))
{ {
presence.ControllingClient.SendChatMessage(message, presence.ControllingClient.SendChatMessage(message,
type, type,

View File

@ -39,6 +39,11 @@ user_recv_key = "null"
asset_server_url = "http://127.0.0.1:8003" asset_server_url = "http://127.0.0.1:8003"
[Chat]
whisper_distance = 10
say_distance = 30
shout_distance = 100
; Uncomment the following for IRC bridge ; Uncomment the following for IRC bridge
; experimental, so if it breaks... keep both parts... yada yada ; experimental, so if it breaks... keep both parts... yada yada
; also, not good error detection when it fails ; also, not good error detection when it fails