DAOs were deprecated, replaced needed methods in mongo player data instead

This commit is contained in:
spacerocket62
2020-10-27 21:11:23 -07:00
parent f9630c9597
commit e75b5f3d87
8 changed files with 50 additions and 91 deletions

View File

@ -15,15 +15,15 @@ public class MongoConnection
public Datastore getDatastore()
{
if (!plugin.config().getString("data.central.storage").equalsIgnoreCase("mongodb"))
if (!plugin.config.getString("data.central.storage").equalsIgnoreCase("mongodb"))
{
return null;
}
String host = plugin.config().getString("data.central.hostname");
int port = plugin.config().getInt("data.central.port");
String username = plugin.config().getString("data.central.user");
String password = plugin.config().getString("data.central.password");
String database = plugin.config().getString("data.central.db");
String host = plugin.config.getString("data.central.hostname");
int port = plugin.config.getInt("data.central.port");
String username = plugin.config.getString("data.central.user");
String password = plugin.config.getString("data.central.password");
String database = plugin.config.getString("data.central.db");
String connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/?authSource=" + database;
MongoClient client = new MongoClient(new MongoClientURI(connectionString));

View File

@ -40,16 +40,19 @@ public class SQLConnection
try
{
connection.prepareStatement("CREATE TABLE IF NOT EXISTS `players` (\n" +
"\t`uuid` VARCHAR(46),\n" +
"\t`name` VARCHAR(18),\n" +
"\t`login_msg` VARCHAR(256),\n" +
"\t`prefix` VARCHAR(30),\n" +
"\t`rank` VARCHAR(256),\n" +
"\t`ips` VARCHAR(65535),\n" +
"\t`coins` BIGINT,\n" +
"\tPRIMARY KEY (`uuid`)\n" +
");").execute();
if (connection != null)
{
connection.prepareStatement("CREATE TABLE IF NOT EXISTS `players` (\n" +
"\t`uuid` VARCHAR(46),\n" +
"\t`name` VARCHAR(18),\n" +
"\t`login_msg` VARCHAR(256),\n" +
"\t`prefix` VARCHAR(30),\n" +
"\t`rank` VARCHAR(256),\n" +
"\t`ips` VARCHAR(65535),\n" +
"\t`coins` BIGINT,\n" +
"\tPRIMARY KEY (`uuid`)\n" +
");").execute();
}
}
catch (SQLException throwables)
{