l_client.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. Minetest
  3. Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License along
  14. with this program; if not, write to the Free Software Foundation, Inc.,
  15. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. */
  17. #ifndef L_CLIENT_H_
  18. #define L_CLIENT_H_
  19. #include "lua_api/l_base.h"
  20. #include "itemdef.h"
  21. #include "tool.h"
  22. class ModApiClient : public ModApiBase
  23. {
  24. private:
  25. // get_current_modname()
  26. static int l_get_current_modname(lua_State *L);
  27. // print(text)
  28. static int l_print(lua_State *L);
  29. // display_chat_message(message)
  30. static int l_display_chat_message(lua_State *L);
  31. // send_chat_message(message)
  32. static int l_send_chat_message(lua_State *L);
  33. // clear_out_chat_queue()
  34. static int l_clear_out_chat_queue(lua_State *L);
  35. // get_player_names()
  36. static int l_get_player_names(lua_State *L);
  37. // show_formspec(name, formspec)
  38. static int l_show_formspec(lua_State *L);
  39. // send_respawn()
  40. static int l_send_respawn(lua_State *L);
  41. // disconnect()
  42. static int l_disconnect(lua_State *L);
  43. // gettext(text)
  44. static int l_gettext(lua_State *L);
  45. // get_last_run_mod(n)
  46. static int l_get_last_run_mod(lua_State *L);
  47. // set_last_run_mod(modname)
  48. static int l_set_last_run_mod(lua_State *L);
  49. // get_node(pos)
  50. static int l_get_node(lua_State *L);
  51. // get_node_or_nil(pos)
  52. static int l_get_node_or_nil(lua_State *L);
  53. // get_wielded_item()
  54. static int l_get_wielded_item(lua_State *L);
  55. // get_meta(pos)
  56. static int l_get_meta(lua_State *L);
  57. static int l_sound_play(lua_State *L);
  58. static int l_sound_stop(lua_State *L);
  59. // get_server_info()
  60. static int l_get_server_info(lua_State *L);
  61. // get_item_def(itemstring)
  62. static int l_get_item_def(lua_State *L);
  63. // get_node_def(nodename)
  64. static int l_get_node_def(lua_State *L);
  65. // take_screenshot()
  66. static int l_take_screenshot(lua_State *L);
  67. // get_privilege_list()
  68. static int l_get_privilege_list(lua_State *L);
  69. // get_builtin_path()
  70. static int l_get_builtin_path(lua_State *L);
  71. public:
  72. static void Initialize(lua_State *L, int top);
  73. };
  74. #endif