Hi, unfortunately, there is currently no solution. For script functions to be callable without class.member notation, they have to be all in one class and the script must inherit from it. C# scripting overcomes that, but extending OSSL/LSL with external DLLs is not possible. In order to keep the API set consistent, I didn't attempt to create a module loader system for c# only, although it would be trivial.
Melanie Rob Smart wrote: > 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) > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Opensim-dev mailing list > [email protected] > https://lists.berlios.de/mailman/listinfo/opensim-dev _______________________________________________ Opensim-dev mailing list [email protected] https://lists.berlios.de/mailman/listinfo/opensim-dev
