[FIX] NPE in MysqlHWIDProvider

This commit is contained in:
Gravit 2020-05-29 23:46:12 +07:00
parent 98431cc796
commit 2a9a4256f9
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
3 changed files with 24 additions and 0 deletions

View file

@ -105,4 +105,16 @@ public Map<String, Command> 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();
}
}

View file

@ -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
}

View file

@ -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);