OpenSim.Region.ScriptEngine.DotNetEngine

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 19: Line 19:
 
  Event such as touch_start is received in EventManager and translated to LSL-compatible request before being sent to EventQueueManager.
 
  Event such as touch_start is received in EventManager and translated to LSL-compatible request before being sent to EventQueueManager.
 
Note! If event is for a particular object, EventQueueManager will queue event for all scripts inside that object.<br />
 
Note! If event is for a particular object, EventQueueManager will queue event for all scripts inside that object.<br />
5. If script is LSL (LSO ByteCode [http://libsecondlife.org/wiki/LSO]) then OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL is used to translate the bytecode from LSO to .Net Assembly.<br />
+
5. If script is LSL then OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL is used to compile the script to .Net Assembly.<br />
6. On script load, give script a private copy of XXX that it will use to access server. These are commonly know as ll-functions.<br />
+
6. EventQueueManager has a separate thread running to process its event queue. Events are actually functions inside the script .dll that is called "<state>_event_<event_name>" for example "default_event_touch_start". State is read from a global variable in the script .dll.<br />
7. EventQueueManager has a separate thread running to process its event queue. Events are actually functions inside the script .dll that is called "<state>_event_<event_name>" for example "0_event_touch_start". State is read from a global variable in the script .dll.<br />
+
  
 
----
 
----
 
===Places to extend script support===
 
===Places to extend script support===
* XXX.cs
+
* LSL_BaseClass.cs
 
These are the functions script can use to manipulate the scene. Commonly known as ll-functions. They are LSL functions such as llSay, llWhisper, etc.
 
These are the functions script can use to manipulate the scene. Commonly known as ll-functions. They are LSL functions such as llSay, llWhisper, etc.
 
* EventManager.cs
 
* EventManager.cs
 
This is where events are coming from server and being queued for scripts. All 16 or so LSL events needs to be implemented here.
 
This is where events are coming from server and being queued for scripts. All 16 or so LSL events needs to be implemented here.
 +
 +
 +
[[Image:ScriptEngineLayout.jpg]]

Revision as of 09:19, 17 August 2007

DotNetEngine

Namespace: OpenSim.Region.ScriptEngine.DotNetEngine

DotNetEngine is a ScriptEngine that executes LSL scripts contained within objects.
Core development blog: [1]


How it works

1. Create instance of ScriptEngine(scene).
2. ScriptEngine will create instances of:

EventManager
EventQueueManager
ScriptManager

3. EventManager will hook up all necessary events (all possible script events, script rez, script derez, etc).
4. When events are received, they are processed inside EventManager.

For example:
Event for loading a script will be processed and EventManager will tell ScriptManager to load the script.
Event such as touch_start is received in EventManager and translated to LSL-compatible request before being sent to EventQueueManager.

Note! If event is for a particular object, EventQueueManager will queue event for all scripts inside that object.
5. If script is LSL then OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL is used to compile the script to .Net Assembly.
6. EventQueueManager has a separate thread running to process its event queue. Events are actually functions inside the script .dll that is called "<state>_event_<event_name>" for example "default_event_touch_start". State is read from a global variable in the script .dll.


Places to extend script support

  • LSL_BaseClass.cs

These are the functions script can use to manipulate the scene. Commonly known as ll-functions. They are LSL functions such as llSay, llWhisper, etc.

  • EventManager.cs

This is where events are coming from server and being queued for scripts. All 16 or so LSL events needs to be implemented here.


File:ScriptEngineLayout.jpg

Personal tools
General
About This Wiki