Procedure for obsoleting Lua Functions
#1
What's our procedure for obsoleting functions that are exposed to plug-ins? I'm trying to decouple the block handlers from cWorld by providing an Interface and moving methods around. However a number of these functions are exported to lua so I need to know what to do if I need to change them.
Reply
Thanks given by:
#2
Dunno, try

Code:
OBSOLETE bool Derpy()

and see if tolua exports that right. Xoft has his doubts - possibly it might get turned from bool into OBSOLETE bool which doesn't exist.
Reply
Thanks given by:
#3
Usually we try to keep stuff as-is by providing manual bindings, and putting a LOGWARN in them saying that the function is obsolete and to use XYZ as replacement. Of course that's the best case scenario Smile

Putting an OBSOLETE modifier in front of function doesn't work so well for Lua, because it doesn't inform plugins that they're using obsolete stuff, but it creates warnings when compiling the MCS executable. The OBSOLETE modifier is meant for internal C++ code, not for API.
Reply
Thanks given by:
#4
(01-21-2014, 05:07 PM)xoft Wrote: Usually we try to keep stuff as-is by providing manual bindings, and putting a LOGWARN in them saying that the function is obsolete and to use XYZ as replacement. Of course that's the best case scenario Smile

Putting an OBSOLETE modifier in front of function doesn't work so well for Lua, because it doesn't inform plugins that they're using obsolete stuff, but it creates warnings when compiling the MCS executable. The OBSOLETE modifier is meant for internal C++ code, not for API.

That's exactly what I wanted to know. In most cases I should be able to write a forwarding function that does the warning and then the call.
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)