diff options
author | Melanie | 2012-06-28 21:23:42 +0200 |
---|---|---|
committer | Melanie | 2012-06-28 21:23:42 +0200 |
commit | c87f0ac2261d1aa5226957aff63bfc8ac0efaffd (patch) | |
tree | 5a8ac8569730595044c9310a1f5321bff1f5e109 /OpenSim/Region/CoreModules/Scripting | |
parent | Return NPC instead of AGENT in the detect parameters for touch, collision and (diff) | |
download | opensim-SC-c87f0ac2261d1aa5226957aff63bfc8ac0efaffd.zip opensim-SC-c87f0ac2261d1aa5226957aff63bfc8ac0efaffd.tar.gz opensim-SC-c87f0ac2261d1aa5226957aff63bfc8ac0efaffd.tar.bz2 opensim-SC-c87f0ac2261d1aa5226957aff63bfc8ac0efaffd.tar.xz |
Fix llRegionSayTo the right way
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 176c86d..07bb291 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -90,6 +90,8 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
90 | // private static readonly ILog m_log = | 90 | // private static readonly ILog m_log = |
91 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 91 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
92 | 92 | ||
93 | private const int DEBUG_CHANNEL = 2147483647; | ||
94 | |||
93 | private ListenerManager m_listenerManager; | 95 | private ListenerManager m_listenerManager; |
94 | private Queue m_pending; | 96 | private Queue m_pending; |
95 | private Queue m_pendingQ; | 97 | private Queue m_pendingQ; |
@@ -311,6 +313,10 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
311 | public bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error) | 313 | public bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error) |
312 | { | 314 | { |
313 | error = null; | 315 | error = null; |
316 | |||
317 | if (channel == DEBUG_CHANNEL) | ||
318 | return true; | ||
319 | |||
314 | // Is id an avatar? | 320 | // Is id an avatar? |
315 | ScenePresence sp = m_scene.GetScenePresence(target); | 321 | ScenePresence sp = m_scene.GetScenePresence(target); |
316 | 322 | ||
@@ -319,7 +325,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
319 | // Send message to avatar | 325 | // Send message to avatar |
320 | if (channel == 0) | 326 | if (channel == 0) |
321 | { | 327 | { |
322 | m_scene.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Broadcast, 0, pos, name, id, false); | 328 | // Channel 0 goes to viewer ONLY |
329 | m_scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Broadcast, 0, pos, name, id, false, false, target); | ||
330 | return true; | ||
323 | } | 331 | } |
324 | 332 | ||
325 | List<SceneObjectGroup> attachments = sp.GetAttachments(); | 333 | List<SceneObjectGroup> attachments = sp.GetAttachments(); |
@@ -351,12 +359,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
351 | return true; | 359 | return true; |
352 | } | 360 | } |
353 | 361 | ||
354 | // Need to toss an error here | 362 | SceneObjectPart part = m_scene.GetSceneObjectPart(target); |
355 | if (channel == 0) | 363 | if (part == null) // Not even an object |
356 | { | 364 | return true; // No error |
357 | error = "Cannot use llRegionSayTo to message objects on channel 0"; | ||
358 | return false; | ||
359 | } | ||
360 | 365 | ||
361 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | 366 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
362 | { | 367 | { |