XEngine

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Typo correction "never" -> "newer")
Line 130: Line 130:
 
XEngine persists state and variable values across region restarts
 
XEngine persists state and variable values across region restarts
 
  Note: Sim crossings are not yet supported
 
  Note: Sim crossings are not yet supported
 +
 +
 +
 +
[[Category:Modules]]

Revision as of 01:55, 23 November 2010


The XEngine Script Engine

This is a fully functional, full featured script engine which supports persistent script states and script state serialization.

This engine is not enabled by default. To enable it, add the following line to your OpenSim.ini [Startup] section:

DefaultScriptEngine = "XEngine"

You may have a similar line, but referencing the "ScriptEngine.DotNetEngine" there. If so, please comment it, since two script engines can not be run in parallel. Also, newer revisions will have that line already in place, but commented. Simply uncomment it in this case.

At this time, you can delete the compiled scripts from your ScriptEngines directory, because the XEngine uses a different binary format.

The XEngine will create up to 4 files for each script, these are:

.dll, the actual executable file
.mdb, the debug info, if requested
.state, the saved state
.cs, the converted source file, if requested

The XEngine has a number of configuration options in OpenSim.ini, which are listed below, with an explanation and the default values:

WARNING! Do NOT copy the section below to your OpenSim.ini!

Use the template provided in OpenSim.ini.example. The section below contains syntactically incorrect documentation text, which is not meant to be placed in the OpenSim.ini file!

[XEngine]
; Allow the XEngine to run
Enabled = true
   Without this, it won't run at all

; How many threads to keep alive even if nothing is happening
MinThreads = 2
   XEngine will keep at least this many threads waiting

; How many threads to start at maximum load
MaxThreads = 100
   XEngine will not start more than this many scripts, even if that means blocking script execution

; Time a thread must be idle (in seconds) before it dies
IdleTimeout = 60
   Threads will die when they are not used for a while. This is the amount of time they must be'
   idle for that to happen

; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal", "Highest")
Priority = "BelowNormal"
   Script threads will run at this priority

; Maximum number of events to queue for a script (excluding timers)
MaxScriptEventQueue = 300
   Each script has a queue for events. This is the length of the queue, determining the number of
   events that will be queued up before events are dropped

; Stack size per thread created
ThreadStackSize = 262144
   The stack size each script thread runs with. The default also represents the minimum

; Rate to poll for asynchronous command replies (ms)
AsyncLLCommandLoopms = 50
   Interval between polls for asynchronous command results. Smaller values mean better response, but
   also more burned CPU cycles

; Save the source of all compiled scripts
WriteScriptSourceToDebugFile = false
   Create a source file (.cs) on ScriptEngines, containing the preprocessed script

; Default language for scripts
DefaultCompileLanguage = lsl
   The default language to compile

; List of allowed languages (lsl,vb,js,cs)
AllowedCompilers = lsl,vb,js,cs
   The languages to allow for compiling

; Compile debug info (line numbers) into the script assemblies
CompileWithDebugInformation = true
   Create the .mdb debug file, which allows reporting of line numbers in runtime errors

; Allow the use of os* functions (some are dangerous)
AllowOSFunctions = false
   Allow the use if functions in the os* namespace

; Interval (s) between background save of script states
SaveInterval = 120
   Interval for script state persistence save.

; Interval (s) between maintenance runs (0 = disable)
MaintenanceInterval = 10
   Interval in seconds between maintenance runs. The maintenance run checks for long
   running script events and terminates the scripts

; Time a script can spend in an event handler before it is interrupted
EventLimit = 30
   If a script spends more time in a single event handler, it will be interrupted.
   This includes delays produced by llSleep() calls

; If a script overruns it's event limit, kill the script?
KillTimedOutScripts = false
   If a script gets terminated by the above timeout, suspend it pending a recompile?

; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe
OSFunctionThreatLevel = VeryLow
   osFunctions are rated by exploitability. This allows balancing functionality and risk

OS Functions enable/disable

For each function, you can add one line, as shown

; true is the default for all functions, and allows them if below threat level
Allow_osSetRegionWaterHeight = true
   This allows any user to use it, if the threat level permits

or

; false disables the function completely
Allow_osSetRegionWaterHeight = false
   Prevents anyone from using it

or

; Comma separated list of UUIDS allows the function for that list of UUIDS
Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb
   Allows only the listed user(s) to use these functions (unconditionally)

Both engines share the same parser and LSL implementation, so any script that runs on one can be expected to run on the other, with a few notable exceptions:

  • Resetting other scripts (XEngine only)
  • Stopping/starting other scripts (XEngine only)

State persistence

XEngine persists state and variable values across region restarts

Note: Sim crossings are not yet supported
Personal tools
General
About This Wiki