mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-29 05:35:11 +01:00
Fixes, now works 👍
This commit is contained in:
parent
97389426c3
commit
fec76a08ad
@ -419,23 +419,23 @@ class LoginReactor(PacketReactor):
|
|||||||
r"|Outdated server! I'm still on) (?P<version>.*)", data)
|
r"|Outdated server! I'm still on) (?P<version>.*)", data)
|
||||||
if not match:
|
if not match:
|
||||||
# If there's no match, we will try to select random version
|
# If there's no match, we will try to select random version
|
||||||
versions_to_try = self.connection.allowed_proto_versions
|
versions_to_try = list(self.connection.allowed_proto_versions)
|
||||||
new_version = random.choice(versions_to_try)
|
new_version = random.choice(versions_to_try)
|
||||||
|
version = None
|
||||||
else:
|
else:
|
||||||
version = match.group('version')
|
version = match.group('version')
|
||||||
|
new_version = None
|
||||||
self.connection.allowed_proto_versions.remove(
|
self.connection.allowed_proto_versions.remove(
|
||||||
self.connection.context.protocol_version)
|
self.connection.context.protocol_version)
|
||||||
|
|
||||||
if not version and not new_version:
|
if not version and not self.connection.allowed_proto_versions:
|
||||||
return
|
# If there's no versions left to try or version is empty
|
||||||
# If there's no versions left to try
|
|
||||||
if not self.connection.allowed_proto_versions:
|
|
||||||
return
|
return
|
||||||
if version in SUPPORTED_MINECRAFT_VERSIONS:
|
if version in SUPPORTED_MINECRAFT_VERSIONS:
|
||||||
new_version = SUPPORTED_MINECRAFT_VERSIONS[version]
|
new_version = SUPPORTED_MINECRAFT_VERSIONS[version]
|
||||||
elif data.startswith('Outdated client!'):
|
elif data.startswith('Outdated client!') and not new_version:
|
||||||
new_version = max(SUPPORTED_PROTOCOL_VERSIONS)
|
new_version = max(SUPPORTED_PROTOCOL_VERSIONS)
|
||||||
elif data.startswith('Outdated server!'):
|
elif data.startswith('Outdated server!') and not new_version:
|
||||||
new_version = min(SUPPORTED_PROTOCOL_VERSIONS)
|
new_version = min(SUPPORTED_PROTOCOL_VERSIONS)
|
||||||
if new_version in self.connection.allowed_proto_versions:
|
if new_version in self.connection.allowed_proto_versions:
|
||||||
# Ignore this disconnect packet and reconnect with the new
|
# Ignore this disconnect packet and reconnect with the new
|
||||||
|
Loading…
Reference in New Issue
Block a user