py-mine / mcstatus

A Python library for checking the status of Minecraft servers
https://mcstatus.readthedocs.io
Apache License 2.0
478 stars 37 forks source link

query: fix incorrect session token #857

Closed katrinafyi closed 3 months ago

katrinafyi commented 3 months ago

I believe this was causing all queries to be non-functional.

The functionality was broken due to incorrect session token handling. The session token must be maintained between requests within the same connection.

katrinafyi commented 3 months ago

This might be another protocol compatibility issue......

Edit: A number of other recent-ish libraries take this approach (e.g. mcutil). Older libraries (c. 2012) seem to be fine generating new sessions.

I can't find any servers which respond to query with randomised session tokens. That said, I don't really know how to find them.

katrinafyi commented 3 months ago

Likely a https://github.com/mcstatus-io/demo-server issue. My modded server seems to respond fine, and a manual inspection of server.jar finds no such restriction.