mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-19 04:15:14 -04:00
fix some issues with connecting to a server with a forced version
This commit is contained in:
parent
eb2c1eff63
commit
35ae072d79
@ -102,7 +102,7 @@ public class ServerListCell extends ListCell<Server> implements Initializable {
|
||||
icon.setImage(favicon);
|
||||
optionsConnect.setOnAction(e -> {
|
||||
Connection connection = new Connection(Connection.lastConnectionId++, server.getAddress(), new Player(Minosoft.accountList.get(0)));
|
||||
connection.resolve(ConnectionReasons.CONNECT);
|
||||
connection.resolve(ConnectionReasons.CONNECT, server.getDesiredVersion());
|
||||
});
|
||||
optionsEdit.setOnAction(e -> edit());
|
||||
|
||||
|
@ -82,13 +82,20 @@ public class Connection {
|
||||
network.connect(address);
|
||||
}
|
||||
|
||||
public void resolve(ConnectionReasons reason) {
|
||||
public void resolve(ConnectionReasons reason, int protocolId) {
|
||||
address = addresses.get(0);
|
||||
this.nextReason = reason;
|
||||
Log.info(String.format("Trying to connect to %s", address));
|
||||
if (protocolId != -1) {
|
||||
setVersion(Versions.getVersionById(protocolId));
|
||||
}
|
||||
resolve(address);
|
||||
}
|
||||
|
||||
public void resolve(ConnectionReasons reason) {
|
||||
resolve(reason, -1);
|
||||
}
|
||||
|
||||
public void resolve(ServerAddress address) {
|
||||
reason = ConnectionReasons.DNS;
|
||||
network.connect(address);
|
||||
|
@ -385,7 +385,7 @@ public class InByteBuffer {
|
||||
public EntityMetaData.MetaDataHashMap readMetaData() {
|
||||
EntityMetaData.MetaDataHashMap sets = new EntityMetaData.MetaDataHashMap();
|
||||
|
||||
if (protocolId < 47) {
|
||||
if (protocolId < 48) {
|
||||
byte item = readByte();
|
||||
|
||||
while (item != 0x7F) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user