mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
* Whisper, Say and Shout distances are now configurable (what the hell!)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user