meh-is / LANAnnouncer

Minecraft Fabric mod that adds LAN server announcements to dedicated servers.
MIT License
4 stars 0 forks source link

If a client supports both IPv4 and IPv6 multicast announcements, the same server will show twice #5

Open Gunni opened 8 months ago

Gunni commented 8 months ago

image-2024-01-02-01-45-00-535

Gunni commented 8 months ago

Proposed fix: Looking at how parseMotd and parseAddress work in LanServerPinger.java using MCP-Reborn then it should be fine to add an extra field to the current payload because the parsers just look for [MOTD] and [/MOTD], and [AD] and [/AD] and then uses string indexing to grab the string between them.

Adding a random uuid that stays the same for both IP versions will ensure that clients can trivially see they are the same server as a random uuid collision is very unlikely.

Now just adding that won't change anything, but it gives client makers/modders the ability to distinguish servers that are the same so that they can deduplicate them.

TODO: Make a client part to this mod and implement the above.