2013-05-25 00:51:02 +02:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
#include "lua_api/l_base.h"
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2017-04-07 23:22:00 +02:00
|
|
|
class ModApiServer : public ModApiBase
|
|
|
|
{
|
2013-05-25 00:51:02 +02:00
|
|
|
private:
|
2015-07-17 16:40:41 +02:00
|
|
|
// request_shutdown([message], [reconnect])
|
2013-05-25 00:51:02 +02:00
|
|
|
static int l_request_shutdown(lua_State *L);
|
|
|
|
|
|
|
|
// get_server_status()
|
|
|
|
static int l_get_server_status(lua_State *L);
|
|
|
|
|
2016-11-02 17:36:58 +01:00
|
|
|
// get_server_uptime()
|
|
|
|
static int l_get_server_uptime(lua_State *L);
|
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// get_worldpath()
|
|
|
|
static int l_get_worldpath(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// is_singleplayer()
|
|
|
|
static int l_is_singleplayer(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// get_current_modname()
|
|
|
|
static int l_get_current_modname(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// get_modpath(modname)
|
|
|
|
static int l_get_modpath(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// get_modnames()
|
|
|
|
// the returned list is sorted alphabetically for you
|
|
|
|
static int l_get_modnames(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2015-07-25 07:43:32 +02:00
|
|
|
// print(text)
|
|
|
|
static int l_print(lua_State *L);
|
|
|
|
|
2013-05-25 00:51:02 +02:00
|
|
|
// chat_send_all(text)
|
|
|
|
static int l_chat_send_all(lua_State *L);
|
|
|
|
|
|
|
|
// chat_send_player(name, text)
|
|
|
|
static int l_chat_send_player(lua_State *L);
|
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
// show_formspec(playername,formname,formspec)
|
|
|
|
static int l_show_formspec(lua_State *L);
|
|
|
|
|
|
|
|
// sound_play(spec, parameters)
|
|
|
|
static int l_sound_play(lua_State *L);
|
|
|
|
|
|
|
|
// sound_stop(handle)
|
|
|
|
static int l_sound_stop(lua_State *L);
|
|
|
|
|
2016-07-10 07:08:26 +02:00
|
|
|
// sound_fade(handle, step, gain)
|
|
|
|
static int l_sound_fade(lua_State *L);
|
|
|
|
|
2013-05-25 00:51:02 +02:00
|
|
|
// get_player_privs(name, text)
|
|
|
|
static int l_get_player_privs(lua_State *L);
|
|
|
|
|
|
|
|
// get_player_ip()
|
|
|
|
static int l_get_player_ip(lua_State *L);
|
|
|
|
|
2017-04-27 11:49:44 +02:00
|
|
|
// get_player_information(name)
|
2014-02-13 20:17:42 +01:00
|
|
|
static int l_get_player_information(lua_State *L);
|
|
|
|
|
2013-05-25 00:51:02 +02:00
|
|
|
// get_ban_list()
|
|
|
|
static int l_get_ban_list(lua_State *L);
|
|
|
|
|
|
|
|
// get_ban_description()
|
|
|
|
static int l_get_ban_description(lua_State *L);
|
|
|
|
|
|
|
|
// ban_player()
|
|
|
|
static int l_ban_player(lua_State *L);
|
|
|
|
|
|
|
|
// unban_player_or_ip()
|
2013-06-16 14:07:12 +02:00
|
|
|
static int l_unban_player_or_ip(lua_State *L);
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2014-01-26 18:40:25 +01:00
|
|
|
// kick_player(name, [message]) -> success
|
|
|
|
static int l_kick_player(lua_State *L);
|
|
|
|
|
2017-04-23 14:35:08 +02:00
|
|
|
// remove_player(name)
|
|
|
|
static int l_remove_player(lua_State *L);
|
|
|
|
|
2013-05-25 00:51:02 +02:00
|
|
|
// notify_authentication_modified(name)
|
|
|
|
static int l_notify_authentication_modified(lua_State *L);
|
|
|
|
|
2015-08-12 04:27:54 +02:00
|
|
|
// get_last_run_mod()
|
|
|
|
static int l_get_last_run_mod(lua_State *L);
|
|
|
|
|
|
|
|
// set_last_run_mod(modname)
|
|
|
|
static int l_set_last_run_mod(lua_State *L);
|
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
public:
|
|
|
|
static void Initialize(lua_State *L, int top);
|
2013-05-25 00:51:02 +02:00
|
|
|
};
|