commit
This commit is contained in:
@@ -52,15 +52,20 @@ public class ServerPlugin implements IPlugin {
|
|||||||
public void onRegisterAuthenticators(Consumer<IAuthenticator> apply) {
|
public void onRegisterAuthenticators(Consumer<IAuthenticator> apply) {
|
||||||
String clientToken = Settings.getInstance().getClientToken();
|
String clientToken = Settings.getInstance().getClientToken();
|
||||||
MFCRAFT_LOGIN = new MFCraftAuthenticator(clientToken);
|
MFCRAFT_LOGIN = new MFCraftAuthenticator(clientToken);
|
||||||
|
MFCRAFT_LOGIN.onLoadSettings(Settings.getInstance().getAuthenticatorConfig(MFCRAFT_LOGIN.id()));
|
||||||
YGGDRASIL_LOGIN = new YggdrasilAuthenticator(clientToken);
|
YGGDRASIL_LOGIN = new YggdrasilAuthenticator(clientToken);
|
||||||
YGGDRASIL_LOGIN.onLoadSettings(Settings.getInstance().getYggdrasilConfig());
|
YGGDRASIL_LOGIN.onLoadSettings(Settings.getInstance().getAuthenticatorConfig(YGGDRASIL_LOGIN.id()));
|
||||||
|
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||||
|
Settings.getInstance().setAuthenticatorConfig(MFCRAFT_LOGIN.id(), MFCRAFT_LOGIN.onSaveSettings());
|
||||||
|
Settings.getInstance().setAuthenticatorConfig(YGGDRASIL_LOGIN.id(), YGGDRASIL_LOGIN.onSaveSettings());
|
||||||
|
}));
|
||||||
apply.accept(MFCRAFT_LOGIN);
|
apply.accept(MFCRAFT_LOGIN);
|
||||||
apply.accept(YGGDRASIL_LOGIN);
|
apply.accept(YGGDRASIL_LOGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showUI() {
|
public void showUI() {
|
||||||
MainFrame.showMainFrame(Settings.isFirstLoading());
|
MainFrame.showMainFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ServerInfo lastServerInfo;
|
public static ServerInfo lastServerInfo;
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ public class MFCraftAuthenticator extends IAuthenticator {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String id() {
|
||||||
|
return "mfcraft";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "MFCraft";
|
return "MFCraft";
|
||||||
|
|||||||
Reference in New Issue
Block a user