aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorTalun2012-04-09 19:58:07 +0100
committerMelanie2012-04-09 21:25:22 +0100
commit78c0028179923710949fea349baad2e6bebc49bd (patch)
treead83b28069f46f0890cae3f9405f3d4c5f273da8 /OpenSim/Region/ScriptEngine/Shared
parentAddresses mantis #5846 (diff)
downloadopensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.zip
opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.gz
opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.bz2
opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.xz
Mantis5502 implementation of some of the new constants
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs42
1 files changed, 24 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 291f52e..c38a52e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10358,19 +10358,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10358 break; 10358 break;
10359 // For the following 8 see the Object version below 10359 // For the following 8 see the Object version below
10360 case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: 10360 case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT:
10361 ret.Add(new LSL_Integer(0)); 10361 ret.Add(new LSL_Integer(av.RunningScriptCount()));
10362 break; 10362 break;
10363 case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: 10363 case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT:
10364 ret.Add(new LSL_Integer(0)); 10364 ret.Add(new LSL_Integer(av.ScriptCount()));
10365 break; 10365 break;
10366 case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: 10366 case ScriptBaseClass.OBJECT_SCRIPT_MEMORY:
10367 ret.Add(new LSL_Integer(0)); 10367 ret.Add(new LSL_Integer(av.RunningScriptCount() * 16384));
10368 break; 10368 break;
10369 case ScriptBaseClass.OBJECT_SCRIPT_TIME: 10369 case ScriptBaseClass.OBJECT_SCRIPT_TIME:
10370 ret.Add(new LSL_Float(0)); 10370 ret.Add(new LSL_Float(0));
10371 break; 10371 break;
10372 case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: 10372 case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE:
10373 ret.Add(new LSL_Integer(0)); 10373 ret.Add(new LSL_Integer(1));
10374 break; 10374 break;
10375 case ScriptBaseClass.OBJECT_SERVER_COST: 10375 case ScriptBaseClass.OBJECT_SERVER_COST:
10376 ret.Add(new LSL_Float(0)); 10376 ret.Add(new LSL_Float(0));
@@ -10422,24 +10422,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10422 case ScriptBaseClass.OBJECT_CREATOR: 10422 case ScriptBaseClass.OBJECT_CREATOR:
10423 ret.Add(new LSL_String(obj.CreatorID.ToString())); 10423 ret.Add(new LSL_String(obj.CreatorID.ToString()));
10424 break; 10424 break;
10425 // The following 8 I have intentionaly coded to return zero. They are part of
10426 // "Land Impact" calculations. These calculations are probably not applicable
10427 // to OpenSim, required figures (cpu/memory usage) are not currently tracked
10428 // I have intentionally left these all at zero rather than return possibly
10429 // missleading numbers
10430 case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: 10425 case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT:
10431 // in SL this currently includes crashed scripts 10426 ret.Add(new LSL_Integer(obj.ParentGroup.RunningScriptCount()));
10432 ret.Add(new LSL_Integer(0));
10433 break; 10427 break;
10434 case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: 10428 case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT:
10435 ret.Add(new LSL_Integer(0)); 10429 ret.Add(new LSL_Integer(obj.ParentGroup.ScriptCount()));
10436 break; 10430 break;
10437 case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: 10431 case ScriptBaseClass.OBJECT_SCRIPT_MEMORY:
10438 // The value returned in SL for mono scripts is 65536 * number of active scripts 10432 // The value returned in SL for mono scripts is 65536 * number of active scripts
10439 ret.Add(new LSL_Integer(0)); 10433 // and 16384 * number of active scripts for LSO. since llGetFreememory
10434 // is coded to give the LSO value use it here
10435 ret.Add(new LSL_Integer(obj.ParentGroup.RunningScriptCount() * 16384));
10440 break; 10436 break;
10441 case ScriptBaseClass.OBJECT_SCRIPT_TIME: 10437 case ScriptBaseClass.OBJECT_SCRIPT_TIME:
10442 // Average cpu time per simulator frame expended on all scripts in the objetc 10438 // Average cpu time per simulator frame expended on all scripts in the object
10439 // Not currently available at Object level
10443 ret.Add(new LSL_Float(0)); 10440 ret.Add(new LSL_Float(0));
10444 break; 10441 break;
10445 case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: 10442 case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE:
@@ -10447,18 +10444,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10447 // equivalent of the number of prims in a linkset if it does not 10444 // equivalent of the number of prims in a linkset if it does not
10448 // contain a mesh anywhere in the link set or is not a normal prim 10445 // contain a mesh anywhere in the link set or is not a normal prim
10449 // The value returned in SL for normal prims is prim count 10446 // The value returned in SL for normal prims is prim count
10450 ret.Add(new LSL_Integer(0)); 10447 ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount));
10451 break; 10448 break;
10449 // The following 3 costs I have intentionaly coded to return zero. They are part of
10450 // "Land Impact" calculations. These calculations are probably not applicable
10451 // to OpenSim and are not yet complete in SL
10452 case ScriptBaseClass.OBJECT_SERVER_COST: 10452 case ScriptBaseClass.OBJECT_SERVER_COST:
10453 // The value returned in SL for normal prims is prim count 10453 // The linden calculation is here
10454 // http://wiki.secondlife.com/wiki/Mesh/Mesh_Server_Weight
10455 // The value returned in SL for normal prims looks like the prim count
10454 ret.Add(new LSL_Float(0)); 10456 ret.Add(new LSL_Float(0));
10455 break; 10457 break;
10456 case ScriptBaseClass.OBJECT_STREAMING_COST: 10458 case ScriptBaseClass.OBJECT_STREAMING_COST:
10457 // The value returned in SL for normal prims is prim count * 0.06 10459 // The linden calculation is here
10460 // http://wiki.secondlife.com/wiki/Mesh/Mesh_Streaming_Cost
10461 // The value returned in SL for normal prims looks like the prim count * 0.06
10458 ret.Add(new LSL_Float(0)); 10462 ret.Add(new LSL_Float(0));
10459 break; 10463 break;
10460 case ScriptBaseClass.OBJECT_PHYSICS_COST: 10464 case ScriptBaseClass.OBJECT_PHYSICS_COST:
10461 // The value returned in SL for normal prims is prim count 10465 // The linden calculation is here
10466 // http://wiki.secondlife.com/wiki/Mesh/Mesh_physics
10467 // The value returned in SL for normal prims looks like the prim count
10462 ret.Add(new LSL_Float(0)); 10468 ret.Add(new LSL_Float(0));
10463 break; 10469 break;
10464 default: 10470 default: