diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 66 |
1 files changed, 52 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7fc7337..0d4ea19 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -351,7 +351,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
351 | 351 | ||
352 | UUID ownerID = ti.OwnerID; | 352 | UUID ownerID = ti.OwnerID; |
353 | 353 | ||
354 | //OSSL only may be used if objet is in the same group as the parcel | 354 | //OSSL only may be used if object is in the same group as the parcel |
355 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) | 355 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) |
356 | { | 356 | { |
357 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 357 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
@@ -729,11 +729,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
729 | 729 | ||
730 | m_host.AddScriptLPS(1); | 730 | m_host.AddScriptLPS(1); |
731 | 731 | ||
732 | // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions | ||
732 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 733 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
733 | { | 734 | { |
734 | MainConsole.Instance.RunCommand(command); | 735 | MainConsole.Instance.RunCommand(command); |
735 | return true; | 736 | return true; |
736 | } | 737 | } |
738 | |||
737 | return false; | 739 | return false; |
738 | } | 740 | } |
739 | 741 | ||
@@ -2539,6 +2541,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2539 | 2541 | ||
2540 | public void osNpcSay(LSL_Key npc, string message) | 2542 | public void osNpcSay(LSL_Key npc, string message) |
2541 | { | 2543 | { |
2544 | osNpcSay(npc, 0, message); | ||
2545 | } | ||
2546 | |||
2547 | public void osNpcSay(LSL_Key npc, int channel, string message) | ||
2548 | { | ||
2542 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); | 2549 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); |
2543 | m_host.AddScriptLPS(1); | 2550 | m_host.AddScriptLPS(1); |
2544 | 2551 | ||
@@ -2550,7 +2557,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2550 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | 2557 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) |
2551 | return; | 2558 | return; |
2552 | 2559 | ||
2553 | module.Say(npcId, World, message); | 2560 | module.Say(npcId, World, message, channel); |
2561 | } | ||
2562 | } | ||
2563 | |||
2564 | public void osNpcShout(LSL_Key npc, int channel, string message) | ||
2565 | { | ||
2566 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | ||
2567 | m_host.AddScriptLPS(1); | ||
2568 | |||
2569 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2570 | if (module != null) | ||
2571 | { | ||
2572 | UUID npcId = new UUID(npc.m_string); | ||
2573 | |||
2574 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2575 | return; | ||
2576 | |||
2577 | module.Shout(npcId, World, message, channel); | ||
2554 | } | 2578 | } |
2555 | } | 2579 | } |
2556 | 2580 | ||
@@ -2635,6 +2659,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2635 | } | 2659 | } |
2636 | } | 2660 | } |
2637 | 2661 | ||
2662 | public void osNpcWhisper(LSL_Key npc, int channel, string message) | ||
2663 | { | ||
2664 | CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); | ||
2665 | m_host.AddScriptLPS(1); | ||
2666 | |||
2667 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2668 | if (module != null) | ||
2669 | { | ||
2670 | UUID npcId = new UUID(npc.m_string); | ||
2671 | |||
2672 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2673 | return; | ||
2674 | |||
2675 | module.Whisper(npcId, World, message, channel); | ||
2676 | } | ||
2677 | } | ||
2678 | |||
2638 | /// <summary> | 2679 | /// <summary> |
2639 | /// Save the current appearance of the script owner permanently to the named notecard. | 2680 | /// Save the current appearance of the script owner permanently to the named notecard. |
2640 | /// </summary> | 2681 | /// </summary> |
@@ -2786,21 +2827,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2786 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 2827 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2787 | m_host.AddScriptLPS(1); | 2828 | m_host.AddScriptLPS(1); |
2788 | 2829 | ||
2789 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 2830 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
2790 | { | 2831 | { |
2791 | World.ForEachRootScenePresence(delegate(ScenePresence sp) | 2832 | if (sp.Firstname == FirstName && sp.Lastname == SurName) |
2792 | { | 2833 | { |
2793 | if (sp.Firstname == FirstName && sp.Lastname == SurName) | 2834 | // kick client... |
2794 | { | 2835 | if (alert != null) |
2795 | // kick client... | 2836 | sp.ControllingClient.Kick(alert); |
2796 | if (alert != null) | ||
2797 | sp.ControllingClient.Kick(alert); | ||
2798 | 2837 | ||
2799 | // ...and close on our side | 2838 | // ...and close on our side |
2800 | sp.Scene.IncomingCloseAgent(sp.UUID); | 2839 | sp.Scene.IncomingCloseAgent(sp.UUID); |
2801 | } | 2840 | } |
2802 | }); | 2841 | }); |
2803 | } | ||
2804 | } | 2842 | } |
2805 | 2843 | ||
2806 | public void osCauseDamage(string avatar, double damage) | 2844 | public void osCauseDamage(string avatar, double damage) |