How could we prevent hackers in a mining game

Hello, as you can see by the title, I am trying to figure out a way to prevent hackers from mining all the blocks in a mining game. Take note, my game IS NOT an infinite mining game. The mine progress will be saved and is local, so everyone has their own progress in the SAME mine in the center of the map. With that being said, I hope to get replies helping me find out a way to prevent this. Thanks in advance!

1 Like

This is a hard feat to do, but what I would do is have something listening to the server on the client, then the server just fires a table of all the available block types to the client. Then the client can actually render them and fire events in relation to those blocks accordingly, but on the server you can actually verify that the block exists.

My game only has one block type: rock. But the health of the rock varies tho. Currently in the start, the rock has 5 health, the deeper you go it has 50 health and so on. Basically if the hacker would choose an ore to mine, the only option would be rock.

You could handle all the calculations and generating on the server, but don’t render anything in and instead store all the data in a table. Then you could send this table to the client, and generate based off of the contents in this folder.

Then when you fire events on the rock, you can verify that the position of the rock exists in the server folder that you generated earlier.

1 Like