minetest.register_on_cheat / false positives

Post Reply
User avatar
bosapara
Member
Posts: 618
Joined: Fri Apr 07, 2017 08:49

minetest.register_on_cheat / false positives

by bosapara » Post

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

User avatar
sfan5
Moderator
Posts: 3938
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: minetest.register_on_cheat / false positives

by sfan5 » Post

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.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
bosapara
Member
Posts: 618
Joined: Fri Apr 07, 2017 08:49

Re: minetest.register_on_cheat / false positives

by bosapara » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest