You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added config variables for unsafe and deprecated methods. By default, these will be enabled for some time, but will be set to default disabled in the future.
Flagged synchronous DB queries as unsafe
// if the method is considered unsafe, and unsafe methods have not been enabled, push a closure to error output function
330
+
if (method->flags & METHOD_FLAG_UNSAFE && !sElunaConfig->UnsafeMethodsEnabled())
331
+
{
332
+
lua_pushstring(L, method->name);
333
+
lua_pushcclosure(L, MethodUnsafe, 1);
334
+
lua_rawset(L, -3);
335
+
continue;
336
+
}
337
+
338
+
// if the method is considered deprecated, and deprecated methods have not been enabled, push a closure to error output function
339
+
if (method->flags & METHOD_FLAG_DEPRECATED && !sElunaConfig->DeprecatedMethodsEnabled())
340
+
{
341
+
lua_pushstring(L, method->name);
342
+
lua_pushcclosure(L, MethodDeprecated, 1);
343
+
lua_rawset(L, -3);
344
+
continue;
345
+
}
346
+
327
347
// if we're in multistate mode, we need to check whether a method is flagged as a world or a map specific method
328
348
if (method->regState != METHOD_REG_ALL)
329
349
{
@@ -492,6 +512,8 @@ class ElunaTemplate
492
512
493
513
staticintMethodWrongState(lua_State* L) { luaL_error(L, "attempt to call method '%s' that does not exist for state: %d", lua_tostring(L, lua_upvalueindex(1)), lua_tointeger(L, lua_upvalueindex(2))); return0; }
494
514
staticintMethodUnimpl(lua_State* L) { luaL_error(L, "attempt to call method '%s' that is not implemented for this emulator", lua_tostring(L, lua_upvalueindex(1))); return0; }
515
+
staticintMethodUnsafe(lua_State* L) { luaL_error(L, "attempt to call method '%s' that is flagged as unsafe! to use this method, enable unsafe methods in the config file", lua_tostring(L, lua_upvalueindex(1))); return0; }
516
+
staticintMethodDeprecated(lua_State* L) { luaL_error(L, "attempt to call method '%s' that is flagged as deprecated! this method will be removed in the future. to use this method, enable deprecated methods in the config file", lua_tostring(L, lua_upvalueindex(1))); return0; }
0 commit comments