mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +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(
|
||||
AddressInfo(
|
||||
backVersion = obj["version"].asString.let {
|
||||
var protocol: ProtocolVersion? = null
|
||||
val output = Ints.tryParse(it)
|
||||
if (output == null) {
|
||||
val ver = ProtocolVersion.getClosest(it)
|
||||
if (ver != null) protocol = ver
|
||||
val protocol = if (output == null) {
|
||||
ProtocolVersion.getClosest(it)
|
||||
} 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),
|
||||
frontOnline = obj["frontOnline"].asString.toBooleanStrictOrNull(),
|
||||
|
Loading…
Reference in New Issue
Block a user