change `enable_non_player_action_log` to `log_non_player_actions`

This commit is contained in:
nixnoxus 2022-04-21 12:43:24 +02:00
parent 9159e5fd84
commit 90591c5a49
4 changed files with 5 additions and 5 deletions

View File

@ -1123,7 +1123,7 @@ Log API
Logs action of the player with a node at a certain position. Logs action of the player with a node at a certain position.
By default only actions of real players are logged. By default only actions of real players are logged.
Actions of non-players (usually machines) are logged only when Actions of non-players (usually machines) are logged only when
setting `enable_non_player_action_log` is enabled. setting `log_non_player_actions` is enabled.
A player is considered non-player if `player:is_player()` returns A player is considered non-player if `player:is_player()` returns
`false` or `player.is_fake_player` is truthy. The use of `false` or `player.is_fake_player` is truthy. The use of
`is_fake_player` is an unofficial standard between mods. `is_fake_player` is an unofficial standard between mods.

View File

@ -77,4 +77,4 @@ default:torch 99,default:cobble 99
#enable_weather = true #enable_weather = true
# If enabled, non-player actions are logged # If enabled, non-player actions are logged
#enable_non_player_action_log = false #log_non_player_actions = false

View File

@ -719,14 +719,14 @@ end
-- Log API / helpers -- Log API / helpers
-- --
local non_player_action_log = minetest.settings:get_bool("enable_non_player_action_log") ~= false local log_non_player_actions = minetest.settings:get_bool("log_non_player_actions") ~= false
function default.log_player_action(player, pos, message) function default.log_player_action(player, pos, message)
local who = player:get_player_name() local who = player:get_player_name()
if not player.is_fake_player and player:is_player() then if not player.is_fake_player and player:is_player() then
-- log action of real player -- log action of real player
minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos)) minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos))
elseif non_player_action_log then elseif log_non_player_actions then
-- log action of non real player -- log action of non real player
who = who .. "(" .. (type(player.is_fake_player) == "string" who = who .. "(" .. (type(player.is_fake_player) == "string"
and player.is_fake_player or "*").. ")" and player.is_fake_player or "*").. ")"

View File

@ -77,4 +77,4 @@ river_source_sounds (River source node sounds) bool false
enable_weather (Enable weather) bool true enable_weather (Enable weather) bool true
# If enabled, non-player actions are logged # If enabled, non-player actions are logged
enable_non_player_action_log (Log non-player action) bool false log_non_player_actions (Log non-player action) bool false