3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 class ModApiBasic : public ModApiBase {
29 bool Initialize(lua_State* L,int top);
33 // Writes a line to dstream
34 static int l_debug(lua_State *L);
37 // Writes a line to the logger.
38 // The one-argument version logs to infostream.
39 // The two-argument version accept a log level: error, action, info, or verbose.
40 static int l_log(lua_State *L);
43 static int l_request_shutdown(lua_State *L);
45 // get_server_status()
46 static int l_get_server_status(lua_State *L);
48 // register_biome_groups({frequencies})
49 static int l_register_biome_groups(lua_State *L);
51 // register_biome({lots of stuff})
52 static int l_register_biome(lua_State *L);
54 // setting_set(name, value)
55 static int l_setting_set(lua_State *L);
58 static int l_setting_get(lua_State *L);
60 // setting_getbool(name)
61 static int l_setting_getbool(lua_State *L);
64 static int l_setting_save(lua_State *L);
66 // chat_send_all(text)
67 static int l_chat_send_all(lua_State *L);
69 // chat_send_player(name, text)
70 static int l_chat_send_player(lua_State *L);
72 // get_player_privs(name, text)
73 static int l_get_player_privs(lua_State *L);
76 static int l_get_player_ip(lua_State *L);
79 static int l_get_ban_list(lua_State *L);
81 // get_ban_description()
82 static int l_get_ban_description(lua_State *L);
85 static int l_ban_player(lua_State *L);
87 // unban_player_or_ip()
88 static int l_unban_player_or_ip(lua_State *L);
90 // show_formspec(playername,formname,formspec)
91 static int l_show_formspec(lua_State *L);
93 // get_dig_params(groups, tool_capabilities[, time_from_last_punch])
94 static int l_get_dig_params(lua_State *L);
96 // get_hit_params(groups, tool_capabilities[, time_from_last_punch])
97 static int l_get_hit_params(lua_State *L);
99 // get_current_modname()
100 static int l_get_current_modname(lua_State *L);
102 // get_modpath(modname)
103 static int l_get_modpath(lua_State *L);
106 // the returned list is sorted alphabetically for you
107 static int l_get_modnames(lua_State *L);
110 static int l_get_worldpath(lua_State *L);
112 // sound_play(spec, parameters)
113 static int l_sound_play(lua_State *L);
115 // sound_stop(handle)
116 static int l_sound_stop(lua_State *L);
119 static int l_is_singleplayer(lua_State *L);
121 // get_password_hash(name, raw_password)
122 static int l_get_password_hash(lua_State *L);
124 // notify_authentication_modified(name)
125 static int l_notify_authentication_modified(lua_State *L);
127 // rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds
128 static int l_rollback_get_last_node_actor(lua_State *L);
130 // rollback_revert_actions_by(actor, seconds) -> bool, log messages
131 static int l_rollback_revert_actions_by(lua_State *L);
133 static int l_register_ore(lua_State *L);
135 static struct EnumString es_OreType[];
140 #endif /* LUAAPI_H_ */