overrides.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. local get_player_by_name = minetest.get_player_by_name
  2. function minetest.get_player_by_name(name)
  3. return get_player_by_name(rename.grn(name))
  4. end
  5. local player_exists = minetest.player_exists
  6. function minetest.player_exists(name)
  7. return player_exists(rename.grn(name))
  8. end
  9. local get_player_information = minetest.get_player_information
  10. function minetest.get_player_information(name)
  11. return get_player_information(rename.grn(name))
  12. end
  13. local kick_player = minetest.kick_player
  14. function minetest.kick_player(name, reason)
  15. return kick_player(rename.grn(name), reason)
  16. end
  17. local notify_authentication_modified = minetest.notify_authentication_modified
  18. function minetest.notify_authentication_modified(name)
  19. if type(name) == "string" then
  20. return notify_authentication_modified(rename.grn(name))
  21. end
  22. -- Can be called with no name.
  23. return notify_authentication_modified()
  24. end
  25. local check_password_entry = minetest.check_password_entry
  26. function minetest.check_password_entry(name, entry, password)
  27. return check_password_entry(rename.grn(name), entry, password)
  28. end
  29. local get_password_hash = minetest.get_password_hash
  30. function minetest.get_password_hash(name, raw_password)
  31. return get_password_hash(rename.grn(name), raw_password)
  32. end
  33. local set_player_password = minetest.set_player_password
  34. function minetest.set_player_password(name, password_hash)
  35. return set_player_password(rename.grn(name), password_hash)
  36. end
  37. local set_player_privs = minetest.set_player_privs
  38. function minetest.set_player_privs(name, privs)
  39. return set_player_privs(rename.grn(name), privs)
  40. end
  41. local get_player_privs = minetest.get_player_privs
  42. function minetest.get_player_privs(name)
  43. return get_player_privs(rename.grn(name))
  44. end
  45. local check_player_privs = minetest.check_player_privs
  46. function minetest.check_player_privs(player, ...)
  47. if type(player) == "string" then
  48. return check_player_privs(rename.grn(player), ...)
  49. end
  50. return check_player_privs(player, ...)
  51. end
  52. local get_player_ip = minetest.get_player_ip
  53. function minetest.get_player_ip(name)
  54. return get_player_ip(rename.grn(name))
  55. end
  56. local chat_send_player = minetest.chat_send_player
  57. function minetest.chat_send_player(name, text)
  58. return chat_send_player(rename.grn(name), text)
  59. end
  60. local show_formspec = minetest.show_formspec
  61. function minetest.show_formspec(playername, formname, formspec)
  62. return show_formspec(rename.grn(playername), formname, formspec)
  63. end
  64. local close_formspec = minetest.close_formspec
  65. function minetest.close_formspec(playername, formname)
  66. return close_formspec(rename.grn(playername), formname)
  67. end
  68. local get_ban_description = minetest.get_ban_description
  69. function minetest.get_ban_description(ip_or_name)
  70. return get_ban_description(rename.grn(ip_or_name))
  71. end
  72. local ban_player = minetest.ban_player
  73. function minetest.ban_player(name)
  74. return ban_player(rename.grn(name))
  75. end
  76. local unban_player_or_ip = minetest.unban_player_or_ip
  77. function minetest.unban_player_or_ip(name)
  78. return unban_player_or_ip(rename.grn(name))
  79. end
  80. local delete_particlespawner = minetest.delete_particlespawner
  81. function minetest.delete_particlespawner(id, player)
  82. if type(player) == "string" then
  83. player = rename.grn(player)
  84. end
  85. return delete_particlespawner(id, player)
  86. end
  87. -- This function should never be called with an alias anyway.
  88. --local is_protected = minetest.is_protected
  89. --function minetest.is_protected(pos, name)
  90. -- return is_protected(pos, rename.grn(name))
  91. --end
  92. local record_protection_violation = minetest.record_protection_violation
  93. function minetest.record_protection_violation(pos, name)
  94. return record_protection_violation(pos, rename.grn(name))
  95. end