mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
Formatting cleanup.
This commit is contained in:
@@ -122,24 +122,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
|
||||
if (null == c.SenderObject)
|
||||
client.SendChatMessage(c.Message, (byte)c.Type,
|
||||
pos, c.From, LLUUID.Zero,
|
||||
client.SendChatMessage(c.Message, (byte)c.Type,
|
||||
pos, c.From, LLUUID.Zero,
|
||||
(byte)ChatSourceType.Agent,
|
||||
(byte)ChatAudibleLevel.Fully);
|
||||
else
|
||||
client.SendChatMessage(c.Message, (byte)c.Type,
|
||||
pos, c.From, LLUUID.Zero,
|
||||
client.SendChatMessage(c.Message, (byte)c.Type,
|
||||
pos, c.From, LLUUID.Zero,
|
||||
(byte)ChatSourceType.Object,
|
||||
(byte)ChatAudibleLevel.Fully);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void SimChat(Object sender, ChatFromViewerArgs e)
|
||||
{
|
||||
// early return if not on public or debug channel
|
||||
@@ -187,13 +187,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
if (e.Channel == DEBUG_CHANNEL)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos,
|
||||
fromID, fromName, e.Type,
|
||||
fromID, fromName, e.Type,
|
||||
message, ChatSourceType.Object);
|
||||
}
|
||||
else
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos,
|
||||
fromID, fromName, e.Type,
|
||||
fromID, fromName, e.Type,
|
||||
message, ChatSourceType.Agent);
|
||||
}
|
||||
});
|
||||
@@ -224,16 +224,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
LLVector3 fromRegionPos = fromPos + regionPos;
|
||||
LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
|
||||
int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
|
||||
|
||||
|
||||
if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
|
||||
type == ChatTypeEnum.Say && dis > m_saydistance ||
|
||||
type == ChatTypeEnum.Shout && dis > m_shoutdistance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
{
|
||||
public class IRCBridgeModule : IRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private const int DEBUG_CHANNEL = 2147483647;
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((m_config = config.Configs["IRC"]) == null)
|
||||
if ((m_config = config.Configs["IRC"]) == null)
|
||||
{
|
||||
m_log.InfoFormat("[IRC] module not configured");
|
||||
return;
|
||||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
m_log.Info("[IRC] module not configured");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
lock (m_syncInit)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
m_irc_connector.Name = "IRCConnectorThread";
|
||||
m_irc_connector.IsBackground = true;
|
||||
}
|
||||
m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName,
|
||||
m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName,
|
||||
m_defaultzone);
|
||||
}
|
||||
}
|
||||
@@ -221,9 +221,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
|
||||
if (e.Message.StartsWith("/me ") && (null != avatar))
|
||||
e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4));
|
||||
|
||||
|
||||
// this is to keep objects from talking to IRC
|
||||
if (m_irc.Connected && (avatar != null))
|
||||
if (m_irc.Connected && (avatar != null))
|
||||
m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
if ((m_irc.Enabled) && (m_irc.Connected))
|
||||
{
|
||||
m_log.DebugFormat("[IRC] {0} logging on", clientName);
|
||||
m_irc.PrivMsg(m_irc.Nick, "Sim",
|
||||
m_irc.PrivMsg(m_irc.Nick, "Sim",
|
||||
String.Format("notices {0} logging on", clientName));
|
||||
}
|
||||
m_last_new_user = clientName;
|
||||
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
m_log.InfoFormat("[IRC]: {0} logging out", clientName);
|
||||
}
|
||||
|
||||
if (m_last_new_user == clientName)
|
||||
if (m_last_new_user == clientName)
|
||||
m_last_new_user = null;
|
||||
}
|
||||
}
|
||||
@@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}",
|
||||
m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}",
|
||||
m_server, m_port, e.Message);
|
||||
}
|
||||
return m_connected;
|
||||
@@ -617,16 +617,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
|
||||
|
||||
// is message "\001ACTION foo
|
||||
// bar\001"? -> "/me foo bar"
|
||||
if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION"))
|
||||
if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION"))
|
||||
c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9));
|
||||
|
||||
|
||||
foreach (Scene scene in m_scenes)
|
||||
{
|
||||
c.Scene = scene;
|
||||
scene.EventManager.TriggerOnChatBroadcast(this, c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Thread.Sleep(150);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user