[Opensim-dev] Loadable modules and Scripting extensions

Rob Smart rob.s.smart at gmail.com
Mon Feb 2 01:27:18 UTC 2009


Hi All,

A fairly lengthy description follows of why we cant currently create
loadable Modules that provide extra script functions...

I currently have an Opensim publish subscribe module that exposes its
functionality through new scripting commands osPublish and osSubscribe,
unfortunately i cannot release it into the main OpenSim project yet for
licensing reasons. I'd managed to
develop the module without having to alter any existing code from the main
OpenSim codebase, but i still had to merge changes in the prebuild file
every time i synched with SVN.

Tonight I finally got round to attempting to separate it out from the main
OpenSim codebase into a dll module of its own, all was going well until I
got to the point of testing and found that my scripting methods
(osPublish,osSubscribe) were no longer being recognised when the scripts
were compiled in world.

I poked around a bit and found that the ApiManager class only search within
the active dll assembly for API classes, I altered this so that it searched
all assemblies. At this point it was finding my API interface and
successfully initing it. However once
again the osPublish,osSubscribe methods were not found when compiling a test
script in world.

More tracing and I found that the Compiler.cs class has hard coded
references to two ScriptEngine dlls

parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
                    "OpenSim.Region.ScriptEngine.Shared.dll"));
parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
                    "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll"));


I temporarily added a reference to my module DLL so that it was on the
compile path for scripts (not sure how to get round this yet)

at this time i now get...

The imported type
`OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass' is defined
multiple times

Because ScriptBaseClass is made up of several partial classes...
i.e.  OSSL_Stub.cs, LSL_Stub.cs

I discovered that partial classes cannot be spread across DLLs, so currently
we have a limitation that prevents us producing loadable modules that
provide extra script functions.

My opinion is that this is a fairly major restriction in the module system,
well... actually its a limitation of the script engine...

Any ideas on a solution to this ? hoping for an easy solution, but my
suspicion is it may involve some re-architecting.

cheers,
Rob Smart
(Yossarian Seattle)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20090202/626d5764/attachment-0001.html>


More information about the Opensim-dev mailing list