Skip to content

XEngine

Serra Royale edited this page Jun 14, 2025 · 1 revision

Summary

This was a fully functional, full-featured script engine that supports persistent script states and script state serialization.

This engine has been replaced by YEngine, and since the move to DotNet8 has been removed from NGC.

For each unique script asset, XEngine will create up to 4 files. These are:

  • CommonCompiler_compiled_.dll, the actual executable DLL for that script asset.
  • On mono, CommonCompiler_compiled_.mdb, the debug data file (necessary for resolving line numbers).
  • On Windows, CommonCompiler_compiled_.pdb, the debug data file (necessary for resolving line numbers).
  • CommonCompiler_source_CommonCompiler_compiled_.cs, if WriteScriptSourceToDebugFile = true in [XEngine] in OpenSim.ini. This is the C# source file as translated from the source language (e.g. from LSL) before compilation.

If scripts contain identical source code then there can be more than one script using the same code. However, they will maintain separate state files to record the script's individual state. These are labelled

  • **.state **

Event Execution

XEngine maintains its own SmartThreadPool to execute script events. The maximum number of threads for this pool (and hence the maximum simultaneous events) is set by [XEngine] MaxThreads. You can also see this information in the "xengine status" command.

When a script event needs to be run (e.g. state_entry, touch_start, etc.), it is placed on the ScriptInstance.EventQueue. If there is no work item event already scheduled, then it is placed as a work item on the threadpool and m_CurrentWorkItem is set.

When a threadpool thread becomes available, it runs the event through the ScriptInstance.EventProcessor() method. At the end of this method, if events are still waiting (i.e. if EventQueue.Count > 0) then another work item is scheduled.

State persistence

XEngine persists state and variable values for individual script instances across region restarts. This is stored in a .state file. When a script is deleted, the .state file is also deleted. For more information on state files, see below.

Clone this wiki locally