mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-02-16 01:41:24 +01:00
Fixed wrong usage of ProtocolVersion#getProtocol
This commit is contained in:
parent
972a6932b2
commit
4090a6eb12
@ -148,15 +148,13 @@ class WebLogin : WebState {
|
|||||||
webClient.server.addressCallbacks[callback].complete(
|
webClient.server.addressCallbacks[callback].complete(
|
||||||
AddressInfo(
|
AddressInfo(
|
||||||
backVersion = obj["version"].asString.let {
|
backVersion = obj["version"].asString.let {
|
||||||
var protocol: ProtocolVersion? = null
|
|
||||||
val output = Ints.tryParse(it)
|
val output = Ints.tryParse(it)
|
||||||
if (output == null) {
|
val protocol = if (output == null) {
|
||||||
val ver = ProtocolVersion.getClosest(it)
|
ProtocolVersion.getClosest(it)
|
||||||
if (ver != null) protocol = ver
|
|
||||||
} else {
|
} else {
|
||||||
protocol = ProtocolVersion.getProtocol(output)
|
ProtocolVersion.getProtocol(output)
|
||||||
}
|
}
|
||||||
protocol ?: AUTO
|
if (!protocol!!.isKnown) AUTO else protocol
|
||||||
},
|
},
|
||||||
backHostAndPort = HostAndPort.fromParts(obj["host"].asString, obj["port"].asInt),
|
backHostAndPort = HostAndPort.fromParts(obj["host"].asString, obj["port"].asInt),
|
||||||
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
||||||
|
Loading…
Reference in New Issue
Block a user