From 9eb8a45ad8304c6bb3908fddf625186112f77cb5 Mon Sep 17 00:00:00 2001 From: Vladislav Tsendrovskii Date: Sun, 31 Oct 2021 14:03:32 +0300 Subject: [PATCH] Print player race, gender, etc --- mods/lord/lord_classes/init.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mods/lord/lord_classes/init.lua b/mods/lord/lord_classes/init.lua index 984a8b505..764efd47e 100644 --- a/mods/lord/lord_classes/init.lua +++ b/mods/lord/lord_classes/init.lua @@ -604,6 +604,32 @@ function races.revoke_second_chance(name) pmeta:set_string("classes:has_second_chance", "false") end +function races.print_player_race(name) + local race = races.get_race(name) + local gender = races.get_gender(name) + local skin = races.get_skin(name) + local can_change = races.has_second_chance(name) + local granted_privs = races.get_granted_privs(name) + local revoked_privs = races.get_revoked_privs(name) + + minetest.log("Player "..name.." : race="..race.." gender="..gender.." skin="..skin) + if can_change then + minetest.log("Has second chance") + else + minetest.log("Dosn't have second chance") + end + + minetest.log("Granted privs:") + for _, v in ipairs(granted_privs) do + minetest.log(" "..v) + end + + minetest.log("Revoked privs:") + for _, v in ipairs(revoked_privs) do + minetest.log(" "..v) + end + +end minetest.register_on_joinplayer(function(player) local name = player:get_player_name() @@ -612,6 +638,8 @@ minetest.register_on_joinplayer(function(player) local gender local skin + races.print_player_race(name) + if races.player_is_known(name) then -- Player is registered already race = races.get_race(name) if races.list[race].cannot_be_selected then