Page 1 of 1

minetest.register_on_cheat / false positives

Posted: Wed Oct 07, 2020 08:40
by bosapara
Using cheat.type == "dug_unbreakable" give us false positives if we dig an example the dirt, must work only with unbreakable node like "stone + hand".

Any advices how to check on_cheat for unbreakable nodes?

Code: Select all

minetest.register_on_cheat(function(player, cheat)

 local name = player:get_player_name()

   if cheat.type == "dug_unbreakable" then
     minetest.log("warning", "[CHEAT DETECTION]: Player "..name.." is trying to instantly break unbreakable nodes!")
   end


end)
Image

Re: minetest.register_on_cheat / false positives

Posted: Thu Oct 22, 2020 16:01
by sfan5
How would this bug be reproduced?
Did you mark dirt as instantly breakable or is that a cheat clients doing?

Anyway if you'd like to test if something is actually unbreakable you can use minetest.get_dig_params.

Re: minetest.register_on_cheat / false positives

Posted: Fri Oct 23, 2020 08:42
by bosapara
Yes, to reproduce this bug - you need modified client with dig on_punch.

"minetest.get_dig_params" can't help to check the cheat, because it works only when node was dug.

In any way default anticheat works well, but its still impossible to check who tried to dig unbreakable node.