diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java index 3312e6cb..e23d4f48 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/AdvancedProtectHandler.java @@ -105,4 +105,16 @@ public Map getCommands() { public boolean onJoinServer(String serverID, String username, Client client) { return !enableHardwareFeature || (client.trustLevel != null && client.trustLevel.hardwareInfo != null); } + + @Override + public void init() { + if(provider != null) + provider.init(); + } + + @Override + public void close() { + if(provider != null) + provider.close(); + } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java index 8bdaadc3..ce19e627 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/protect/ProtectHandler.java @@ -20,5 +20,15 @@ public static void registerHandlers() { public abstract boolean allowGetAccessToken(AuthResponse.AuthContext context); public abstract void checkLaunchServerLicense(); //Выдает SecurityException при ошибке проверки лицензии + + public void init() + { + + } + + public void close() + { + + } //public abstract } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 6f55b94c..08ca4407 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -184,6 +184,7 @@ public void init(LaunchServer.ReloadType type) { } if (protectHandler != null) { server.registerObject("protectHandler", protectHandler); + protectHandler.init(); protectHandler.checkLaunchServerLicense(); } if (components != null) { @@ -226,6 +227,7 @@ public void close(LaunchServer.ReloadType type) { } if (protectHandler != null) { server.unregisterObject("protectHandler", protectHandler); + protectHandler.close(); } if (dao != null) { server.unregisterObject("dao", dao);