diff --git a/.gitignore b/.gitignore
index 594dbe9e..a67d3fae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,5 @@ hs_err_pid*
# Mac filesystem dust
.DS_Store
+# Factorypath from Visual Studio Code
+.factorypath
\ No newline at end of file
diff --git a/bungee/pom.xml b/bungee/pom.xml
index 3ec97733..00995890 100644
--- a/bungee/pom.xml
+++ b/bungee/pom.xml
@@ -56,6 +56,7 @@
+
codemc-repo
https://repo.codemc.io/repository/maven-public/
@@ -65,6 +66,12 @@
nukkitx-repo
https://repo.nukkitx.com/maven-snapshots/
+
+
+ spigotplugins-repo
+ https://maven.gamestrike.de/mvn/
+
+
@@ -99,5 +106,12 @@
system
${project.basedir}/lib/BungeeAuth-1.4.jar
+
+
+ de.xxschrandxx.bca
+ BungeeCordAuthenticator
+ 0.0.2-SNAPSHOT
+ provided
+
diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java
index 55b6ee8e..17d16ce3 100644
--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java
+++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java
@@ -1,6 +1,7 @@
package com.github.games647.fastlogin.bungee;
import com.github.games647.fastlogin.bungee.hook.BungeeAuthHook;
+import com.github.games647.fastlogin.bungee.hook.BungeeCordAuthenticatorHook;
import com.github.games647.fastlogin.bungee.listener.ConnectListener;
import com.github.games647.fastlogin.bungee.listener.PluginMessageListener;
import com.github.games647.fastlogin.core.AsyncScheduler;
@@ -84,11 +85,17 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin {
+
+ public final BungeeCordAuthenticatorBungeeAPI api;
+
+ public BungeeCordAuthenticatorHook(Plugin plugin, Logger logger) {
+ BungeeCordAuthenticatorBungee bcab = (BungeeCordAuthenticatorBungee) plugin;
+ api = bcab.getAPI();
+ logger.info("BungeeCordAuthenticatorHook | Hooked successful!");
+ }
+
+ @Override
+ public boolean forceLogin(ProxiedPlayer player) {
+ if (api.isAuthenticated(player)) {
+ return true;
+ } else {
+ try {
+ api.setAuthenticated(player);
+ }
+ catch (SQLException e) {
+ e.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+ }
+
+ @Override
+ public boolean isRegistered(String playerName) {
+ try {
+ return api.getSQL().checkPlayerEntry(playerName);
+ }
+ catch (SQLException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ @Override
+ public boolean forceRegister(ProxiedPlayer player, String password) {
+ try {
+ return api.createPlayerEntry(player, password);
+ }
+ catch (SQLException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+}
diff --git a/bungee/src/main/resources/bungee.yml b/bungee/src/main/resources/bungee.yml
index 3de34445..a5fa5aa1 100644
--- a/bungee/src/main/resources/bungee.yml
+++ b/bungee/src/main/resources/bungee.yml
@@ -11,6 +11,7 @@ author: games647, https://github.com/games647/FastLogin/graphs/contributors
softDepends:
# BungeeCord auth plugins
- BungeeAuth
+ - BungeeCordAuthenticatorBungee
description: |
${project.description}