diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 42 |
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 e71f027..76106a0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -11167,19 +11167,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11167 | break; | 11167 | break; |
11168 | // For the following 8 see the Object version below | 11168 | // For the following 8 see the Object version below |
11169 | case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: | 11169 | case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: |
11170 | ret.Add(new LSL_Integer(0)); | 11170 | ret.Add(new LSL_Integer(av.RunningScriptCount())); |
11171 | break; | 11171 | break; |
11172 | case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: | 11172 | case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: |
11173 | ret.Add(new LSL_Integer(0)); | 11173 | ret.Add(new LSL_Integer(av.ScriptCount())); |
11174 | break; | 11174 | break; |
11175 | case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: | 11175 | case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: |
11176 | ret.Add(new LSL_Integer(0)); | 11176 | ret.Add(new LSL_Integer(av.RunningScriptCount() * 16384)); |
11177 | break; | 11177 | break; |
11178 | case ScriptBaseClass.OBJECT_SCRIPT_TIME: | 11178 | case ScriptBaseClass.OBJECT_SCRIPT_TIME: |
11179 | ret.Add(new LSL_Float(0)); | 11179 | ret.Add(new LSL_Float(0)); |
11180 | break; | 11180 | break; |
11181 | case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: | 11181 | case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: |
11182 | ret.Add(new LSL_Integer(0)); | 11182 | ret.Add(new LSL_Integer(1)); |
11183 | break; | 11183 | break; |
11184 | case ScriptBaseClass.OBJECT_SERVER_COST: | 11184 | case ScriptBaseClass.OBJECT_SERVER_COST: |
11185 | ret.Add(new LSL_Float(0)); | 11185 | ret.Add(new LSL_Float(0)); |
@@ -11231,24 +11231,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11231 | case ScriptBaseClass.OBJECT_CREATOR: | 11231 | case ScriptBaseClass.OBJECT_CREATOR: |
11232 | ret.Add(new LSL_String(obj.CreatorID.ToString())); | 11232 | ret.Add(new LSL_String(obj.CreatorID.ToString())); |
11233 | break; | 11233 | break; |
11234 | // The following 8 I have intentionaly coded to return zero. They are part of | ||
11235 | // "Land Impact" calculations. These calculations are probably not applicable | ||
11236 | // to OpenSim, required figures (cpu/memory usage) are not currently tracked | ||
11237 | // I have intentionally left these all at zero rather than return possibly | ||
11238 | // missleading numbers | ||
11239 | case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: | 11234 | case ScriptBaseClass.OBJECT_RUNNING_SCRIPT_COUNT: |
11240 | // in SL this currently includes crashed scripts | 11235 | ret.Add(new LSL_Integer(obj.ParentGroup.RunningScriptCount())); |
11241 | ret.Add(new LSL_Integer(0)); | ||
11242 | break; | 11236 | break; |
11243 | case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: | 11237 | case ScriptBaseClass.OBJECT_TOTAL_SCRIPT_COUNT: |
11244 | ret.Add(new LSL_Integer(0)); | 11238 | ret.Add(new LSL_Integer(obj.ParentGroup.ScriptCount())); |
11245 | break; | 11239 | break; |
11246 | case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: | 11240 | case ScriptBaseClass.OBJECT_SCRIPT_MEMORY: |
11247 | // The value returned in SL for mono scripts is 65536 * number of active scripts | 11241 | // The value returned in SL for mono scripts is 65536 * number of active scripts |
11248 | ret.Add(new LSL_Integer(0)); | 11242 | // and 16384 * number of active scripts for LSO. since llGetFreememory |
11243 | // is coded to give the LSO value use it here | ||
11244 | ret.Add(new LSL_Integer(obj.ParentGroup.RunningScriptCount() * 16384)); | ||
11249 | break; | 11245 | break; |
11250 | case ScriptBaseClass.OBJECT_SCRIPT_TIME: | 11246 | case ScriptBaseClass.OBJECT_SCRIPT_TIME: |
11251 | // Average cpu time per simulator frame expended on all scripts in the objetc | 11247 | // Average cpu time per simulator frame expended on all scripts in the object |
11248 | // Not currently available at Object level | ||
11252 | ret.Add(new LSL_Float(0)); | 11249 | ret.Add(new LSL_Float(0)); |
11253 | break; | 11250 | break; |
11254 | case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: | 11251 | case ScriptBaseClass.OBJECT_PRIM_EQUIVALENCE: |
@@ -11256,18 +11253,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11256 | // equivalent of the number of prims in a linkset if it does not | 11253 | // equivalent of the number of prims in a linkset if it does not |
11257 | // contain a mesh anywhere in the link set or is not a normal prim | 11254 | // contain a mesh anywhere in the link set or is not a normal prim |
11258 | // The value returned in SL for normal prims is prim count | 11255 | // The value returned in SL for normal prims is prim count |
11259 | ret.Add(new LSL_Integer(0)); | 11256 | ret.Add(new LSL_Integer(obj.ParentGroup.PrimCount)); |
11260 | break; | 11257 | break; |
11258 | // The following 3 costs I have intentionaly coded to return zero. They are part of | ||
11259 | // "Land Impact" calculations. These calculations are probably not applicable | ||
11260 | // to OpenSim and are not yet complete in SL | ||
11261 | case ScriptBaseClass.OBJECT_SERVER_COST: | 11261 | case ScriptBaseClass.OBJECT_SERVER_COST: |
11262 | // The value returned in SL for normal prims is prim count | 11262 | // The linden calculation is here |
11263 | // http://wiki.secondlife.com/wiki/Mesh/Mesh_Server_Weight | ||
11264 | // The value returned in SL for normal prims looks like the prim count | ||
11263 | ret.Add(new LSL_Float(0)); | 11265 | ret.Add(new LSL_Float(0)); |
11264 | break; | 11266 | break; |
11265 | case ScriptBaseClass.OBJECT_STREAMING_COST: | 11267 | case ScriptBaseClass.OBJECT_STREAMING_COST: |
11266 | // The value returned in SL for normal prims is prim count * 0.06 | 11268 | // The linden calculation is here |
11269 | // http://wiki.secondlife.com/wiki/Mesh/Mesh_Streaming_Cost | ||
11270 | // The value returned in SL for normal prims looks like the prim count * 0.06 | ||
11267 | ret.Add(new LSL_Float(0)); | 11271 | ret.Add(new LSL_Float(0)); |
11268 | break; | 11272 | break; |
11269 | case ScriptBaseClass.OBJECT_PHYSICS_COST: | 11273 | case ScriptBaseClass.OBJECT_PHYSICS_COST: |
11270 | // The value returned in SL for normal prims is prim count | 11274 | // The linden calculation is here |
11275 | // http://wiki.secondlife.com/wiki/Mesh/Mesh_physics | ||
11276 | // The value returned in SL for normal prims looks like the prim count | ||
11271 | ret.Add(new LSL_Float(0)); | 11277 | ret.Add(new LSL_Float(0)); |
11272 | break; | 11278 | break; |
11273 | default: | 11279 | default: |