cPlugin_NewLua: why is it Lua-exported?
#1
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.
Reply
Thanks given by:
#2
Let me shed some light on that. It is exported to Lua, but it doesn't need to.


I HAVE SPOKEN!
Reply
Thanks given by:
#3
Behold the word of Truth. The word of Fake Truth Smile))
Reply
Thanks given by:
#4
Amen to that.

Hallelujah!
Reply
Thanks given by:
#5
And how about cPlugin's callbacks, do those need to be exported? I wouldn't think so, but what do I know...
Reply
Thanks given by:
#6
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
Reply
Thanks given by:
#7
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.
Reply
Thanks given by:
#8
Fine. I didn't think they would interfere, but if they do I say ditch themTongue
Reply
Thanks given by:
#9
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).
Reply
Thanks given by:
#10
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.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)