From e6a74344e71941d0d09b1c0bc95501b3171f142d Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 17 Feb 2008 21:15:43 +0000 Subject: [PATCH] Thank you Hashbox for adding the osConsoleCommand Feature to ll-functions. --- OpenSim/Region/Environment/PermissionManager.cs | 4 ++-- OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs | 7 ++++++- .../Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 10 ++++++++++ .../Common/LSL_BuiltIn_Commands_Interface.cs | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index 7805c78c98..36f75d188e 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -74,7 +74,7 @@ namespace OpenSim.Region.Environment m_scene.EventManager.TriggerPermissionError(user, reason); } - protected virtual bool IsAdministrator(LLUUID user) + public virtual bool IsAdministrator(LLUUID user) { if (m_bypassPermissions) { @@ -612,4 +612,4 @@ namespace OpenSim.Region.Environment #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs index e3d0451f66..088b985eda 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs @@ -1865,6 +1865,11 @@ namespace OpenSim.Region.ScriptEngine.Common m_LSL_Functions.osRegionNotice(msg); } + public int osConsoleCommand(string Command) + { + return m_LSL_Functions.osConsoleCommand(Command); + } + public double llList2Float(LSL_Types.list src, int index) { return m_LSL_Functions.llList2Float(src, index); @@ -2203,4 +2208,4 @@ namespace OpenSim.Region.ScriptEngine.Common public rotation ZERO_ROTATION = new rotation(0.0, 0, 0.0, 1.0); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index c350301773..a7d4ecf817 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3676,6 +3676,16 @@ namespace OpenSim.Region.ScriptEngine.Common return LLUUID.Zero.ToString(); } + public int osConsoleCommand(string Command) + { + if (World.PermissionsMngr.IsAdministrator(m_host.OwnerID)) { + OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command); + return 1; + } else { + return 0; + } + } + private void NotImplemented(string Command) { m_host.AddScriptLPS(1); diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs index ba463df765..81478e021e 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands_Interface.cs @@ -641,5 +641,6 @@ namespace OpenSim.Region.ScriptEngine.Common int osTerrainSetHeight(int x, int y, double val); int osRegionRestart(double seconds); void osRegionNotice(string msg); + int osConsoleCommand(string Command); } -} \ No newline at end of file +}