gbl / AntiGhost

Mod that requests the server to send surrounding blocks to you, to get rid of ghost blocks
MIT License
28 stars 16 forks source link

Support multiconnect/ViaFabric #10

Closed Madis0 closed 3 years ago

Madis0 commented 3 years ago

Presumably the format of packets differs across Minecraft versions. If a player connects to a server via multiconnect/ViaFabric fallback, could AntiGhost check the actual server version and send appropriate packets according to that?

P.S. I don't know if this is actually an issue, just thought it could be depending on the server version and its anticheats.

gbl commented 3 years ago

It's an issue, but not one that I can influence.

I'm sending "stop breaking a block" packets, just in the same way the client does when a player starts mining a block, then stops. So these are packets that the server, or ViaFabric, expects just in the way the client sends them, and it's ViaFabric's job to translate them to the backend server.

If you're using ViaFabric client side: I'm calling the "create a packet and send it" code just the way the client itself does. I'd expect ViaFabric to sit somewhere "below" this, and translate the packet when it's being sent.

I don't know how much code ViaFabric shares with ViaVersion, but one problem with ViaVersion and AntiGhost is that ViaVersion has a built-in packet limiter - a client may not send more than 800 packets per second with ViaVersion in its default config. See https://docs.viaversion.com/display/VIAVERSION/Configuration. If ViaFabric has a similar thing, and if people reduce the number of packets, then the 729 packets from AntiGhost will, very likely, cause this to trigger and cause a disconnect.

Madis0 commented 3 years ago

If ViaFabric has a similar thing, and if people reduce the number of packets, then the 729 packets from AntiGhost will, very likely, cause this to trigger and cause a disconnect.

Perhaps AntiGhost could have a config option to configure packet amount then?

gbl commented 3 years ago

Fewer packets means less range in each direction, and the current number (4) is already not that big; reducing it would make the whole mod quite pointless.