#include <lua.h>
#include <lauxlib.h>
#include "config.h"
#include "common/c_types.h"
Go to the source code of this file.
|
std::string | script_get_backtrace (lua_State *L) |
|
int | script_exception_wrapper (lua_State *L, lua_CFunction f) |
|
void | script_error (lua_State *L, int pcall_result, const char *mod, const char *fxn) |
|
void | script_run_callbacks_f (lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn) |
|
DeprecatedHandlingMode | get_deprecated_handling_mode () |
| Reads deprecated_lua_api_handling in settings, returns cached value. More...
|
|
void | log_deprecated (lua_State *L, const std::string &message, int stack_depth=1) |
| Handles a deprecation warning based on user settings. More...
|
|
◆ CUSTOM_RIDX_BACKTRACE
◆ CUSTOM_RIDX_BASE
#define CUSTOM_RIDX_BASE 1 |
◆ CUSTOM_RIDX_CURRENT_MOD_NAME
◆ CUSTOM_RIDX_GLOBALS_BACKUP
◆ CUSTOM_RIDX_SCRIPTAPI
◆ INDIRECT_SCRIPTAPI_RIDX
#define INDIRECT_SCRIPTAPI_RIDX 0 |
◆ PCALL_RESL
#define PCALL_RESL |
( |
|
L, |
|
|
|
RES |
|
) |
| |
Value: { \
int result_ = (RES); \
if (result_ != 0) { \
script_error((L), result_, NULL, __FUNCTION__); \
} \
}
◆ PUSH_ERROR_HANDLER
#define PUSH_ERROR_HANDLER |
( |
|
L | ) |
(lua_rawgeti((L), LUA_REGISTRYINDEX, CUSTOM_RIDX_BACKTRACE), lua_gettop((L))) |
◆ script_run_callbacks
◆ DeprecatedHandlingMode
Enumerator |
---|
Ignore | |
Log | |
Error | |
◆ RunCallbacksMode
Enumerator |
---|
RUN_CALLBACKS_MODE_FIRST | |
RUN_CALLBACKS_MODE_LAST | |
RUN_CALLBACKS_MODE_AND | |
RUN_CALLBACKS_MODE_AND_SC | |
RUN_CALLBACKS_MODE_OR | |
RUN_CALLBACKS_MODE_OR_SC | |
◆ get_deprecated_handling_mode()
◆ log_deprecated()
void log_deprecated |
( |
lua_State * |
L, |
|
|
const std::string & |
message, |
|
|
int |
stack_depth = 1 |
|
) |
| |
Handles a deprecation warning based on user settings.
- Parameters
-
L | Lua State |
message | The deprecation method |
stack_depth | How far on the stack to the first user function (ie: not builtin or core) |
References Error, get_deprecated_handling_mode(), Ignore, script_log(), and warningstream.
Referenced by ModApiParticles::l_add_particle(), ModApiParticles::l_add_particlespawner(), ObjectRef::l_get_attribute(), ModApiEnvMod::l_get_connected_players(), ObjectRef::l_get_entity_name(), ObjectRef::l_get_look_pitch(), ObjectRef::l_get_look_yaw(), ModApiMapgen::l_get_mapgen_params(), ModApiUtil::l_log(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_attribute(), ObjectRef::l_set_look_pitch(), ObjectRef::l_set_look_yaw(), ModApiMapgen::l_set_mapgen_params(), ObjectRef::l_set_physics_override(), ObjectRef::l_set_sky(), and read_hud_element().
◆ script_error()
void script_error |
( |
lua_State * |
L, |
|
|
int |
pcall_result, |
|
|
const char * |
mod, |
|
|
const char * |
fxn |
|
) |
| |
◆ script_exception_wrapper()
int script_exception_wrapper |
( |
lua_State * |
L, |
|
|
lua_CFunction |
f |
|
) |
| |
◆ script_get_backtrace()
std::string script_get_backtrace |
( |
lua_State * |
L | ) |
|
References CUSTOM_RIDX_BACKTRACE.
Referenced by check_field_or_nil(), check_lua_type(), ScriptApiClient::environment_step(), ScriptApiEnv::environment_Step(), ObjectRef::l_set_armor_groups(), ScriptApiEnv::on_emerge_area_completion(), ScriptApiEnv::player_event(), read_tool_capabilities(), ScriptApiBase::realityCheck(), script_log(), and warn_if_field_exists().
◆ script_run_callbacks_f()
void script_run_callbacks_f |
( |
lua_State * |
L, |
|
|
int |
nargs, |
|
|
RunCallbacksMode |
mode, |
|
|
const char * |
fxn |
|
) |
| |