03-12-2014, 04:14 AM
I see three ways of providing support for handlers
Lua way one:
Create a new blockhandler cUnknownBlock with hooks for all the calls.
This is the most expensive in performance but fits the existing apis.
Lua way two:
Create a new blockhandler cUnknownBlock which wraps a lua table of functions. Then provide a function to register this blockhandler in a cache kept by cBlockhandler.
This is less expensive as we only call one plugin but is more complicated.
C++ way:
Use dynamic loaders to load user provided shared objects that register a factory with cBlockhandler then behave like any other handler.
Most performant but most complicated to use.
I think we should go for the second lua way as we dont want to be calling hooks for every tick.
Lua way one:
Create a new blockhandler cUnknownBlock with hooks for all the calls.
This is the most expensive in performance but fits the existing apis.
Lua way two:
Create a new blockhandler cUnknownBlock which wraps a lua table of functions. Then provide a function to register this blockhandler in a cache kept by cBlockhandler.
This is less expensive as we only call one plugin but is more complicated.
C++ way:
Use dynamic loaders to load user provided shared objects that register a factory with cBlockhandler then behave like any other handler.
Most performant but most complicated to use.
I think we should go for the second lua way as we dont want to be calling hooks for every tick.