aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-23 14:35:08 +0200
committerGitHub <noreply@github.com>2017-04-23 14:35:08 +0200
commit29ab20c27229672c24a7699afbcd54caad903331 (patch)
treee42e7ea35f54b1439055abc500191eb29baa6355 /builtin/game
parentdda171d2925e20efc00c78bcb45cf595fd986da9 (diff)
downloadminetest-29ab20c27229672c24a7699afbcd54caad903331.tar.gz
minetest-29ab20c27229672c24a7699afbcd54caad903331.tar.bz2
minetest-29ab20c27229672c24a7699afbcd54caad903331.zip
Player data to Database (#5475)
* Player data to Database Add player data into databases (SQLite3 & PG only) PostgreSQL & SQLite: better POO Design for databases Add --migrate-players argument to server + deprecation warning * Remove players directory if empty
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/chatcommands.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 84f2c3fed..cbf75c1bc 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -279,6 +279,31 @@ core.register_chatcommand("auth_reload", {
end,
})
+core.register_chatcommand("remove_player", {
+ params = "<name>",
+ description = "Remove player data",
+ privs = {server=true},
+ func = function(name, param)
+ local toname = param
+ if toname == "" then
+ return false, "Name field required"
+ end
+
+ local rc = core.remove_player(toname)
+
+ if rc == 0 then
+ core.log("action", name .. " removed player data of " .. toname .. ".")
+ return true, "Player \"" .. toname .. "\" removed."
+ elseif rc == 1 then
+ return true, "No such player \"" .. toname .. "\" to remove."
+ elseif rc == 2 then
+ return true, "Player \"" .. toname .. "\" is connected, cannot remove."
+ end
+
+ return false, "Unhandled remove_player return code " .. rc .. ""
+ end,
+})
+
core.register_chatcommand("teleport", {
params = "<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>",
description = "Teleport to player or position",