barneygale / quarry

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

Unsupported protocol version #93

Closed DexterHill0 closed 3 years ago

DexterHill0 commented 4 years ago

I am trying to connect to a offline-mode server. I am temporarily using the chat logger example script. I tried it on a server set up on localhost:25565 and it connected fine. I then went and got a public server and used a server pinger to get the ip. When I run

python main.py -p 25565 --offline-name Test 158.69.40.210

I just doesn't do anything. It's only once I terminate that I get:

Unhandled error in Deferred:

Traceback (most recent call last):
--- <exception caught here> ---
  File "C:\Users\Dexter\AppData\Local\Programs\Python\Python38\lib\site-packages\quarry\net\client.py", line 60, in connection_made
    self.protocol_version = yield factory.detected_protocol_version
quarry.net.protocol.ProtocolError: Unsupported protocol version: 120

However, when I pinged the server to get the ip, it shows it has protocol version 736. This same issue is happening for 3 servers that I have tried. The script always say protocol version 120 but according to the pinger, the version is actually 736. What am I doing wrong here?

barneygale commented 3 years ago

Seems to be the fault of something called TCPShield. Try using the full hostname of the server rather than the IP address?

barneygale commented 3 years ago

I've put in a fix that should help diagnose the issue. With your example I now get:

^CUnhandled error in Deferred:

Traceback (most recent call last):
--- <exception caught here> ---
  File "/Users/barney.gale/personal/quarry/quarry/net/client.py", line 61, in connection_made
    self.protocol_version = yield factory.detected_protocol_version
quarry.net.protocol.ProtocolError: Unsupported protocol version (120): Invalid hostname. Please refer to our documentation at docs.tcpshield.com