aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Avatar
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Avatar')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs26
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs24
2 files changed, 25 insertions, 25 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
index 89437c5..5414322 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs
@@ -122,24 +122,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
122 122
123 IClientAPI client = presence.ControllingClient; 123 IClientAPI client = presence.ControllingClient;
124 124
125 if ((c.Type == ChatTypeEnum.Owner) && 125 if ((c.Type == ChatTypeEnum.Owner) &&
126 (null != c.SenderObject) && 126 (null != c.SenderObject) &&
127 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId)) 127 (((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
128 return; 128 return;
129 129
130 if (null == c.SenderObject) 130 if (null == c.SenderObject)
131 client.SendChatMessage(c.Message, (byte)c.Type, 131 client.SendChatMessage(c.Message, (byte)c.Type,
132 pos, c.From, LLUUID.Zero, 132 pos, c.From, LLUUID.Zero,
133 (byte)ChatSourceType.Agent, 133 (byte)ChatSourceType.Agent,
134 (byte)ChatAudibleLevel.Fully); 134 (byte)ChatAudibleLevel.Fully);
135 else 135 else
136 client.SendChatMessage(c.Message, (byte)c.Type, 136 client.SendChatMessage(c.Message, (byte)c.Type,
137 pos, c.From, LLUUID.Zero, 137 pos, c.From, LLUUID.Zero,
138 (byte)ChatSourceType.Object, 138 (byte)ChatSourceType.Object,
139 (byte)ChatAudibleLevel.Fully); 139 (byte)ChatAudibleLevel.Fully);
140 }); 140 });
141 } 141 }
142 142
143 public void SimChat(Object sender, ChatFromViewerArgs e) 143 public void SimChat(Object sender, ChatFromViewerArgs e)
144 { 144 {
145 // early return if not on public or debug channel 145 // early return if not on public or debug channel
@@ -187,13 +187,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
187 if (e.Channel == DEBUG_CHANNEL) 187 if (e.Channel == DEBUG_CHANNEL)
188 { 188 {
189 TrySendChatMessage(presence, fromPos, regionPos, 189 TrySendChatMessage(presence, fromPos, regionPos,
190 fromID, fromName, e.Type, 190 fromID, fromName, e.Type,
191 message, ChatSourceType.Object); 191 message, ChatSourceType.Object);
192 } 192 }
193 else 193 else
194 { 194 {
195 TrySendChatMessage(presence, fromPos, regionPos, 195 TrySendChatMessage(presence, fromPos, regionPos,
196 fromID, fromName, e.Type, 196 fromID, fromName, e.Type,
197 message, ChatSourceType.Agent); 197 message, ChatSourceType.Agent);
198 } 198 }
199 }); 199 });
@@ -224,16 +224,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
224 LLVector3 fromRegionPos = fromPos + regionPos; 224 LLVector3 fromRegionPos = fromPos + regionPos;
225 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos; 225 LLVector3 toRegionPos = presence.AbsolutePosition + regionPos;
226 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos)); 226 int dis = Math.Abs((int) Util.GetDistanceTo(toRegionPos, fromRegionPos));
227 227
228 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || 228 if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance ||
229 type == ChatTypeEnum.Say && dis > m_saydistance || 229 type == ChatTypeEnum.Say && dis > m_saydistance ||
230 type == ChatTypeEnum.Shout && dis > m_shoutdistance) 230 type == ChatTypeEnum.Shout && dis > m_shoutdistance)
231 { 231 {
232 return; 232 return;
233 } 233 }
234 234
235 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView 235 // TODO: should change so the message is sent through the avatar rather than direct to the ClientView
236 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, 236 presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
237 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); 237 fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
238 } 238 }
239 } 239 }
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
index c8d5f80..85262f5 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/IRCBridgeModule.cs
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
43{ 43{
44 public class IRCBridgeModule : IRegionModule 44 public class IRCBridgeModule : IRegionModule
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private const int DEBUG_CHANNEL = 2147483647; 49 private const int DEBUG_CHANNEL = 2147483647;
@@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
68 { 68 {
69 try 69 try
70 { 70 {
71 if ((m_config = config.Configs["IRC"]) == null) 71 if ((m_config = config.Configs["IRC"]) == null)
72 { 72 {
73 m_log.InfoFormat("[IRC] module not configured"); 73 m_log.InfoFormat("[IRC] module not configured");
74 return; 74 return;
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
85 m_log.Info("[IRC] module not configured"); 85 m_log.Info("[IRC] module not configured");
86 return; 86 return;
87 } 87 }
88 88
89 lock (m_syncInit) 89 lock (m_syncInit)
90 { 90 {
91 91
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
118 m_irc_connector.Name = "IRCConnectorThread"; 118 m_irc_connector.Name = "IRCConnectorThread";
119 m_irc_connector.IsBackground = true; 119 m_irc_connector.IsBackground = true;
120 } 120 }
121 m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName, 121 m_log.InfoFormat("[IRC] initialized for {0}, nick: {1} ", scene.RegionInfo.RegionName,
122 m_defaultzone); 122 m_defaultzone);
123 } 123 }
124 } 124 }
@@ -221,9 +221,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
221 221
222 if (e.Message.StartsWith("/me ") && (null != avatar)) 222 if (e.Message.StartsWith("/me ") && (null != avatar))
223 e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4)); 223 e.Message = String.Format("{0} {1}", fromName, e.Message.Substring(4));
224 224
225 // this is to keep objects from talking to IRC 225 // this is to keep objects from talking to IRC
226 if (m_irc.Connected && (avatar != null)) 226 if (m_irc.Connected && (avatar != null))
227 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message); 227 m_irc.PrivMsg(fromName, scene.RegionInfo.RegionName, e.Message);
228 } 228 }
229 229
@@ -244,7 +244,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
244 if ((m_irc.Enabled) && (m_irc.Connected)) 244 if ((m_irc.Enabled) && (m_irc.Connected))
245 { 245 {
246 m_log.DebugFormat("[IRC] {0} logging on", clientName); 246 m_log.DebugFormat("[IRC] {0} logging on", clientName);
247 m_irc.PrivMsg(m_irc.Nick, "Sim", 247 m_irc.PrivMsg(m_irc.Nick, "Sim",
248 String.Format("notices {0} logging on", clientName)); 248 String.Format("notices {0} logging on", clientName));
249 } 249 }
250 m_last_new_user = clientName; 250 m_last_new_user = clientName;
@@ -310,7 +310,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
310 m_log.InfoFormat("[IRC]: {0} logging out", clientName); 310 m_log.InfoFormat("[IRC]: {0} logging out", clientName);
311 } 311 }
312 312
313 if (m_last_new_user == clientName) 313 if (m_last_new_user == clientName)
314 m_last_new_user = null; 314 m_last_new_user = null;
315 } 315 }
316 } 316 }
@@ -489,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
489 } 489 }
490 catch (Exception e) 490 catch (Exception e)
491 { 491 {
492 m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}", 492 m_log.ErrorFormat("[IRC] cannot connect to {0}:{1}: {2}",
493 m_server, m_port, e.Message); 493 m_server, m_port, e.Message);
494 } 494 }
495 return m_connected; 495 return m_connected;
@@ -617,16 +617,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
617 617
618 // is message "\001ACTION foo 618 // is message "\001ACTION foo
619 // bar\001"? -> "/me foo bar" 619 // bar\001"? -> "/me foo bar"
620 if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION")) 620 if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION"))
621 c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9)); 621 c.Message = String.Format("/me {0}", c.Message.Substring(8, c.Message.Length - 9));
622 622
623 foreach (Scene scene in m_scenes) 623 foreach (Scene scene in m_scenes)
624 { 624 {
625 c.Scene = scene; 625 c.Scene = scene;
626 scene.EventManager.TriggerOnChatBroadcast(this, c); 626 scene.EventManager.TriggerOnChatBroadcast(this, c);
627 } 627 }
628 } 628 }
629 629
630 Thread.Sleep(150); 630 Thread.Sleep(150);
631 continue; 631 continue;
632 } 632 }