mirror of
https://github.com/songoda/UltimateModeration.git
synced 2024-11-29 05:35:14 +01:00
Fix up the MySQL support.
This commit is contained in:
parent
1d984cef36
commit
3bf21b27f9
@ -55,6 +55,7 @@ public class UltimateModeration extends SongodaPlugin {
|
||||
private ModerationManager moderationManager;
|
||||
|
||||
private DatabaseConnector databaseConnector;
|
||||
private DataMigrationManager dataMigrationManager;
|
||||
private DataManager dataManager;
|
||||
|
||||
public static UltimateModeration getInstance() {
|
||||
@ -109,7 +110,7 @@ public class UltimateModeration extends SongodaPlugin {
|
||||
this.staffChatManager = new StaffChatManager();
|
||||
this.moderationManager = new ModerationManager(this);
|
||||
|
||||
// Database stuff, go!
|
||||
|
||||
try {
|
||||
if (Settings.MYSQL_ENABLED.getBoolean()) {
|
||||
String hostname = Settings.MYSQL_HOSTNAME.getString();
|
||||
@ -125,15 +126,18 @@ public class UltimateModeration extends SongodaPlugin {
|
||||
this.databaseConnector = new SQLiteConnector(this);
|
||||
this.getLogger().info("Data handler connected using SQLite.");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
this.getLogger().severe("Fatal error trying to connect to database. Please make sure all your connection settings are correct and try again. Plugin has been disabled.");
|
||||
this.emergencyStop();
|
||||
}
|
||||
|
||||
this.dataManager = new DataManager(this.databaseConnector, this);
|
||||
DataMigrationManager dataMigrationManager = new DataMigrationManager(this.databaseConnector, this.dataManager,
|
||||
new _1_InitialMigration());
|
||||
dataMigrationManager.runMigrations();
|
||||
this.dataManager = new DataManager(this.databaseConnector, this);
|
||||
this.dataMigrationManager = new DataMigrationManager(this.databaseConnector, this.dataManager,
|
||||
new _1_InitialMigration());
|
||||
this.dataMigrationManager.runMigrations();
|
||||
|
||||
} catch (Exception ex) {
|
||||
this.getLogger().severe("Fatal error trying to connect to database. " +
|
||||
"Please make sure all your connection settings are correct and try again. Plugin has been disabled.");
|
||||
emergencyStop();
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(this, () -> {
|
||||
// Legacy Data
|
||||
|
Loading…
Reference in New Issue
Block a user