mirror of
https://github.com/minetest/minetest_game.git
synced 2025-02-22 18:50:21 +01:00
add setting enable_non_player_action_log
This commit is contained in:
parent
8b8c693edd
commit
e5a1343048
@ -75,3 +75,6 @@ default:torch 99,default:cobble 99
|
|||||||
# Enable cloud variation by the 'weather' mod.
|
# Enable cloud variation by the 'weather' mod.
|
||||||
# Non-functional in V6 or Singlenode mapgens.
|
# Non-functional in V6 or Singlenode mapgens.
|
||||||
#enable_weather = true
|
#enable_weather = true
|
||||||
|
|
||||||
|
# If enabled, non-player actions are logged
|
||||||
|
#enable_non_player_action_log = false
|
||||||
|
@ -758,11 +758,21 @@ function default.can_interact_with_node(player, pos)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local non_player_action_log = minetest.settings:get_bool("enable_non_player_action_log") or false
|
||||||
|
|
||||||
function default.log_action(player, pos, message)
|
function default.log_action(player, pos, message)
|
||||||
-- only log actions of real players
|
local who = player and player:get_player_name() or "(something)"
|
||||||
if player and not player.is_fake_player and player:is_player() then
|
if player and not player.is_fake_player and player:is_player() then
|
||||||
minetest.log("action", player:get_player_name() ..
|
-- log action of real player
|
||||||
" " .. message .. " at " .. minetest.pos_to_string(pos))
|
minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos))
|
||||||
|
elseif non_player_action_log ~= false then
|
||||||
|
-- log action of non real player
|
||||||
|
if player and player.is_fake_player and type(player.is_fake_player) == "string" then
|
||||||
|
who = who .. "(" .. player.is_fake_player .. ")"
|
||||||
|
else
|
||||||
|
who = who .. "(*)"
|
||||||
|
end
|
||||||
|
minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -75,3 +75,6 @@ river_source_sounds (River source node sounds) bool false
|
|||||||
# Enable cloud variation by the 'weather' mod.
|
# Enable cloud variation by the 'weather' mod.
|
||||||
# Non-functional in V6 or Singlenode mapgens.
|
# Non-functional in V6 or Singlenode mapgens.
|
||||||
enable_weather (Enable weather) bool true
|
enable_weather (Enable weather) bool true
|
||||||
|
|
||||||
|
# If enabled, non-player actions are logged
|
||||||
|
enable_non_player_action_log (Log non-player action) bool false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user