use of me.semx11.autotip.core.MigrationManager in project Hyperium by HyperiumClient.
the class Autotip method setup.
private void setup() {
try {
fileUtil = new FileUtil(this);
gson = new GsonBuilder().registerTypeAdapter(Config.class, new ConfigCreator(this)).registerTypeAdapter(StatsDaily.class, new StatsDailyCreator(this)).setExclusionStrategies(new AnnotationExclusionStrategy()).setPrettyPrinting().create();
config = new Config(this);
reloadGlobalSettings();
reloadLocale();
sessionManager = new SessionManager(this);
statsManager = new StatsManager(this);
migrationManager = new MigrationManager(this);
fileUtil.createDirectories();
config.load();
taskManager.getExecutor().execute(() -> migrationManager.migrateLegacyFiles());
registerEvents(new EventClientConnection(this), new EventChatReceived(this));
registerCommands(new CommandAutotip(this), new CommandLimbo(this));
Runtime.getRuntime().addShutdownHook(new Thread(sessionManager::logout));
initialized = true;
} catch (IOException e) {
messageUtil.send("Autotip is disabled because it couldn't create the required files.");
ErrorReport.reportException(e);
} catch (IllegalStateException e) {
messageUtil.send("Autotip is disabled because it couldn't connect to the API.");
ErrorReport.reportException(e);
}
}
Aggregations