mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
auto connect: fix version detection, resolve server address
This commit is contained in:
parent
7ff18cce79
commit
7907d579a3
@ -33,7 +33,6 @@ class StatusS2CP(buffer: InByteBuffer) : StatusS2CPacket {
|
||||
val status: ServerStatus = ServerStatus(buffer.readJson())
|
||||
|
||||
override fun handle(connection: StatusConnection) {
|
||||
connection.status = status
|
||||
val version: Version? = Versions.getByProtocol(status.protocolId ?: -1)
|
||||
if (version == null) {
|
||||
Log.log(LogMessageType.NETWORK_STATUS, LogLevels.WARN) { "Server is running on unknown version (protocolId=${status.protocolId})" }
|
||||
@ -41,6 +40,7 @@ class StatusS2CP(buffer: InByteBuffer) : StatusS2CPacket {
|
||||
connection.serverVersion = version
|
||||
}
|
||||
|
||||
connection.status = status
|
||||
val ping = StatusPing()
|
||||
connection.ping = ping
|
||||
connection.state = StatusConnectionStates.QUERYING_PING
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -69,6 +69,6 @@ object AutoConnect {
|
||||
return
|
||||
}
|
||||
|
||||
autoConnect(DNSUtil.getServerAddress(address), version, account)
|
||||
autoConnect(DNSUtil.resolveServerAddress(address).first(), version, account)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user