Fix infinite loop in protocol negotiator.
Add missing protocol versions for 1.10.1 and 1.10.2.
This commit is contained in:
1 parent
0c792a3f22
commit
7ab7381261
2 files changed
+8
-3
No files matched your search
@@ -21,6 +21,8 @@ SUPPORTED_MINECRAFT_VERSIONS = {
|
|||||||
'1.9.3': 110,
|
'1.9.3': 110,
|
||||||
'1.9.4': 110,
|
'1.9.4': 110,
|
||||||
'1.10': 210,
|
'1.10': 210,
|
||||||
|
'1.10.1': 210,
|
||||||
|
'1.10.2': 210,
|
||||||
'16w32a': 301,
|
'16w32a': 301,
|
||||||
'16w32b': 302,
|
'16w32b': 302,
|
||||||
'16w33a': 303,
|
'16w33a': 303,
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class Connection(object):
|
|||||||
return proto_version
|
return proto_version
|
||||||
|
|
||||||
if allowed_versions is None:
|
if allowed_versions is None:
|
||||||
self.allowed_proto_versions = SUPPORTED_PROTOCOL_VERSIONS
|
self.allowed_proto_versions = set(SUPPORTED_PROTOCOL_VERSIONS)
|
||||||
else:
|
else:
|
||||||
allowed_version = set(map(proto_version, allowed_versions))
|
allowed_version = set(map(proto_version, allowed_versions))
|
||||||
self.allowed_proto_versions = allowed_version
|
self.allowed_proto_versions = allowed_version
|
||||||
@@ -416,6 +416,10 @@ 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:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
self.connection.allowed_proto_versions.remove(
|
||||||
|
self.connection.context.protocol_version)
|
||||||
|
|
||||||
version = match.group('version')
|
version = match.group('version')
|
||||||
if version in SUPPORTED_MINECRAFT_VERSIONS:
|
if version in SUPPORTED_MINECRAFT_VERSIONS:
|
||||||
new_version = SUPPORTED_MINECRAFT_VERSIONS[version]
|
new_version = SUPPORTED_MINECRAFT_VERSIONS[version]
|
||||||
@@ -423,8 +427,7 @@ class LoginReactor(PacketReactor):
|
|||||||
new_version = max(SUPPORTED_PROTOCOL_VERSIONS)
|
new_version = max(SUPPORTED_PROTOCOL_VERSIONS)
|
||||||
elif data.startswith('Outdated server!'):
|
elif data.startswith('Outdated server!'):
|
||||||
new_version = min(SUPPORTED_PROTOCOL_VERSIONS)
|
new_version = min(SUPPORTED_PROTOCOL_VERSIONS)
|
||||||
if new_version != self.connection.context.protocol_version \
|
if new_version in self.connection.allowed_proto_versions:
|
||||||
and 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
|
||||||
# protocol version, making it appear (on the client side) as if
|
# protocol version, making it appear (on the client side) as if
|
||||||
# the client had initially connected with the (hopefully)
|
# the client had initially connected with the (hopefully)
|
||||||
|
|||||||
Reference in new issue
Block a user