mirror of
https://github.com/minetest/minetest_game.git
synced 2025-02-22 02:30:23 +01:00
change enable_non_player_action_log
to log_non_player_actions
This commit is contained in:
parent
9159e5fd84
commit
90591c5a49
@ -1123,7 +1123,7 @@ Log API
|
||||
Logs action of the player with a node at a certain position.
|
||||
By default only actions of real players are logged.
|
||||
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
|
||||
`false` or `player.is_fake_player` is truthy. The use of
|
||||
`is_fake_player` is an unofficial standard between mods.
|
||||
|
@ -77,4 +77,4 @@ default:torch 99,default:cobble 99
|
||||
#enable_weather = true
|
||||
|
||||
# If enabled, non-player actions are logged
|
||||
#enable_non_player_action_log = false
|
||||
#log_non_player_actions = false
|
||||
|
@ -719,14 +719,14 @@ end
|
||||
-- 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)
|
||||
local who = player:get_player_name()
|
||||
if not player.is_fake_player and player:is_player() then
|
||||
-- log action of real player
|
||||
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
|
||||
who = who .. "(" .. (type(player.is_fake_player) == "string"
|
||||
and player.is_fake_player or "*").. ")"
|
||||
|
@ -77,4 +77,4 @@ river_source_sounds (River source node sounds) bool false
|
||||
enable_weather (Enable weather) bool true
|
||||
|
||||
# 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user