diff options
author | Talun | 2012-04-24 21:54:13 +0100 |
---|---|---|
committer | BlueWall | 2012-04-26 16:13:29 -0400 |
commit | b8114d2b67c8ae8d7551a2ece2177f8b7e958112 (patch) | |
tree | 0b453a72beae6e4a1f9ee86f00df3ec77d12d178 /OpenSim/Region/ScriptEngine/Shared | |
parent | Mantis 5977 Corrections to llRegionSayTo (diff) | |
download | opensim-SC_OLD-b8114d2b67c8ae8d7551a2ece2177f8b7e958112.zip opensim-SC_OLD-b8114d2b67c8ae8d7551a2ece2177f8b7e958112.tar.gz opensim-SC_OLD-b8114d2b67c8ae8d7551a2ece2177f8b7e958112.tar.bz2 opensim-SC_OLD-b8114d2b67c8ae8d7551a2ece2177f8b7e958112.tar.xz |
Add a version of osNpcSay that takes a channel number Mantis 5747
osNpcSay(UUID npc, string message) left untouched
New functions:-
osNpcSay(UUID npc, int channel, string message)
osNpcShout(UUID npc, int channel, string message)
osNpcWhisper(UUID npc, int channel, string message)
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
Diffstat (limited to '')
3 files changed, 59 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fe94b79..890115d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2531,6 +2531,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2531 | 2531 | ||
2532 | public void osNpcSay(LSL_Key npc, string message) | 2532 | public void osNpcSay(LSL_Key npc, string message) |
2533 | { | 2533 | { |
2534 | osNpcSay(npc, 0, message); | ||
2535 | } | ||
2536 | |||
2537 | public void osNpcSay(LSL_Key npc, int channel, string message) | ||
2538 | { | ||
2534 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); | 2539 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); |
2535 | m_host.AddScriptLPS(1); | 2540 | m_host.AddScriptLPS(1); |
2536 | 2541 | ||
@@ -2542,7 +2547,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2542 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | 2547 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) |
2543 | return; | 2548 | return; |
2544 | 2549 | ||
2545 | module.Say(npcId, World, message); | 2550 | module.Say(npcId, World, message, channel); |
2551 | } | ||
2552 | } | ||
2553 | |||
2554 | public void osNpcShout(LSL_Key npc, int channel, string message) | ||
2555 | { | ||
2556 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | ||
2557 | m_host.AddScriptLPS(1); | ||
2558 | |||
2559 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2560 | if (module != null) | ||
2561 | { | ||
2562 | UUID npcId = new UUID(npc.m_string); | ||
2563 | |||
2564 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2565 | return; | ||
2566 | |||
2567 | module.Shout(npcId, World, message, channel); | ||
2546 | } | 2568 | } |
2547 | } | 2569 | } |
2548 | 2570 | ||
@@ -2627,6 +2649,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2627 | } | 2649 | } |
2628 | } | 2650 | } |
2629 | 2651 | ||
2652 | public void osNpcWhisper(LSL_Key npc, int channel, string message) | ||
2653 | { | ||
2654 | CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); | ||
2655 | m_host.AddScriptLPS(1); | ||
2656 | |||
2657 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2658 | if (module != null) | ||
2659 | { | ||
2660 | UUID npcId = new UUID(npc.m_string); | ||
2661 | |||
2662 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2663 | return; | ||
2664 | |||
2665 | module.Whisper(npcId, World, message, channel); | ||
2666 | } | ||
2667 | } | ||
2668 | |||
2630 | /// <summary> | 2669 | /// <summary> |
2631 | /// Save the current appearance of the script owner permanently to the named notecard. | 2670 | /// Save the current appearance of the script owner permanently to the named notecard. |
2632 | /// </summary> | 2671 | /// </summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 545bbee..2d3e8e8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -203,11 +203,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
203 | void osNpcSetRot(LSL_Key npc, rotation rot); | 203 | void osNpcSetRot(LSL_Key npc, rotation rot); |
204 | void osNpcStopMoveToTarget(LSL_Key npc); | 204 | void osNpcStopMoveToTarget(LSL_Key npc); |
205 | void osNpcSay(key npc, string message); | 205 | void osNpcSay(key npc, string message); |
206 | void osNpcSay(key npc, int channel, string message); | ||
207 | void osNpcShout(key npc, int channel, string message); | ||
206 | void osNpcSit(key npc, key target, int options); | 208 | void osNpcSit(key npc, key target, int options); |
207 | void osNpcStand(LSL_Key npc); | 209 | void osNpcStand(LSL_Key npc); |
208 | void osNpcRemove(key npc); | 210 | void osNpcRemove(key npc); |
209 | void osNpcPlayAnimation(LSL_Key npc, string animation); | 211 | void osNpcPlayAnimation(LSL_Key npc, string animation); |
210 | void osNpcStopAnimation(LSL_Key npc, string animation); | 212 | void osNpcStopAnimation(LSL_Key npc, string animation); |
213 | void osNpcWhisper(key npc, int channel, string message); | ||
211 | 214 | ||
212 | LSL_Key osOwnerSaveAppearance(string notecard); | 215 | LSL_Key osOwnerSaveAppearance(string notecard); |
213 | LSL_Key osAgentSaveAppearance(key agentId, string notecard); | 216 | LSL_Key osAgentSaveAppearance(key agentId, string notecard); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index b94b9bf..e836959 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -569,6 +569,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
569 | m_OSSL_Functions.osNpcSay(npc, message); | 569 | m_OSSL_Functions.osNpcSay(npc, message); |
570 | } | 570 | } |
571 | 571 | ||
572 | public void osNpcSay(key npc, int channel, string message) | ||
573 | { | ||
574 | m_OSSL_Functions.osNpcSay(npc, channel, message); | ||
575 | } | ||
576 | |||
577 | |||
578 | public void osNpcShout(key npc, int channel, string message) | ||
579 | { | ||
580 | m_OSSL_Functions.osNpcShout(npc, channel, message); | ||
581 | } | ||
582 | |||
572 | public void osNpcSit(LSL_Key npc, LSL_Key target, int options) | 583 | public void osNpcSit(LSL_Key npc, LSL_Key target, int options) |
573 | { | 584 | { |
574 | m_OSSL_Functions.osNpcSit(npc, target, options); | 585 | m_OSSL_Functions.osNpcSit(npc, target, options); |
@@ -594,6 +605,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
594 | m_OSSL_Functions.osNpcStopAnimation(npc, animation); | 605 | m_OSSL_Functions.osNpcStopAnimation(npc, animation); |
595 | } | 606 | } |
596 | 607 | ||
608 | public void osNpcWhisper(key npc, int channel, string message) | ||
609 | { | ||
610 | m_OSSL_Functions.osNpcWhisper(npc, channel, message); | ||
611 | } | ||
612 | |||
597 | public LSL_Key osOwnerSaveAppearance(string notecard) | 613 | public LSL_Key osOwnerSaveAppearance(string notecard) |
598 | { | 614 | { |
599 | return m_OSSL_Functions.osOwnerSaveAppearance(notecard); | 615 | return m_OSSL_Functions.osOwnerSaveAppearance(notecard); |