aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-20 18:38:20 +0000
committerJeff Ames2008-02-20 18:38:20 +0000
commita8cfbbe963529728acbab4d9936cb89af380d1ac (patch)
tree16a72fba3d15556f6702127e7cfb98aa9fb9cf81 /OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
parentFix exception when reading OpenSim.ini file. (diff)
downloadopensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.zip
opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.gz
opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.bz2
opensim-SC_OLD-a8cfbbe963529728acbab4d9936cb89af380d1ac.tar.xz
Minor cleanup.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs52
1 files changed, 21 insertions, 31 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 1ab2a43..b91751d 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -13,7 +13,7 @@
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
@@ -48,7 +48,7 @@ namespace OpenSim.Region.ScriptEngine.Common
48 /// </summary> 48 /// </summary>
49 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface 49 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
50 { 50 {
51 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 51 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
52 52
53 private ASCIIEncoding enc = new ASCIIEncoding(); 53 private ASCIIEncoding enc = new ASCIIEncoding();
54 private ScriptEngineBase.ScriptEngine m_ScriptEngine; 54 private ScriptEngineBase.ScriptEngine m_ScriptEngine;
@@ -3393,40 +3393,28 @@ namespace OpenSim.Region.ScriptEngine.Common
3393 { 3393 {
3394 case LSL_BaseClass.LIST_STAT_RANGE: 3394 case LSL_BaseClass.LIST_STAT_RANGE:
3395 return nums.Range(); 3395 return nums.Range();
3396 break;
3397 case LSL_BaseClass.LIST_STAT_MIN: 3396 case LSL_BaseClass.LIST_STAT_MIN:
3398 return nums.Min(); 3397 return nums.Min();
3399 break;
3400 case LSL_BaseClass.LIST_STAT_MAX: 3398 case LSL_BaseClass.LIST_STAT_MAX:
3401 return nums.Max(); 3399 return nums.Max();
3402 break;
3403 case LSL_BaseClass.LIST_STAT_MEAN: 3400 case LSL_BaseClass.LIST_STAT_MEAN:
3404 return nums.Mean(); 3401 return nums.Mean();
3405 break;
3406 case LSL_BaseClass.LIST_STAT_MEDIAN: 3402 case LSL_BaseClass.LIST_STAT_MEDIAN:
3407 return nums.Median(); 3403 return nums.Median();
3408 break;
3409 case LSL_BaseClass.LIST_STAT_NUM_COUNT: 3404 case LSL_BaseClass.LIST_STAT_NUM_COUNT:
3410 return nums.NumericLength(); 3405 return nums.NumericLength();
3411 break;
3412 case LSL_BaseClass.LIST_STAT_STD_DEV: 3406 case LSL_BaseClass.LIST_STAT_STD_DEV:
3413 return nums.StdDev(); 3407 return nums.StdDev();
3414 break;
3415 case LSL_BaseClass.LIST_STAT_SUM: 3408 case LSL_BaseClass.LIST_STAT_SUM:
3416 return nums.Sum(); 3409 return nums.Sum();
3417 break;
3418 case LSL_BaseClass.LIST_STAT_SUM_SQUARES: 3410 case LSL_BaseClass.LIST_STAT_SUM_SQUARES:
3419 return nums.SumSqrs(); 3411 return nums.SumSqrs();
3420 break;
3421 case LSL_BaseClass.LIST_STAT_GEOMETRIC_MEAN: 3412 case LSL_BaseClass.LIST_STAT_GEOMETRIC_MEAN:
3422 return nums.GeometricMean(); 3413 return nums.GeometricMean();
3423 break;
3424 case LSL_BaseClass.LIST_STAT_HARMONIC_MEAN: 3414 case LSL_BaseClass.LIST_STAT_HARMONIC_MEAN:
3425 return nums.HarmonicMean(); 3415 return nums.HarmonicMean();
3426 break;
3427 default: 3416 default:
3428 return 0.0; 3417 return 0.0;
3429 break;
3430 } 3418 }
3431 } 3419 }
3432 3420
@@ -3676,28 +3664,30 @@ namespace OpenSim.Region.ScriptEngine.Common
3676 return LLUUID.Zero.ToString(); 3664 return LLUUID.Zero.ToString();
3677 } 3665 }
3678 3666
3679 public bool osConsoleCommand(string Command) 3667 public bool osConsoleCommand(string command)
3680 { 3668 {
3681 m_host.AddScriptLPS(1); 3669 m_host.AddScriptLPS(1);
3682 Nini.Config.IConfigSource config = new Nini.Config.IniConfigSource(Application.iniFilePath); 3670 Nini.Config.IConfigSource config = new Nini.Config.IniConfigSource(Application.iniFilePath);
3683 if (config.Configs["LL-Functions"] == null) 3671 if (config.Configs["LL-Functions"] == null)
3684 config.AddConfig("LL-Functions"); 3672 config.AddConfig("LL-Functions");
3685 3673
3686 if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false)) { 3674 if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false))
3687 if (World.PermissionsMngr.CanRunConsoleCommand(m_host.OwnerID)) { 3675 {
3688 OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command); 3676 if (World.PermissionsMngr.CanRunConsoleCommand(m_host.OwnerID))
3689 return true; 3677 {
3690 } 3678 OpenSim.Framework.Console.MainConsole.Instance.RunCommand(command);
3691 return false; 3679 return true;
3692 } 3680 }
3693 return false; 3681 return false;
3694 } 3682 }
3683 return false;
3684 }
3695 3685
3696 private void NotImplemented(string Command) 3686 private void NotImplemented(string command)
3697 { 3687 {
3698 m_host.AddScriptLPS(1); 3688 m_host.AddScriptLPS(1);
3699 if (throwErrorOnNotImplemented) 3689 if (throwErrorOnNotImplemented)
3700 throw new NotImplementedException("Command not implemented: " + Command); 3690 throw new NotImplementedException("Command not implemented: " + command);
3701 } 3691 }
3702 3692
3703 private void LSLError(string msg) 3693 private void LSLError(string msg)