diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5ed76eef..82eb9e2c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -50,7 +50,7 @@ jobs: languages: ${{ matrix.language }} # Cache build process too like in the maven config - - uses: actions/cache@v3.2.6 + - uses: actions/cache@v3.3.1 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java index 122f5027..c198552a 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ProtocolLibListener.java @@ -179,8 +179,8 @@ public class ProtocolLibListener extends PacketAdapter { private boolean verifyNonce(Player sender, PacketContainer packet, ClientPublicKey clientPublicKey, byte[] expectedToken) { try { - if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 0)) - && !MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 3))) { + if (new MinecraftVersion(1, 19, 0).atOrAbove() + && !(new MinecraftVersion(1, 19, 3).atOrAbove())) { Either either = packet.getSpecificModifier(Either.class).read(0); if (clientPublicKey == null) { Optional left = either.left(); @@ -224,7 +224,7 @@ public class ProtocolLibListener extends PacketAdapter { PacketContainer packet = packetEvent.getPacket(); Optional clientKey = Optional.empty(); - if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 3))) { + if (new MinecraftVersion(1, 19, 3).atOrAbove()) { // public key sent separate clientKey = Optional.empty(); } else { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java index 50242186..387f04dd 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java @@ -272,7 +272,7 @@ public class VerifyResponseTask implements Runnable { //fake a new login packet in order to let the server handle all the other stuff private void receiveFakeStartPacket(String username, ClientPublicKey clientKey) { PacketContainer startPacket; - if (MinecraftVersion.atOrAbove(new MinecraftVersion(1, 19, 0))) { + if (new MinecraftVersion(1, 19, 0).atOrAbove()) { startPacket = new PacketContainer(START); startPacket.getStrings().write(0, username); diff --git a/core/pom.xml b/core/pom.xml index 4332fb9b..86b36e09 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -147,7 +147,7 @@ com.github.games647 craftapi - 0.6.1 + 0.6.2 diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java index 00e05ec0..fc84381d 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java @@ -40,7 +40,6 @@ import com.github.games647.fastlogin.core.storage.MySQLStorage; import com.github.games647.fastlogin.core.storage.SQLStorage; import com.github.games647.fastlogin.core.storage.SQLiteStorage; import com.google.common.base.Ticker; -import com.google.common.net.HostAndPort; import com.zaxxer.hikari.HikariConfig; import java.io.IOException; @@ -126,8 +125,8 @@ public class FastLoginCore

> { antiBot = createAntiBotService(config.getSection("anti-bot")); Set proxies = config.getStringList("proxies") .stream() - .map(HostAndPort::fromString) - .map(proxy -> new InetSocketAddress(proxy.getHostText(), proxy.getPort())) + .map(proxy -> proxy.split(":")) + .map(proxy -> new InetSocketAddress(proxy[0], Integer.parseInt(proxy[1]))) .map(sa -> new Proxy(Type.HTTP, sa)) .collect(toSet()); @@ -269,6 +268,7 @@ public class FastLoginCore

> { return passwordGenerator; } + @SuppressWarnings("unused") public void setPasswordGenerator(PasswordGenerator

passwordGenerator) { this.passwordGenerator = passwordGenerator; } diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index 5132bb2b..c99facbe 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -202,8 +202,8 @@ mojang-request-limit: 600 # https://github.com/games647/FastLogin/issues/85 auto-register-unknown: false -# This disables the auto login from fastlogin. So a premium (like a paid account) authentication is requested, but -# the player won't be auto logged into the account. +# By setting this option to false, you can disable the auto login from fastlogin. So a premium (like a paid account) +# authentication is requested, but the player won't be auto logged into the account from the auth plugin. # # This can be used as 2Factor authentication for better security of your accounts. A hacker then needs both passwords. # The password of your Minecraft and the password to login in with your auth plugin