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({lots of stuff})
49 static int l_register_biome(lua_State *L);
51 // setting_set(name, value)
52 static int l_setting_set(lua_State *L);
55 static int l_setting_get(lua_State *L);
57 // setting_getbool(name)
58 static int l_setting_getbool(lua_State *L);
61 static int l_setting_save(lua_State *L);
63 // chat_send_all(text)
64 static int l_chat_send_all(lua_State *L);
66 // chat_send_player(name, text)
67 static int l_chat_send_player(lua_State *L);
69 // get_player_privs(name, text)
70 static int l_get_player_privs(lua_State *L);
73 static int l_get_player_ip(lua_State *L);
76 static int l_get_ban_list(lua_State *L);
78 // get_ban_description()
79 static int l_get_ban_description(lua_State *L);
82 static int l_ban_player(lua_State *L);
84 // unban_player_or_ip()
85 static int l_unban_player_or_ip(lua_State *L);
87 // show_formspec(playername,formname,formspec)
88 static int l_show_formspec(lua_State *L);
90 // get_dig_params(groups, tool_capabilities[, time_from_last_punch])
91 static int l_get_dig_params(lua_State *L);
93 // get_hit_params(groups, tool_capabilities[, time_from_last_punch])
94 static int l_get_hit_params(lua_State *L);
96 // get_current_modname()
97 static int l_get_current_modname(lua_State *L);
99 // get_modpath(modname)
100 static int l_get_modpath(lua_State *L);
103 // the returned list is sorted alphabetically for you
104 static int l_get_modnames(lua_State *L);
107 static int l_get_worldpath(lua_State *L);
109 // sound_play(spec, parameters)
110 static int l_sound_play(lua_State *L);
112 // sound_stop(handle)
113 static int l_sound_stop(lua_State *L);
116 static int l_is_singleplayer(lua_State *L);
118 // get_password_hash(name, raw_password)
119 static int l_get_password_hash(lua_State *L);
121 // notify_authentication_modified(name)
122 static int l_notify_authentication_modified(lua_State *L);
124 // rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds
125 static int l_rollback_get_last_node_actor(lua_State *L);
127 // rollback_revert_actions_by(actor, seconds) -> bool, log messages
128 static int l_rollback_revert_actions_by(lua_State *L);
130 // register_ore(oredesc)
131 static int l_register_ore(lua_State *L);
133 // register_decoration(deco)
134 static int l_register_decoration(lua_State *L);
136 // create_schematic(p1, p2, filename)
137 static int l_create_schematic(lua_State *L);
139 // place_schematic(p, filename, rotation)
140 static int l_place_schematic(lua_State *L);
142 static struct EnumString es_OreType[];
143 static struct EnumString es_DecorationType[];
144 static struct EnumString es_Rotation[];
150 #endif /* LUAAPI_H_ */