I have moved most of the code from OpenSim.Region.ScriptEngine.DotNetEngine to OpenSim.Region.ScriptEngine.Common.
Right now we have only one ScriptEngine, and its purpose is to emulate a Second Life script engine by executing scripts put into prims. But in the future I expect different kinds of script engines such as controllers that manipulate in-world game rules or objects from a .dll that has nothing to do with prim scripts.
Therefore I moved parts of DotNetEngine into Common so that Common is an execution framework.
DotNetEngine now does LSL->C# convert and compile. But does not do anything else. It simply hands the compiled .dll back to Common when its done. Then Common does the actual execution of script.
What do I get for free?
1. Loading/unloading of scripts are queued and executed in sequence. Only one load/unload at the time.
2. What script belongs to what object is automatically taken care of. You just need to provide the scripts classes – nothing else.
3. OpenSim events are translated and given to you as LSL events. Your script functions are executed automatically, no need to hook up to events or anything.If you want to implement your own event handlers, feel free to do so. Look in “OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.EventManager.cs” how its done. Your own events can run together with LSL events without any problem.
4. Whenever an event is executed, the execution is queued. Only one event per script is ever executed simultaneous. But multithreading is used to run multiple scripts in parallel.
5. Errors during script execution is automatically handled and relayed to users in-world.
6. You get all LSL commands in an easy to use object, no need to keep track of scene or objects to execute functions. Running an LSL command from your script engine is as easy as running it from inside any LSL-script.
7. Long LSL-commands that returns with an event is also handled.