]> git.lizzy.rs Git - dragonfireclient.git/blob - src/script/lua_api/luaapi.h
9623502c27867be618ce01e2d2aed1ff713662bb
[dragonfireclient.git] / src / script / lua_api / luaapi.h
1 /*
2 Minetest
3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
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.
9
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.
14
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.
18 */
19
20 #ifndef LUAAPI_H_
21 #define LUAAPI_H_
22
23
24 class ModApiBasic : public ModApiBase {
25
26 public:
27         ModApiBasic();
28
29         bool Initialize(lua_State* L,int top);
30
31 private:
32         // debug(text)
33         // Writes a line to dstream
34         static int l_debug(lua_State *L);
35
36         // log([level,] text)
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);
41
42         // request_shutdown()
43         static int l_request_shutdown(lua_State *L);
44
45         // get_server_status()
46         static int l_get_server_status(lua_State *L);
47
48         // register_biome_groups({frequencies})
49         static int l_register_biome_groups(lua_State *L);
50
51         // register_biome({lots of stuff})
52         static int l_register_biome(lua_State *L);
53
54         // setting_set(name, value)
55         static int l_setting_set(lua_State *L);
56
57         // setting_get(name)
58         static int l_setting_get(lua_State *L);
59
60         // setting_getbool(name)
61         static int l_setting_getbool(lua_State *L);
62
63         // setting_save()
64         static int l_setting_save(lua_State *L);
65
66         // chat_send_all(text)
67         static int l_chat_send_all(lua_State *L);
68
69         // chat_send_player(name, text)
70         static int l_chat_send_player(lua_State *L);
71
72         // get_player_privs(name, text)
73         static int l_get_player_privs(lua_State *L);
74
75         // get_player_ip()
76         static int l_get_player_ip(lua_State *L);
77
78         // get_ban_list()
79         static int l_get_ban_list(lua_State *L);
80
81         // get_ban_description()
82         static int l_get_ban_description(lua_State *L);
83
84         // ban_player()
85         static int l_ban_player(lua_State *L);
86
87         // unban_player_or_ip()
88         static int l_unban_player_or_ip(lua_State *L);
89
90         // show_formspec(playername,formname,formspec)
91         static int l_show_formspec(lua_State *L);
92
93         // get_dig_params(groups, tool_capabilities[, time_from_last_punch])
94         static int l_get_dig_params(lua_State *L);
95
96         // get_hit_params(groups, tool_capabilities[, time_from_last_punch])
97         static int l_get_hit_params(lua_State *L);
98
99         // get_current_modname()
100         static int l_get_current_modname(lua_State *L);
101
102         // get_modpath(modname)
103         static int l_get_modpath(lua_State *L);
104
105         // get_modnames()
106         // the returned list is sorted alphabetically for you
107         static int l_get_modnames(lua_State *L);
108
109         // get_worldpath()
110         static int l_get_worldpath(lua_State *L);
111
112         // sound_play(spec, parameters)
113         static int l_sound_play(lua_State *L);
114
115         // sound_stop(handle)
116         static int l_sound_stop(lua_State *L);
117
118         // is_singleplayer()
119         static int l_is_singleplayer(lua_State *L);
120
121         // get_password_hash(name, raw_password)
122         static int l_get_password_hash(lua_State *L);
123
124         // notify_authentication_modified(name)
125         static int l_notify_authentication_modified(lua_State *L);
126
127         // rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds
128         static int l_rollback_get_last_node_actor(lua_State *L);
129
130         // rollback_revert_actions_by(actor, seconds) -> bool, log messages
131         static int l_rollback_revert_actions_by(lua_State *L);
132
133         static int l_register_ore(lua_State *L);
134
135         static struct EnumString es_OreType[];
136 };
137
138
139
140 #endif /* LUAAPI_H_ */