Skip to content

Commit

Permalink
Print player race, gender, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
vladtcvs committed Oct 31, 2021
1 parent c8d590a commit f3957a1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions mods/lord/lord_classes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit f3957a1

Please sign in to comment.