<!-- begin site header -->
<div id=

Author Topic: Plugins & Multiple languages  (Read 11107 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
Plugins & Multiple languages
« on: January 05, 2011, 04:02:23 pm »
Wall Of Text Warning

I'm currently editing a fork of Mineserver which is aimed at allowing Python to be embedded and used as plugins.

I've come to a point where I want to ask the community and devs how they would like to see this implemented, Here are the options I appear to have so far:

Option 1 - Each language wrapper as a seperate plugin

[MineServer(C++)] -> [Wrapper Plugin(C++)] -> [Script(Other language)]

This method will separate out the scripted language into another plugin. This other plugin will be required to load ALL the python scripts the user wants to run, because we currently cannot pass information to plugins at load time to tell it which ONE python script to load.

Python (And other languages that are made in this manner) are not a build requirement of the server itself, Less bloat and overhead for Admin who will not want Python plugins

No Transparency, The Admin needs to be aware if a script is a python one and load it differently
Higher learning bar for new Admin who will likely just want a simple language to code in
Possibility of two differently maintained plugins for the same language, causing inconsistent APIs and other problems

Option 2 - Compile each language into the server

[MineServer(C++)]->[Script(Other language)]

This method will separate Scripts/Libraries transparently, If a Python script is loaded, the boilerplate loading code for python is used, if a Lib(dll/so) is passed, the code for Libraries is used.


Admin need not know what language a plugin is written in
Admin can just write a script in their favorite language and go, no further thought required


The Server will gain embedding support for Python, Perl, Lua and other languages, and all will be compiled into it... This will bloat the server size, and probably add overhead
Building the server code will require extra libraries for each language added (although we could probably only compile languages into it based on what libs are available at compile time)

Option 3- Hybrid option

[MineServer(C++)] -> [Wrapper Plugin(C++)] -> [Script(Other language)]

(This looks just like Option 1!!!!!111one)
This one will work similar to Option 2, internally to the server, when passed a script file it will load the related Wrapper Plugin, pass it the name of the script, and allow the Wrapper plugin to interact as necessary on behalf of the script


A single, consistent API for the language
Can be maintained in-tree
Will never be loaded if the Admin does not have a script in that language


Currently plugins do not allow you to pass them information on loading - This can be patched by myself but it will change the way other plugins work (Better to break them now rather than later! ;) )