]> git.lizzy.rs Git - minetest.git/blob - src/script/lua_api/l_server.h
Add minetest.get_player_window_information() (#12367)
[minetest.git] / src / script / lua_api / l_server.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 #pragma once
21
22 #include "lua_api/l_base.h"
23
24 class ModApiServer : public ModApiBase
25 {
26 private:
27         // request_shutdown([message], [reconnect])
28         static int l_request_shutdown(lua_State *L);
29
30         // get_server_status()
31         static int l_get_server_status(lua_State *L);
32
33         // get_server_uptime()
34         static int l_get_server_uptime(lua_State *L);
35
36         // get_server_max_lag()
37         static int l_get_server_max_lag(lua_State *L);
38
39         // get_worldpath()
40         static int l_get_worldpath(lua_State *L);
41
42         // is_singleplayer()
43         static int l_is_singleplayer(lua_State *L);
44
45         // get_current_modname()
46         static int l_get_current_modname(lua_State *L);
47
48         // get_modpath(modname)
49         static int l_get_modpath(lua_State *L);
50
51         // get_modnames()
52         // the returned list is sorted alphabetically for you
53         static int l_get_modnames(lua_State *L);
54
55         // get_game_info()
56         static int l_get_game_info(lua_State *L);
57
58         // print(text)
59         static int l_print(lua_State *L);
60
61         // chat_send_all(text)
62         static int l_chat_send_all(lua_State *L);
63
64         // chat_send_player(name, text)
65         static int l_chat_send_player(lua_State *L);
66
67         // show_formspec(playername,formname,formspec)
68         static int l_show_formspec(lua_State *L);
69
70         // sound_play(spec, parameters)
71         static int l_sound_play(lua_State *L);
72
73         // sound_stop(handle)
74         static int l_sound_stop(lua_State *L);
75
76         // sound_fade(handle, step, gain)
77         static int l_sound_fade(lua_State *L);
78
79         // dynamic_add_media(filepath)
80         static int l_dynamic_add_media(lua_State *L);
81
82         // get_player_privs(name, text)
83         static int l_get_player_privs(lua_State *L);
84
85         // get_player_ip()
86         static int l_get_player_ip(lua_State *L);
87
88         // get_player_information(name)
89         static int l_get_player_information(lua_State *L);
90
91         // get_player_window_information(name)
92         static int l_get_player_window_information(lua_State *L);
93
94         // get_ban_list()
95         static int l_get_ban_list(lua_State *L);
96
97         // get_ban_description()
98         static int l_get_ban_description(lua_State *L);
99
100         // ban_player()
101         static int l_ban_player(lua_State *L);
102
103         // unban_player_or_ip()
104         static int l_unban_player_or_ip(lua_State *L);
105
106         // disconnect_player(name, [reason]) -> success
107         static int l_disconnect_player(lua_State *L);
108
109         // remove_player(name)
110         static int l_remove_player(lua_State *L);
111
112         // notify_authentication_modified(name)
113         static int l_notify_authentication_modified(lua_State *L);
114
115         // do_async_callback(func, params, mod_origin)
116         static int l_do_async_callback(lua_State *L);
117
118         // register_async_dofile(path)
119         static int l_register_async_dofile(lua_State *L);
120
121         // serialize_roundtrip(obj)
122         static int l_serialize_roundtrip(lua_State *L);
123
124 public:
125         static void Initialize(lua_State *L, int top);
126         static void InitializeAsync(lua_State *L, int top);
127 };