barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
527 stars 75 forks source link

Collecting Data with Proxy? #109

Open AbnormalMatrix opened 3 years ago

AbnormalMatrix commented 3 years ago

Hi, I want to make some sort of anti-cheat system but the first thing I need is to collect a bunch of training data. I want to make a program where the proxy will watch and record lots of types of data such as player position, blocks around them, when they attack, where they are looking and so on. But so far I can not figure out how I can get the program to output that kind of data. Any help would be awesome! Thanks in advance!

Gjum commented 3 years ago

If you just want a proxy to dump some packet data and don't require it to be in python, you can use this existing one.

AbnormalMatrix commented 3 years ago

Thanks for the reply! That is some good advice however since I am going to be doing most of the programming in python it makes most sense to have this also done in python. Any ideas?

barneygale commented 3 years ago

There's an example project here: https://github.com/barneygale/quarry/blob/master/examples/proxy_hide_chat.py

You basically want to implement a Bridge.packet_received method that writes the buffer to a file then calls super().