Cuberite Forum

Full Version: cPlugin_NewLua: why is it Lua-exported?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
I'm having a hard time understanding why the entire cPlugin_NewLua class is exported to Lua. Especially the callback, OnBlockDig() et al. Why would anything from Lua call these? Even worse, there doesn't seem to be a way to get the object instance on which to call the functions.

I need some serious light-shedding here.
Let me shed some light on that. It is exported to Lua, but it doesn't need to.


I HAVE SPOKEN!
Behold the word of Truth. The word of Fake Truth Smile))
Amen to that.

Hallelujah!
And how about cPlugin's callbacks, do those need to be exported? I wouldn't think so, but what do I know...
They need to be exported for the old plugins. It uses tolua++ to call functions from C++ to lua, therefore they need to be exported
Are old plugins still used at all?

I'm currently experiencing issues trying to add a callback, ToLua produces uncompilable code for cPlugin binding. I'd say it's time to chuck old plugins away.
Fine. I didn't think they would interfere, but if they do I say ditch themTongue
Still, if one really need old plugin to work - re-write it!
It's really simple (replace GetWorld() with GetDefaultWorld(), delete PluginName: prefix in hook callbacks and get rid of all setmetatable-related stuff).
No, Taugeshtu, those are actually the new plugins already. The old plugins are ones that are set in the settings.ini by Plugin=<name>, rather than NewPlugin=<name>. They have a completely different architecture, from what I can gather. I don't even think all the new hooks work in them. I certainly didn't write any glue code for that.
Pages: 1 2 3