Make fields public for ServerListPingEvent
This pr just makes some fields public for the ServerListPingEvent. This is helpful since you may want to modify stuff like the port or Minecraft Version shown.
This PR is likely missing some stuff since this would also require to change some underlying python bindings, but eh..
Also, any reason we are using .h instead of .hpp?
Codecov Report
Attention: Patch coverage is 12.29630% with 592 lines in your changes missing coverage. Please review.
Project coverage is 8.02%. Comparing base (
b8e78c6) to head (219c890). Report is 149 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #75 +/- ##
========================================
+ Coverage 7.29% 8.02% +0.73%
========================================
Files 55 62 +7
Lines 3071 4384 +1313
Branches 1349 1895 +546
========================================
+ Hits 224 352 +128
- Misses 2669 3776 +1107
- Partials 178 256 +78
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR instead of making the needed fields public, adds methods to set the local port (ipv4 & pv6) as well as the guid
Thank you for the pull request! These fields were intentionally kept read-only, as modifying these values doesn't affect their appearance in the server list. I am wondering about the practical usage of making these fields writable with these setters?
Hey, the reason why local port should be writable as there is a chance for a port mismatch to happen when dealing with proxies. As when the proxy is on one port while the server is on another port the server MOTD ping will container the servers port and not the port of the proxy. This can confuse clients into believing the server does not exist in the server list.
@Dingsel That makes sense to me, although I think the proxy should ideally handle the ping response from backend servers, rather than the backend servers managing it directly. But I assume the proxies aren't that advanced yet.
@theaddonn One more thing before I merge this PR—could you also add the Python bindings for these setters?
@wu-vincent The proxy are that advanced, but it introduces a lot more overhead.. which can easily be avoided by just changing the needed data on the backend server directly.