Procedure for obsoleting Lua Functions - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Procedure for obsoleting Lua Functions (/thread-1324.html) |
Procedure for obsoleting Lua Functions - worktycho - 01-21-2014 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. RE: Procedure for obsoleting Lua Functions - tigerw - 01-21-2014 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. RE: Procedure for obsoleting Lua Functions - xoft - 01-21-2014 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 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. RE: Procedure for obsoleting Lua Functions - worktycho - 01-22-2014 (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 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. |