1 /*
2 script/lua_api/l_server.h
3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 */
5 
6 /*
7 This file is part of Freeminer.
8 
9 Freeminer is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Freeminer  is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Freeminer.  If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef L_SERVER_H_
24 #define L_SERVER_H_
25 
26 #include "lua_api/l_base.h"
27 
28 class ModApiServer : public ModApiBase {
29 private:
30 	// request_shutdown()
31 	static int l_request_shutdown(lua_State *L);
32 
33 	// get_server_status()
34 	static int l_get_server_status(lua_State *L);
35 
36 	// get_worldpath()
37 	static int l_get_worldpath(lua_State *L);
38 
39 	// is_singleplayer()
40 	static int l_is_singleplayer(lua_State *L);
41 
42 	// get_current_modname()
43 	static int l_get_current_modname(lua_State *L);
44 
45 	// get_modpath(modname)
46 	static int l_get_modpath(lua_State *L);
47 
48 	// get_modnames()
49 	// the returned list is sorted alphabetically for you
50 	static int l_get_modnames(lua_State *L);
51 
52 	// chat_send_all(text)
53 	static int l_chat_send_all(lua_State *L);
54 
55 	// chat_send_player(name, text)
56 	static int l_chat_send_player(lua_State *L);
57 
58 	// show_formspec(playername,formname,formspec)
59 	static int l_show_formspec(lua_State *L);
60 
61 	// sound_play(spec, parameters)
62 	static int l_sound_play(lua_State *L);
63 
64 	// sound_stop(handle)
65 	static int l_sound_stop(lua_State *L);
66 
67 	// get_player_privs(name, text)
68 	static int l_get_player_privs(lua_State *L);
69 
70 	// get_player_ip()
71 	static int l_get_player_ip(lua_State *L);
72 
73 	// get_player_information()
74 	static int l_get_player_information(lua_State *L);
75 
76 	// get_ban_list()
77 	static int l_get_ban_list(lua_State *L);
78 
79 	// get_ban_description()
80 	static int l_get_ban_description(lua_State *L);
81 
82 	// ban_player()
83 	static int l_ban_player(lua_State *L);
84 
85 	// unban_player_or_ip()
86 	static int l_unban_player_or_ip(lua_State *L);
87 
88 	// kick_player(name, [message]) -> success
89 	static int l_kick_player(lua_State *L);
90 
91 	// notify_authentication_modified(name)
92 	static int l_notify_authentication_modified(lua_State *L);
93 
94 #ifndef NDEBUG
95 	//  cause_error(type_of_error)
96 	static int l_cause_error(lua_State *L);
97 #endif
98 
99 public:
100 	static void Initialize(lua_State *L, int top);
101 
102 };
103 
104 #endif /* L_SERVER_H_ */
105