barneygale / mark2

minecraft server wrapper, written in python with twisted
Other
105 stars 27 forks source link

use something like Event.Arg for plugins? #70

Closed edk0 closed 11 years ago

edk0 commented 11 years ago

plugin configuration is a bit hacky and relies on the configuration file not being broken (or evil). the behaviour if it is could be arbitrarily insane. i think if we require something like this:

class MyPlugin(Plugin):
    foo = Plugin.Property(int)
    bar = Plugin.Property(unicode, default=u"123")

and complain loudly about properties that don't match, it'll make this bit a lot safer. the ability to specify additional data about properties might come in handy for generating the config file in the future, if we ever decide to do that.