diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-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 3f77f38..60568a8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -360,7 +360,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
360 | 360 | ||
361 | UUID ownerID = ti.OwnerID; | 361 | UUID ownerID = ti.OwnerID; |
362 | 362 | ||
363 | //OSSL only may be used if objet is in the same group as the parcel | 363 | //OSSL only may be used if object is in the same group as the parcel |
364 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) | 364 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) |
365 | { | 365 | { |
366 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 366 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
@@ -738,11 +738,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
738 | 738 | ||
739 | m_host.AddScriptLPS(1); | 739 | m_host.AddScriptLPS(1); |
740 | 740 | ||
741 | // For safety, we add another permission check here, and don't rely only on the standard OSSL permissions | ||
741 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 742 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
742 | { | 743 | { |
743 | MainConsole.Instance.RunCommand(command); | 744 | MainConsole.Instance.RunCommand(command); |
744 | return true; | 745 | return true; |
745 | } | 746 | } |
747 | |||
746 | return false; | 748 | return false; |
747 | } | 749 | } |
748 | 750 | ||
@@ -2569,6 +2571,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2569 | 2571 | ||
2570 | public void osNpcSay(LSL_Key npc, string message) | 2572 | public void osNpcSay(LSL_Key npc, string message) |
2571 | { | 2573 | { |
2574 | osNpcSay(npc, 0, message); | ||
2575 | } | ||
2576 | |||
2577 | public void osNpcSay(LSL_Key npc, int channel, string message) | ||
2578 | { | ||
2572 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); | 2579 | CheckThreatLevel(ThreatLevel.High, "osNpcSay"); |
2573 | m_host.AddScriptLPS(1); | 2580 | m_host.AddScriptLPS(1); |
2574 | 2581 | ||
@@ -2580,7 +2587,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2580 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | 2587 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) |
2581 | return; | 2588 | return; |
2582 | 2589 | ||
2583 | module.Say(npcId, World, message); | 2590 | module.Say(npcId, World, message, channel); |
2591 | } | ||
2592 | } | ||
2593 | |||
2594 | public void osNpcShout(LSL_Key npc, int channel, string message) | ||
2595 | { | ||
2596 | CheckThreatLevel(ThreatLevel.High, "osNpcShout"); | ||
2597 | m_host.AddScriptLPS(1); | ||
2598 | |||
2599 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2600 | if (module != null) | ||
2601 | { | ||
2602 | UUID npcId = new UUID(npc.m_string); | ||
2603 | |||
2604 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2605 | return; | ||
2606 | |||
2607 | module.Shout(npcId, World, message, channel); | ||
2584 | } | 2608 | } |
2585 | } | 2609 | } |
2586 | 2610 | ||
@@ -2681,6 +2705,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2681 | } | 2705 | } |
2682 | } | 2706 | } |
2683 | 2707 | ||
2708 | public void osNpcWhisper(LSL_Key npc, int channel, string message) | ||
2709 | { | ||
2710 | CheckThreatLevel(ThreatLevel.High, "osNpcWhisper"); | ||
2711 | m_host.AddScriptLPS(1); | ||
2712 | |||
2713 | INPCModule module = World.RequestModuleInterface<INPCModule>(); | ||
2714 | if (module != null) | ||
2715 | { | ||
2716 | UUID npcId = new UUID(npc.m_string); | ||
2717 | |||
2718 | if (!module.CheckPermissions(npcId, m_host.OwnerID)) | ||
2719 | return; | ||
2720 | |||
2721 | module.Whisper(npcId, World, message, channel); | ||
2722 | } | ||
2723 | } | ||
2724 | |||
2684 | /// <summary> | 2725 | /// <summary> |
2685 | /// Save the current appearance of the script owner permanently to the named notecard. | 2726 | /// Save the current appearance of the script owner permanently to the named notecard. |
2686 | /// </summary> | 2727 | /// </summary> |
@@ -2832,21 +2873,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2832 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 2873 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2833 | m_host.AddScriptLPS(1); | 2874 | m_host.AddScriptLPS(1); |
2834 | 2875 | ||
2835 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 2876 | World.ForEachRootScenePresence(delegate(ScenePresence sp) |
2836 | { | 2877 | { |
2837 | World.ForEachRootScenePresence(delegate(ScenePresence sp) | 2878 | if (sp.Firstname == FirstName && sp.Lastname == SurName) |
2838 | { | 2879 | { |
2839 | if (sp.Firstname == FirstName && sp.Lastname == SurName) | 2880 | // kick client... |
2840 | { | 2881 | if (alert != null) |
2841 | // kick client... | 2882 | sp.ControllingClient.Kick(alert); |
2842 | if (alert != null) | ||
2843 | sp.ControllingClient.Kick(alert); | ||
2844 | 2883 | ||
2845 | // ...and close on our side | 2884 | // ...and close on our side |
2846 | sp.Scene.IncomingCloseAgent(sp.UUID); | 2885 | sp.Scene.IncomingCloseAgent(sp.UUID); |
2847 | } | 2886 | } |
2848 | }); | 2887 | }); |
2849 | } | ||
2850 | } | 2888 | } |
2851 | 2889 | ||
2852 | public void osCauseDamage(string avatar, double damage) | 2890 | public void osCauseDamage(string avatar, double damage) |