Remove deprecated methods, fix MySQL

This commit is contained in:
ceze88 2022-08-14 11:53:38 +02:00
parent 4ed9b5e1c5
commit 2b0f1b4b23
4 changed files with 174 additions and 123 deletions

View File

@ -119,7 +119,7 @@
<dependency> <dependency>
<groupId>com.songoda</groupId> <groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId> <artifactId>SongodaCore</artifactId>
<version>2.6.13</version> <version>2.6.14-DEV</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>

View File

@ -106,8 +106,9 @@ public class UltimateModeration extends SongodaPlugin {
String username = Settings.MYSQL_USERNAME.getString(); String username = Settings.MYSQL_USERNAME.getString();
String password = Settings.MYSQL_PASSWORD.getString(); String password = Settings.MYSQL_PASSWORD.getString();
boolean useSSL = Settings.MYSQL_USE_SSL.getBoolean(); boolean useSSL = Settings.MYSQL_USE_SSL.getBoolean();
int poolSize = Settings.MYSQL_POOL_SIZE.getInt();
this.databaseConnector = new MySQLConnector(this, hostname, port, database, username, password, useSSL); this.databaseConnector = new MySQLConnector(this, hostname, port, database, username, password, useSSL, poolSize);
this.getLogger().info("Data handler connected using MySQL."); this.getLogger().info("Data handler connected using MySQL.");
} else { } else {
this.databaseConnector = new SQLiteConnector(this); this.databaseConnector = new SQLiteConnector(this);
@ -150,7 +151,7 @@ public class UltimateModeration extends SongodaPlugin {
@Override @Override
public void onDataLoad() { public void onDataLoad() {
getDataManager().queueAsync(() -> { getDataManager().runAsync(() -> {
// Load data from DB // Load data from DB
this.dataManager.getTemplates((templates) -> { this.dataManager.getTemplates((templates) -> {
for (Template template : templates) { for (Template template : templates) {
@ -169,7 +170,7 @@ public class UltimateModeration extends SongodaPlugin {
for (Ticket ticket : tickets.values()) for (Ticket ticket : tickets.values())
this.ticketManager.addTicket(ticket); this.ticketManager.addTicket(ticket);
}); });
}, "create"); });
} }
@Override @Override

View File

@ -13,6 +13,7 @@ import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Statement; import java.sql.Statement;
@ -30,36 +31,43 @@ public class DataManager extends DataManagerAbstract {
} }
public void createTemplate(Template template) { public void createTemplate(Template template) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String createTemplate = "INSERT INTO " + this.getTablePrefix() + "templates (punishment_type, duration, reason, name, creator) VALUES (?, ?, ?, ?, ?)"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(createTemplate)) { String createTemplate = "INSERT INTO " + this.getTablePrefix() + "templates (punishment_type, duration, reason, name, creator) VALUES (?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTemplate);
statement.setString(1, template.getPunishmentType().name()); statement.setString(1, template.getPunishmentType().name());
statement.setLong(2, template.getDuration()); statement.setLong(2, template.getDuration());
statement.setString(3, template.getReason()); statement.setString(3, template.getReason());
statement.setString(4, template.getName()); statement.setString(4, template.getName());
statement.setString(5, template.getCreator().toString()); statement.setString(5, template.getCreator().toString());
statement.executeUpdate(); statement.executeUpdate();
}
int templateId = this.lastInsertedId(connection, "templates"); int templateId = this.lastInsertedId(connection, "templates");
template.setId(templateId); template.setId(templateId);
}), "create"); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void deleteTemplate(Template template) { public void deleteTemplate(Template template) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String deleteTemplate = "DELETE FROM " + this.getTablePrefix() + "templates WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(deleteTemplate)) { String deleteTemplate = "DELETE FROM " + this.getTablePrefix() + "templates WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deleteTemplate);
statement.setLong(1, template.getId()); statement.setLong(1, template.getId());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void getTemplates(Consumer<List<Template>> callback) { public void getTemplates(Consumer<List<Template>> callback) {
List<Template> templates = new ArrayList<>(); List<Template> templates = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
try (Statement statement = connection.createStatement()) { try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String selectTemplates = "SELECT * FROM " + this.getTablePrefix() + "templates"; String selectTemplates = "SELECT * FROM " + this.getTablePrefix() + "templates";
ResultSet result = statement.executeQuery(selectTemplates); ResultSet result = statement.executeQuery(selectTemplates);
while (result.next()) { while (result.next()) {
@ -73,16 +81,19 @@ public class DataManager extends DataManagerAbstract {
template.setId(id); template.setId(id);
templates.add(template); templates.add(template);
} }
}
this.sync(() -> callback.accept(templates)); this.sync(() -> callback.accept(templates));
})); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void createAppliedPunishment(AppliedPunishment punishment) { public void createAppliedPunishment(AppliedPunishment punishment) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String createPunishment = "INSERT INTO " + this.getTablePrefix() + "punishments (type, duration, reason, victim, punisher, expiration) VALUES (?, ?, ?, ?, ?, ?)"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(createPunishment)) { String createPunishment = "INSERT INTO " + this.getTablePrefix() + "punishments (type, duration, reason, victim, punisher, expiration) VALUES (?, ?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createPunishment);
statement.setString(1, punishment.getPunishmentType().name()); statement.setString(1, punishment.getPunishmentType().name());
statement.setLong(2, punishment.getDuration()); statement.setLong(2, punishment.getDuration());
statement.setString(3, punishment.getReason()); statement.setString(3, punishment.getReason());
@ -90,27 +101,33 @@ public class DataManager extends DataManagerAbstract {
statement.setString(5, punishment.getPunisher().toString()); statement.setString(5, punishment.getPunisher().toString());
statement.setLong(6, punishment.getExpiration()); statement.setLong(6, punishment.getExpiration());
statement.executeUpdate(); statement.executeUpdate();
}
int punishmentId = this.lastInsertedId(connection, "punishments"); int punishmentId = this.lastInsertedId(connection, "punishments");
punishment.setId(punishmentId); punishment.setId(punishmentId);
}), "create"); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void deleteAppliedPunishment(AppliedPunishment punishment) { public void deleteAppliedPunishment(AppliedPunishment punishment) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String deletePunishment = "DELETE FROM " + this.getTablePrefix() + "punishments WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(deletePunishment)) { String deletePunishment = "DELETE FROM " + this.getTablePrefix() + "punishments WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deletePunishment);
statement.setLong(1, punishment.getId()); statement.setLong(1, punishment.getId());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void updateAppliedPunishment(AppliedPunishment punishment) { public void updateAppliedPunishment(AppliedPunishment punishment) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String updatePunishment = "UPDATE " + this.getTablePrefix() + "punishments set type = ?, duration = ?, reason = ?, victim = ?, punisher = ?, expiration = ? WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(updatePunishment)) { String updatePunishment = "UPDATE " + this.getTablePrefix() + "punishments set type = ?, duration = ?, reason = ?, victim = ?, punisher = ?, expiration = ? WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(updatePunishment);
statement.setString(1, punishment.getPunishmentType().name()); statement.setString(1, punishment.getPunishmentType().name());
statement.setLong(2, punishment.getDuration()); statement.setLong(2, punishment.getDuration());
statement.setString(3, punishment.getReason()); statement.setString(3, punishment.getReason());
@ -119,14 +136,17 @@ public class DataManager extends DataManagerAbstract {
statement.setLong(6, punishment.getExpiration()); statement.setLong(6, punishment.getExpiration());
statement.setLong(7, punishment.getId()); statement.setLong(7, punishment.getId());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void getAppliedPunishments(Consumer<List<AppliedPunishment>> callback) { public void getAppliedPunishments(Consumer<List<AppliedPunishment>> callback) {
List<AppliedPunishment> appliedPunishments = new ArrayList<>(); List<AppliedPunishment> appliedPunishments = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
try (Statement statement = connection.createStatement()) { try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String selectPunishments = "SELECT * FROM " + this.getTablePrefix() + "punishments"; String selectPunishments = "SELECT * FROM " + this.getTablePrefix() + "punishments";
ResultSet result = statement.executeQuery(selectPunishments); ResultSet result = statement.executeQuery(selectPunishments);
while (result.next()) { while (result.next()) {
@ -139,42 +159,51 @@ public class DataManager extends DataManagerAbstract {
long expiration = result.getLong("expiration"); long expiration = result.getLong("expiration");
appliedPunishments.add(new AppliedPunishment(punishmentType, duration, reason, victim, punisher, expiration, id)); appliedPunishments.add(new AppliedPunishment(punishmentType, duration, reason, victim, punisher, expiration, id));
} }
}
this.sync(() -> callback.accept(appliedPunishments)); this.sync(() -> callback.accept(appliedPunishments));
})); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void createNote(PunishmentNote note) { public void createNote(PunishmentNote note) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String createNote = "INSERT INTO " + this.getTablePrefix() + "notes (note, author, subject, creation) VALUES (?, ?, ?, ?)"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(createNote)) { String createNote = "INSERT INTO " + this.getTablePrefix() + "notes (note, author, subject, creation) VALUES (?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createNote);
statement.setString(1, note.getNote()); statement.setString(1, note.getNote());
statement.setString(2, note.getAuthor().toString()); statement.setString(2, note.getAuthor().toString());
statement.setString(3, note.getSubject().toString()); statement.setString(3, note.getSubject().toString());
statement.setLong(4, note.getCreationDate()); statement.setLong(4, note.getCreationDate());
statement.executeUpdate(); statement.executeUpdate();
}
int noteId = this.lastInsertedId(connection, "notes"); int noteId = this.lastInsertedId(connection, "notes");
note.setId(noteId); note.setId(noteId);
}), "create"); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void deleteNote(PunishmentNote note) { public void deleteNote(PunishmentNote note) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String deleteNote = "DELETE FROM " + this.getTablePrefix() + "notes WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(deleteNote)) { String deleteNote = "DELETE FROM " + this.getTablePrefix() + "notes WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(deleteNote);
statement.setLong(1, note.getId()); statement.setLong(1, note.getId());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void getNotes(Consumer<List<PunishmentNote>> callback) { public void getNotes(Consumer<List<PunishmentNote>> callback) {
List<PunishmentNote> notes = new ArrayList<>(); List<PunishmentNote> notes = new ArrayList<>();
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
try (Statement statement = connection.createStatement()) { try (Connection connection = this.databaseConnector.getConnection()) {
Statement statement = connection.createStatement();
String getNotes = "SELECT * FROM " + this.getTablePrefix() + "notes"; String getNotes = "SELECT * FROM " + this.getTablePrefix() + "notes";
ResultSet result = statement.executeQuery(getNotes); ResultSet result = statement.executeQuery(getNotes);
while (result.next()) { while (result.next()) {
@ -185,16 +214,19 @@ public class DataManager extends DataManagerAbstract {
long creation = result.getLong("creation"); long creation = result.getLong("creation");
notes.add(new PunishmentNote(id, note, author, subject, creation)); notes.add(new PunishmentNote(id, note, author, subject, creation));
} }
}
this.sync(() -> callback.accept(notes)); this.sync(() -> callback.accept(notes));
})); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void createTicket(Ticket ticket) { public void createTicket(Ticket ticket) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String createTicket = "INSERT INTO " + this.getTablePrefix() + "tickets (victim, subject, type, status, world, x, y, z, pitch, yaw) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(createTicket)) { String createTicket = "INSERT INTO " + this.getTablePrefix() + "tickets (victim, subject, type, status, world, x, y, z, pitch, yaw) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTicket);
statement.setString(1, ticket.getVictim().toString()); statement.setString(1, ticket.getVictim().toString());
statement.setString(2, ticket.getSubject()); statement.setString(2, ticket.getSubject());
statement.setString(3, ticket.getType()); statement.setString(3, ticket.getType());
@ -209,36 +241,44 @@ public class DataManager extends DataManagerAbstract {
statement.setFloat(9, location.getPitch()); statement.setFloat(9, location.getPitch());
statement.setFloat(10, location.getYaw()); statement.setFloat(10, location.getYaw());
statement.executeUpdate(); statement.executeUpdate();
for (TicketResponse response : ticket.getResponses()) {
createTicketResponse(response);
}
int ticketId = this.lastInsertedId(connection, "tickets");
ticket.setId(ticketId);
} catch (Exception ex) {
ex.printStackTrace();
} }
});
for (TicketResponse response : ticket.getResponses())
createTicketResponse(response);
int ticketId = this.lastInsertedId(connection, "tickets");
ticket.setId(ticketId);
}), "create");
} }
public void deleteTicket(Ticket ticket) { public void deleteTicket(Ticket ticket) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String deleteTicket = "DELETE FROM " + this.getTablePrefix() + "tickets WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(deleteTicket)) { String deleteTicket = "DELETE FROM " + this.getTablePrefix() + "tickets WHERE id = ?";
statement.setLong(1, ticket.getId()); try (PreparedStatement statement = connection.prepareStatement(deleteTicket)) {
statement.executeUpdate(); statement.setLong(1, ticket.getId());
} statement.executeUpdate();
}
String deleteTicketResponses = "DELETE FROM " + this.getTablePrefix() + "ticket_responses WHERE ticket_id = ?"; String deleteTicketResponses = "DELETE FROM " + this.getTablePrefix() + "ticket_responses WHERE ticket_id = ?";
try (PreparedStatement statement = connection.prepareStatement(deleteTicketResponses)) { try (PreparedStatement statement = connection.prepareStatement(deleteTicketResponses)) {
statement.setLong(1, ticket.getId()); statement.setLong(1, ticket.getId());
statement.executeUpdate(); statement.executeUpdate();
}
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void updateTicket(Ticket ticket) { public void updateTicket(Ticket ticket) {
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String updateTicket = "UPDATE " + this.getTablePrefix() + "tickets SET victim = ?, subject = ?, type = ?, status = ?, world = ?, x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE id = ?"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(updateTicket)) { String updateTicket = "UPDATE " + this.getTablePrefix() + "tickets SET victim = ?, subject = ?, type = ?, status = ?, world = ?, x = ?, y = ?, z = ?, pitch = ?, yaw = ? WHERE id = ?";
PreparedStatement statement = connection.prepareStatement(updateTicket);
statement.setString(1, ticket.getVictim().toString()); statement.setString(1, ticket.getVictim().toString());
statement.setString(2, ticket.getSubject()); statement.setString(2, ticket.getSubject());
statement.setString(3, ticket.getType()); statement.setString(3, ticket.getType());
@ -254,73 +294,82 @@ public class DataManager extends DataManagerAbstract {
statement.setFloat(10, location.getYaw()); statement.setFloat(10, location.getYaw());
statement.setInt(11, ticket.getId()); statement.setInt(11, ticket.getId());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
})); });
} }
public void getTickets(Consumer<Map<Integer, Ticket>> callback) { public void getTickets(Consumer<Map<Integer, Ticket>> callback) {
Map<Integer, Ticket> tickets = new TreeMap<>(); Map<Integer, Ticket> tickets = new TreeMap<>();
this.async(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
try (Statement statement = connection.createStatement()) { try (Connection connection = this.databaseConnector.getConnection()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "tickets"; try (Statement statement = connection.createStatement()) {
ResultSet result = statement.executeQuery(selectTickets); String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "tickets";
while (result.next()) { ResultSet result = statement.executeQuery(selectTickets);
int id = result.getInt("id"); while (result.next()) {
UUID victim = UUID.fromString(result.getString("victim")); int id = result.getInt("id");
String subject = result.getString("subject"); UUID victim = UUID.fromString(result.getString("victim"));
String type = result.getString("type"); String subject = result.getString("subject");
TicketStatus status = TicketStatus.valueOf(result.getString("status")); String type = result.getString("type");
TicketStatus status = TicketStatus.valueOf(result.getString("status"));
String world = result.getString("world"); String world = result.getString("world");
double x = result.getDouble("x"); double x = result.getDouble("x");
double y = result.getDouble("y"); double y = result.getDouble("y");
double z = result.getDouble("z"); double z = result.getDouble("z");
float pitch = result.getFloat("pitch"); float pitch = result.getFloat("pitch");
float yaw = result.getFloat("yaw"); float yaw = result.getFloat("yaw");
Location location = Bukkit.getWorld(world) == null ? null : new Location(Bukkit.getWorld(world), x, y, z, yaw, pitch); Location location = Bukkit.getWorld(world) == null ? null : new Location(Bukkit.getWorld(world), x, y, z, yaw, pitch);
Ticket ticket = new Ticket(id, victim, subject, type, status, location); Ticket ticket = new Ticket(id, victim, subject, type, status, location);
ticket.setId(id) ticket.setId(id)
; ;
tickets.put(id, ticket); tickets.put(id, ticket);
}
} }
}
try (Statement statement = connection.createStatement()) { try (Statement statement = connection.createStatement()) {
String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "ticket_responses"; String selectTickets = "SELECT * FROM " + this.getTablePrefix() + "ticket_responses";
ResultSet result = statement.executeQuery(selectTickets); ResultSet result = statement.executeQuery(selectTickets);
while (result.next()) { while (result.next()) {
int id = result.getInt("ticket_id"); int id = result.getInt("ticket_id");
Ticket ticket = tickets.get(id); Ticket ticket = tickets.get(id);
if (ticket == null) continue; if (ticket == null) continue;
UUID author = UUID.fromString(result.getString("author")); UUID author = UUID.fromString(result.getString("author"));
String message = result.getString("message"); String message = result.getString("message");
long postedDate = result.getLong("posted_date"); long postedDate = result.getLong("posted_date");
TicketResponse ticketResponse = new TicketResponse(author, message, postedDate); TicketResponse ticketResponse = new TicketResponse(author, message, postedDate);
ticketResponse.setTicketId(id); ticketResponse.setTicketId(id);
ticket.addResponse(ticketResponse); ticket.addResponse(ticketResponse);
}
} }
}
this.sync(() -> callback.accept(tickets)); this.sync(() -> callback.accept(tickets));
})); } catch (Exception ex) {
ex.printStackTrace();
}
});
} }
public void createTicketResponse(TicketResponse ticketResponse) { public void createTicketResponse(TicketResponse ticketResponse) {
this.queueAsync(() -> this.databaseConnector.connect(connection -> { this.runAsync(() -> {
String createTicketResponse = "INSERT INTO " + this.getTablePrefix() + "ticket_responses (ticket_id, author, message, posted_date) VALUES (?, ?, ?, ?)"; try (Connection connection = this.databaseConnector.getConnection()) {
try (PreparedStatement statement = connection.prepareStatement(createTicketResponse)) { String createTicketResponse = "INSERT INTO " + this.getTablePrefix() + "ticket_responses (ticket_id, author, message, posted_date) VALUES (?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(createTicketResponse);
statement.setInt(1, ticketResponse.getTicketId()); statement.setInt(1, ticketResponse.getTicketId());
statement.setString(2, ticketResponse.getAuthor().toString()); statement.setString(2, ticketResponse.getAuthor().toString());
statement.setString(3, ticketResponse.getMessage()); statement.setString(3, ticketResponse.getMessage());
statement.setLong(4, ticketResponse.getPostedDate()); statement.setLong(4, ticketResponse.getPostedDate());
statement.executeUpdate(); statement.executeUpdate();
} catch (Exception ex) {
ex.printStackTrace();
} }
}), "create"); });
} }
} }

View File

@ -64,6 +64,7 @@ public class Settings {
public static final ConfigSetting MYSQL_USERNAME = new ConfigSetting(config, "MySQL.Username", "user"); public static final ConfigSetting MYSQL_USERNAME = new ConfigSetting(config, "MySQL.Username", "user");
public static final ConfigSetting MYSQL_PASSWORD = new ConfigSetting(config, "MySQL.Password", "pass"); public static final ConfigSetting MYSQL_PASSWORD = new ConfigSetting(config, "MySQL.Password", "pass");
public static final ConfigSetting MYSQL_USE_SSL = new ConfigSetting(config, "MySQL.Use SSL", false); public static final ConfigSetting MYSQL_USE_SSL = new ConfigSetting(config, "MySQL.Use SSL", false);
public static final ConfigSetting MYSQL_POOL_SIZE = new ConfigSetting(config, "MySQL.Pool Size", 3, "Determines the number of connections the pool is using. Increase this value if you are getting timeout errors when more players online.");
public static void setupConfig() { public static void setupConfig() {
config.load(); config.load();