Skip to content

Commit

Permalink
8.0.1
Browse files Browse the repository at this point in the history
- FIX: server-key invalid key not getting detected properly, thus causing retries
  • Loading branch information
Osiris-Team committed May 6, 2024
1 parent f3a63ad commit 79661d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<groupId>com.osiris.autoplug.client</groupId>
<artifactId>autoplug-client</artifactId>
<version>8.0.0</version>
<version>8.0.1</version>
<packaging>jar</packaging>

<name>AutoPlug-Client</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023 Osiris-Team.
* Copyright (c) 2021-2024 Osiris-Team.
* All rights reserved.
*
* This software is copyrighted work, licensed under the terms
Expand Down Expand Up @@ -52,7 +52,8 @@ public SystemConfig() throws IOException, DuplicateKeyException, YamlReaderExcep
timestamp_last_backup = put(name, "timestamp-last-backup-task");

autoplug_web_ssl = put(name, "autoplug-web-ssl").setDefValues("true").setComments("If localhost is used below, remember to set this to false too!");
autoplug_web_ip = put(name, "autoplug-web-ip").setDefValues("144.91.78.158").setComments("Set to localhost to test on the local server.");
autoplug_web_ip = put(name, "autoplug-web-ip").setDefValues("144.91.78.158").setComments("Set to localhost to test on the local server.",
"Otherwise set to 144.91.78.158 or autoplug.one to connect with the default production server (remember to enable autoplug-web-ssl in this case too).");
autoplug_web_port = put(name, "autoplug-web-port").setDefValues("35555");

autoplug_plugin_key = put(name, "autoplug-plugin-key");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

package com.osiris.autoplug.client.network.online;

import com.osiris.autoplug.client.configs.GeneralConfig;
import com.osiris.autoplug.client.network.online.connections.*;
import com.osiris.jlib.logger.AL;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.util.concurrent.atomic.AtomicBoolean;

/**
Expand Down Expand Up @@ -54,14 +54,9 @@ public boolean open() {
} catch (Exception e) {
AL.warn(e);
isDone = true;
try {
String key = new GeneralConfig().server_key.asString();
if (key == null || key.isEmpty() || key.equals(NO_KEY))
return false;
// else we continue below and retry the connection
} catch (Exception ex) {
return false;
}
if (e instanceof InvalidKeyException)
return false; // Abort directly since no valid key exists
// else we continue below and retry the connection
}
super.setAndStartAsync(() -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.security.InvalidKeyException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -118,7 +119,7 @@ private synchronized int _open() throws Exception {
String serverKey = new GeneralConfig().server_key.asString();
if (serverKey == null || serverKey.equals("INSERT_KEY_HERE") ||
serverKey.equals(NO_KEY))
throw new Exception("No valid key provided." +
throw new InvalidKeyException("No valid key provided." +
" Register your server at " + GD.OFFICIAL_WEBSITE + ", get your server-key and add it to the /autoplug/general.yml config file." +
" Enter '.con reload' to retry.");
while (true) {
Expand Down

0 comments on commit 79661d1

Please sign in to comment.