diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java index ba47063a..9a8ad920 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/AuthProviderPair.java @@ -73,6 +73,11 @@ public final void init(LaunchServer srv, String name) { this.name = name; if (links != null) link(srv); core.init(srv); + if(mixes != null) { + for(var m : mixes.values()) { + m.init(srv, core); + } + } features = new HashSet<>(); getFeatures(core.getClass(), features); } @@ -96,5 +101,10 @@ public final void close() throws IOException { if (textureProvider != null) { textureProvider.close(); } + if(mixes != null) { + for(var m : mixes.values()) { + m.close(); + } + } } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/MixProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/MixProvider.java index cb74a8f4..b2ca8ad7 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/MixProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/mix/MixProvider.java @@ -2,9 +2,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import pro.gravit.launchserver.LaunchServer; +import pro.gravit.launchserver.auth.core.AuthCoreProvider; import pro.gravit.utils.ProviderMap; -public class MixProvider { +public abstract class MixProvider implements AutoCloseable{ public static final ProviderMap providers = new ProviderMap<>("MixProvider"); private static final Logger logger = LogManager.getLogger(); private static boolean registredProviders = false; @@ -15,9 +17,14 @@ public static void registerProviders() { } } + public abstract void init(LaunchServer server, AuthCoreProvider core); + @SuppressWarnings("unchecked") public T isSupport(Class clazz) { if (clazz.isAssignableFrom(getClass())) return (T) this; return null; } + + @Override + public abstract void close(); }